diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/siphash.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/crypto/siphash.h b/include/crypto/siphash.h index 02f74c4ae2..0d0767fcf4 100644 --- a/include/crypto/siphash.h +++ b/include/crypto/siphash.h @@ -28,4 +28,23 @@ int SipHash_Init(SIPHASH *ctx, const unsigned char *k, void SipHash_Update(SIPHASH *ctx, const unsigned char *in, size_t inlen); int SipHash_Final(SIPHASH *ctx, unsigned char *out, size_t outlen); +/* Based on https://131002.net/siphash C reference implementation */ + +struct siphash_st { + uint64_t total_inlen; + uint64_t v0; + uint64_t v1; + uint64_t v2; + uint64_t v3; + unsigned int len; + unsigned int hash_size; + unsigned int crounds; + unsigned int drounds; + unsigned char leavings[SIPHASH_BLOCK_SIZE]; +}; + +/* default: SipHash-2-4 */ +# define SIPHASH_C_ROUNDS 2 +# define SIPHASH_D_ROUNDS 4 + #endif |