-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Issue: When using 8-byte key, half_siphash_32() changes output depending on when and where its called.
Suspected Cause: C library function is reading memory from the 9th byte onwards.
Steps to reproduce bug:
# Run the following code
from siphash import half_siphash_32
data = b'PQWXWDRRASD2164DW5G'
key = b'\x124Vx' # 8-byte key
half_siphash_32(key, data)
key = b'\x124Vx'
half_siphash_32(key, data)
key = b'\x124Vx'
half_siphash_32(key, data)
key = b'\x124Vx'
half_siphash_32(key, data)
My output:
>>> from siphash import half_siphash_32
>>>
>>> data = b'PQWXWDRRASD2164DW5G'
>>> key = b'\x124Vx'
>>> half_siphash_32(key, data)
b'\xb73(\x1c'
>>> key = b'\x124Vx'
>>> half_siphash_32(key, data)
b'\x15\xcf\x1e\xa3'
>>> key = b'\x124Vx'
>>> half_siphash_32(key, data)
b'\xb73(\x1c'
>>> key = b'\x124Vx'
>>> half_siphash_32(key, data)
b'\x15\xcf\x1e\xa3'
As shown above, half_siphash_32 returns b'\x15\xcf\x1e\xa3' or b'\xb73(\x1c' randomly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels