aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Aumasson <jeanphilippe.aumasson@gmail.com>2016-12-25 16:10:12 +0100
committerGitHub <noreply@github.com>2016-12-25 16:10:12 +0100
commit7a9d53a81d9439ed600b2290b8c67be7f36860e8 (patch)
tree53d8cde6d37d9b014ef44d5040c991cb1bd9de11
parentautogen vectors, tweaked hsiphash (diff)
parenthalfsiphash: 4 byte chunks, not 8, so compute leftover correctly (diff)
downloadsiphash-7a9d53a81d9439ed600b2290b8c67be7f36860e8.tar.gz
siphash-7a9d53a81d9439ed600b2290b8c67be7f36860e8.tar.xz
Merge pull request #6 from zx2c4/master
halfsiphash: 4 byte chunks, not 8, so compute leftover correctly
-rw-r--r--halfsiphash.c2
1 files changed, 1 insertions, 1 deletions
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;