13#define SIPROUND do { \
14 v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
15 v0 = std::rotl(v0, 32); \
16 v2 += v3; v3 = std::rotl(v3, 16); v3 ^= v2; \
17 v0 += v3; v3 = std::rotl(v3, 21); v3 ^= v0; \
18 v2 += v1; v1 = std::rotl(v1, 17); v1 ^= v2; \
19 v2 = std::rotl(v2, 32); \
50 while (data.size() > 0) {
60 data = data.subspan(1);
88 return v0 ^ v1 ^ v2 ^
v3;
93 uint64_t v0 = m_state.v[0], v1 = m_state.v[1], v2 = m_state.v[2],
v3 = m_state.v[3];
100 d = val.GetUint64(1);
105 d = val.GetUint64(2);
110 d = val.GetUint64(3);
124 return v0 ^ v1 ^ v2 ^
v3;
130 uint64_t v0 = m_state.v[0], v1 = m_state.v[1], v2 = m_state.v[2],
v3 = m_state.v[3];
136 d = val.GetUint64(1);
141 d = val.GetUint64(2);
146 d = val.GetUint64(3);
161 return v0 ^ v1 ^ v2 ^
v3;
General SipHash-2-4 implementation.
uint8_t m_count
Only the low 8 bits of the input size matter.
uint64_t Finalize() const
Compute the 64-bit SipHash-2-4 of the data written so far.
CSipHasher(uint64_t k0, uint64_t k1)
Construct a SipHash calculator initialized with 128-bit key (k0, k1).
CSipHasher & Write(uint64_t data)
Hash a 64-bit integer worth of data.
uint64_t operator()(const uint256 &val) const noexcept
Equivalent to CSipHasher(k0, k1).Write(val).Finalize().
std::array< uint64_t, 4 > v
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.