From f5d28c84b2c129ca6a3ae6c741d1812903bec83c Mon Sep 17 00:00:00 2001 From: JP Aumasson Date: Fri, 19 Feb 2021 08:00:58 +0100 Subject: halfsiphash header + badge --- README.md | 4 ++++ halfsiphash.h | 22 ++++++++++++++++++++++ siphash.h | 1 + test.c | 5 ++--- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 halfsiphash.h diff --git a/README.md b/README.md index 2651bdd..3af4188 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # SipHash +[![License: +CC0-1.0](https://licensebuttons.net/l/zero/1.0/80x15.png)](http://creativecommons.org/publicdomain/zero/1.0/) + + SipHash is a family of pseudorandom functions (PRFs) optimized for speed on short messages. This is the reference C code of SipHash: portable, simple, optimized for clarify and debugging. diff --git a/halfsiphash.h b/halfsiphash.h new file mode 100644 index 0000000..f63e46d --- /dev/null +++ b/halfsiphash.h @@ -0,0 +1,22 @@ +/* + SipHash reference C implementation + + Copyright (c) 2012-2021 Jean-Philippe Aumasson + + Copyright (c) 2012-2014 Daniel J. Bernstein + + To the extent possible under law, the author(s) have dedicated all copyright + and related and neighboring rights to this software to the public domain + worldwide. This software is distributed without any warranty. + + You should have received a copy of the CC0 Public Domain Dedication along + with + this software. If not, see + . + */ + +#include +#include + +int halfsiphash(const uint8_t *in, const size_t inlen, const uint8_t *k, + uint8_t *out, const size_t outlen); diff --git a/siphash.h b/siphash.h index 851b326..41ebf4c 100644 --- a/siphash.h +++ b/siphash.h @@ -20,3 +20,4 @@ int siphash(const uint8_t *in, const size_t inlen, const uint8_t *k, uint8_t *out, const size_t outlen); + diff --git a/test.c b/test.c index 2c047aa..538996f 100644 --- a/test.c +++ b/test.c @@ -11,6 +11,8 @@ */ #include "vectors.h" +#include "siphash.h" +#include "halfsiphash.h" #include #include #include @@ -23,9 +25,6 @@ } \ printf("},\n"); -int siphash(const uint8_t *in, const size_t inlen, const uint8_t *k, - uint8_t *out, const size_t outlen); - int halfsiphash(const uint8_t *in, const size_t inlen, const uint8_t *k, uint8_t *out, const size_t outlen); -- cgit v1.2.3