Reference siphash takes the keys as a bytes, so it makes sense to byte swap
when reifying the keys as 64-bit integers. However, Python's siphash takes host
integers in to start with.
--- /dev/null
+Don't byte swap the input keys to the SipHash algorithm on big-endian
+platforms. This should ensure siphash gives consistent results across
+platforms.
static uint64_t
-siphash24(uint64_t key0, uint64_t key1, const void *src, Py_ssize_t src_sz) {
- uint64_t k0 = _le64toh(key0);
- uint64_t k1 = _le64toh(key1);
+siphash24(uint64_t k0, uint64_t k1, const void *src, Py_ssize_t src_sz) {
uint64_t b = (uint64_t)src_sz << 56;
const uint64_t *in = (uint64_t*)src;