From e3baf6b849678d934c09de7e6360062fc612f3b0 Mon Sep 17 00:00:00 2001 From: Niels Werensteijn Date: Tue, 11 Oct 2016 08:20:58 +0200 Subject: [PATCH] added siphash24.h --- src/siphash24.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/siphash24.h diff --git a/src/siphash24.h b/src/siphash24.h new file mode 100644 index 0000000..f385f5d --- /dev/null +++ b/src/siphash24.h @@ -0,0 +1,38 @@ +#ifndef _TS3INIT_SIPHASH_H +#define _TS3INIT_SIPHASH_H + +/* + SipHash reference C implementation + Copyright (c) 2012-2014 Jean-Philippe Aumasson + + Copyright (c) 2012-2014 Daniel J. Bernstein + Copyright (c) 2016 Maximilian Muenchow + Copyright (c) 2016 Niels Werensteijn + 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 + +struct ts3init_siphash_state +{ + u64 v0; + u64 v1; + u64 v2; + u64 v3; + u64 m; + size_t len; +}; + +void ts3init_siphash_setup(struct ts3init_siphash_state* state, u64 k0, u64 k1); +void ts3init_siphash_update(struct ts3init_siphash_state* state, const u8 *in, size_t inlen); +u64 ts3init_siphash_finalize(struct ts3init_siphash_state* state); + +#endif /*_TS3INIT_SIPHASH_H*/ +