ocaml/ocaml — pull request #24 by nbraud (2014-03-26 22:45:52+00:00)
Title: Switch to the SipHash hash function

The patchset changes the C API exposed in `hash.h` to make it digest-agnostic
(so as to make future changes simpler) and switches the hash function to
[SipHash-2-4](https://131002.net/siphash/).

SipHash is a familly of cryptographically-strong hash functions which are
competitive (performance-wise) with MurmurHash, the hash function currently used.
SipHash-2-4 is the recommended version of SipHash.

Preliminary benchmarks look good. However, they were done using the functorized
version of Hashtbl, and this specific proposal hasn't been benchmarked yet.

Caveats:
- The testsuite hasn't been fixed yet (expected values changed for hashes)
Commits expected to change the behaviour of the hash function are
`7dde207fe838558abbbef4fe0607229111780191` and
`28bde97b87021e6bab9f74f49d24905611f2d62b`
- This patchset doesn't change the bit-width of the key and output (32 bits).
This weakens the hash function, compared to SipHash-2-4 as specified by its
authors, but isn't fixable without breaking the API.