Commit c6b3ef74 authored by Ulrik Sverdrup's avatar Ulrik Sverdrup

siphash: Use ~7 correctly

7 in ~7 needs to be size_t for it to be correct when len > INT_MAX.
parent a3a69311
......@@ -45,7 +45,7 @@ static void siphash_init(u64 v[5], const unsigned char key[16])
/* Load the last 0-7 bytes of `in` and put in len & 255 */
static void siphash_epilogue(u64 *m, const unsigned char *in, size_t len)
{
in += (len & ~7);
in += len & ~(size_t)7;
*m = (u64)(len & 255) << 56;
switch (len & 7) {
case 7: *m |= (u64) in[6] << 48;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment