Hi,
It seems gxhash64() does this to reduce 256 to 64 bits:
return *(uint64_t*)&full_hash;
However, all the mixing operations in GxHash (when using AVX2; not so much on NEON) are two parallel 128-bit lanes that never get combined together (all the operations are _si128, so 128-bit AES). Thus, when dealing with e.g. 32-byte strings, this means that the returned answer is entirely unaffected by the contents of bytes 16…31. gxhash32() has the same problem.
I found this out when trying to use the code for a real-world system and then ended up with tons of collisions on almost-equal strings :-) I'm a bit surprised that no SMHasher tests triggered on this.
Hi,
It seems gxhash64() does this to reduce 256 to 64 bits:
However, all the mixing operations in GxHash (when using AVX2; not so much on NEON) are two parallel 128-bit lanes that never get combined together (all the operations are _si128, so 128-bit AES). Thus, when dealing with e.g. 32-byte strings, this means that the returned answer is entirely unaffected by the contents of bytes 16…31. gxhash32() has the same problem.
I found this out when trying to use the code for a real-world system and then ended up with tons of collisions on almost-equal strings :-) I'm a bit surprised that no SMHasher tests triggered on this.