Undefined behaviour fixes

This commit is contained in:
SChernykh
2022-04-08 22:34:37 +02:00
parent afb52e4235
commit 7b5b910f3f
3 changed files with 31 additions and 12 deletions

View File

@@ -159,7 +159,7 @@ NOINLINE void keccak(const uint8_t* in, int inlen, uint8_t* md, int mdlen)
for (; inlen >= rsiz; inlen -= rsiz, in += rsiz) {
for (int i = 0; i < rsizw; i++) {
st[i] ^= ((uint64_t*)in)[i];
st[i] ^= read_unaligned(reinterpret_cast<const uint64_t*>(in) + i);
}
keccakf(st);
}