mirror of
https://github.com/monero-project/monero.git
synced 2026-01-27 14:54:40 +01:00
Merge pull request #5724
c223832 keccak: guard against misaligned memory accesses on ARM (moneromooo-monero)
This commit is contained in:
@@ -105,9 +105,12 @@ void keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen)
|
||||
memset(st, 0, sizeof(st));
|
||||
|
||||
for ( ; inlen >= rsiz; inlen -= rsiz, in += rsiz) {
|
||||
for (i = 0; i < rsizw; i++)
|
||||
st[i] ^= swap64le(((uint64_t *) in)[i]);
|
||||
keccakf(st, KECCAK_ROUNDS);
|
||||
for (i = 0; i < rsizw; i++) {
|
||||
uint64_t ina;
|
||||
memcpy(&ina, in + i * 8, 8);
|
||||
st[i] ^= swap64le(ina);
|
||||
}
|
||||
keccakf(st, KECCAK_ROUNDS);
|
||||
}
|
||||
|
||||
// last block and padding
|
||||
|
||||
Reference in New Issue
Block a user