diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-12 04:51:34 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-12 04:51:34 +0100 |
commit | 2af27f772b6a487bcb29673a9b3f8fd551acc34b (patch) | |
tree | 8f4b3c88c39045c92706941f6e31721def5dad00 /src | |
parent | 848c9e0f074095bfd680bd29cac120cc2bb2856c (diff) |
siphash: useless rice
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/crypto/siphash24.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/crypto/siphash24.c b/src/crypto/siphash24.c index c9d4127..727ae4b 100644 --- a/src/crypto/siphash24.c +++ b/src/crypto/siphash24.c @@ -17,20 +17,18 @@ static inline u64 le64_to_cpuvp(const void *p) v2 += v1; v1 = rol64(v1, 17); v1 ^= v2; v2 = rol64(v2, 32); \ } while(0) -__attribute__((optimize("unroll-loops"))) u64 siphash24(const u8 *data, size_t len, const u8 key[SIPHASH24_KEY_LEN]) { u64 v0 = 0x736f6d6570736575ULL; u64 v1 = 0x646f72616e646f6dULL; u64 v2 = 0x6c7967656e657261ULL; u64 v3 = 0x7465646279746573ULL; - u64 b; + u64 b = ((u64)len) << 56; u64 k0 = le64_to_cpuvp(key); u64 k1 = le64_to_cpuvp(key + sizeof(u64)); u64 m; const u8 *end = data + len - (len % sizeof(u64)); const u8 left = len & (sizeof(u64) - 1); - b = ((u64)len) << 56; v3 ^= k1; v2 ^= k0; v1 ^= k1; |