From bbca6c961fee55036e443c09dd55306b3da86781 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 21 Dec 2016 21:12:46 +0100 Subject: [PATCH] halfsiphash: 4 byte chunks, not 8, so compute leftover correctly --- halfsiphash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/halfsiphash.c b/halfsiphash.c index 3683ce2..d74d3be 100644 --- a/halfsiphash.c +++ b/halfsiphash.c @@ -83,7 +83,7 @@ int halfsiphash(const uint8_t *in, const size_t inlen, const uint8_t *k, uint32_t m; int i; const uint8_t *end = in + inlen - (inlen % sizeof(uint32_t)); - const int left = inlen & 7; + const int left = inlen & 3; uint32_t b = ((uint32_t)inlen) << 24; v3 ^= k1; v2 ^= k0;