aboutsummaryrefslogtreecommitdiff
path: root/siphash.c
diff options
context:
space:
mode:
authorJP Aumasson <jpa@pm.me>2021-02-19 08:21:37 +0100
committerJP Aumasson <jpa@pm.me>2021-02-19 08:21:37 +0100
commit371dd98e3508045bc8346da3ed8225b76ce536f6 (patch)
tree3533de2c8c97de49b7a62eb41fe151ac17bd36f3 /siphash.c
parenthalfsiphash header + badge (diff)
downloadsiphash-371dd98e3508045bc8346da3ed8225b76ce536f6.tar.gz
siphash-371dd98e3508045bc8346da3ed8225b76ce536f6.tar.xz
tests
Diffstat (limited to 'siphash.c')
-rw-r--r--siphash.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/siphash.c b/siphash.c
index 88f390c..065a593 100644
--- a/siphash.c
+++ b/siphash.c
@@ -20,13 +20,12 @@
#include <stdint.h>
#include <stdio.h>
-
/* default: SipHash-2-4 */
#ifndef cROUNDS
- #define cROUNDS 2
+#define cROUNDS 2
#endif
#ifndef dROUNDS
- #define dROUNDS 4
+#define dROUNDS 4
#endif
#define ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
@@ -68,16 +67,15 @@
#ifdef DEBUG
#define TRACE \
do { \
- printf("(%3zu) v0 %016"PRIx64"\n", inlen, v0); \
- printf("(%3zu) v1 %016"PRIx64"\n", inlen, v1); \
- printf("(%3zu) v2 %016"PRIx64"\n", inlen, v2); \
- printf("(%3zu) v3 %016"PRIx64"\n", inlen, v3); \
+ printf("(%3zu) v0 %016" PRIx64 "\n", inlen, v0); \
+ printf("(%3zu) v1 %016" PRIx64 "\n", inlen, v1); \
+ printf("(%3zu) v2 %016" PRIx64 "\n", inlen, v2); \
+ printf("(%3zu) v3 %016" PRIx64 "\n", inlen, v3); \
} while (0)
#else
#define TRACE
#endif
-
int siphash(const uint8_t *in, const size_t inlen, const uint8_t *k,
uint8_t *out, const size_t outlen) {