diff options
author | Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com> | 2021-02-19 08:27:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 08:27:11 +0100 |
commit | 750cdc00bc86b927b0f0667ff781526c3a56df09 (patch) | |
tree | 3533de2c8c97de49b7a62eb41fe151ac17bd36f3 /siphash.c | |
parent | halfsiphash header + badge (diff) | |
parent | tests (diff) | |
download | siphash-750cdc00bc86b927b0f0667ff781526c3a56df09.tar.gz siphash-750cdc00bc86b927b0f0667ff781526c3a56df09.tar.xz |
Merge pull request #34 from veorq/moretest
more tests and security checks
Diffstat (limited to 'siphash.c')
-rw-r--r-- | siphash.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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) { |