test: Rename k1/k2 to k0/k1 for consistency

This commit is contained in:
Lőrinc 2025-02-01 19:01:36 +01:00
parent c497ca6e91
commit ae87260d29

View file

@ -133,18 +133,18 @@ BOOST_AUTO_TEST_CASE(siphash)
// Check consistency between CSipHasher and SipHashUint256[Extra].
FastRandomContext ctx;
for (int i = 0; i < 16; ++i) {
uint64_t k0 = ctx.rand64();
uint64_t k1 = ctx.rand64();
uint64_t k2 = ctx.rand64();
uint256 x = m_rng.rand256();
uint32_t n = ctx.rand32();
uint8_t nb[4];
WriteLE32(nb, n);
CSipHasher sip256(k1, k2);
CSipHasher sip256(k0, k1);
sip256.Write(x);
CSipHasher sip288 = sip256;
sip288.Write(nb);
BOOST_CHECK_EQUAL(SipHashUint256(k1, k2, x), sip256.Finalize());
BOOST_CHECK_EQUAL(SipHashUint256Extra(k1, k2, x, n), sip288.Finalize());
BOOST_CHECK_EQUAL(SipHashUint256(k0, k1, x), sip256.Finalize());
BOOST_CHECK_EQUAL(SipHashUint256Extra(k0, k1, x, n), sip288.Finalize()); // TODO modified in follow-up commit
}
}