hash/siphash: correct the update loop bounds

This commit is contained in:
Danny Robson 2022-07-21 14:23:17 +10:00
parent cc3153123e
commit f962653818

View File

@ -101,7 +101,7 @@ siphash<C,D>::operator() (cruft::view<const uint8_t*> data) const noexcept
// update
auto cursor = data.begin ();
for ( ; data.end () - cursor > 8; cursor += sizeof (uint64_t)) {
for ( ; data.end () - cursor >= 8; cursor += sizeof (uint64_t)) {
auto word = readle<uint64_t> (cursor);
state[3] ^= word;