summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-03-15 17:44:42 +0000
committerPauli <ppzgs1@gmail.com>2021-03-17 10:16:21 +1000
commit5db682733de0afcfece92ac011c1eb1ca775c32a (patch)
treec52ee42bbefeae16e768b66f8166e86cbef27898 /include
parent37cddb2e2df4f815a6d3fdb857d1ef8cddef9ce9 (diff)
Fix a TODO(3.0) in the siphash code
All 3 files that included crypto/siphash.h also included siphash_local.h, and no other files included siphash_local.h independently. They probably should be just one header file. Fixes #14360 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14558)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/siphash.h19
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