siphash: Fix bug in state initialisation
The SipHash algorithm starts with initializing the 32 bytes of internal state with some magic numbers XORed with the hash key. However, our implementation has a bug - rather than XORing the hash key, it *sets* the initial state to copies of the key. I don't know if that affects any of the cryptographic properties of SipHash but it's not what we should be doing. Fix it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
831067f483
commit
5cc843521d
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@
|
||||||
\
|
\
|
||||||
do { \
|
do { \
|
||||||
for (__i = sizeof(v) / sizeof(v[0]) - 1; __i >= 0; __i--) \
|
for (__i = sizeof(v) / sizeof(v[0]) - 1; __i >= 0; __i--) \
|
||||||
v[__i] = k[__i % 2]; \
|
v[__i] ^= k[__i % 2]; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue