X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=crypto%2Fsha3_generic.c;h=a68be626017c2b7eb9785e02b6806f8ed665f7ae;hb=5ed3c7ee4ca64ac3634f000200f0bdd582fd5062;hp=7e8ed96236cefa794ca39684c9c2592ca49f7976;hpb=5b56b9bb6ce64d72288a02dc3e8da5fc3eb0344a;p=mirror_ubuntu-bionic-kernel.git diff --git a/crypto/sha3_generic.c b/crypto/sha3_generic.c index 7e8ed96236ce..a68be626017c 100644 --- a/crypto/sha3_generic.c +++ b/crypto/sha3_generic.c @@ -18,6 +18,7 @@ #include #include #include +#include #define KECCAK_ROUNDS 24 @@ -149,7 +150,7 @@ static int sha3_update(struct shash_desc *desc, const u8 *data, unsigned int i; for (i = 0; i < sctx->rsizw; i++) - sctx->st[i] ^= ((u64 *) src)[i]; + sctx->st[i] ^= get_unaligned_le64(src + 8 * i); keccakf(sctx->st); done += sctx->rsiz; @@ -174,7 +175,7 @@ static int sha3_final(struct shash_desc *desc, u8 *out) sctx->buf[sctx->rsiz - 1] |= 0x80; for (i = 0; i < sctx->rsizw; i++) - sctx->st[i] ^= ((u64 *) sctx->buf)[i]; + sctx->st[i] ^= get_unaligned_le64(sctx->buf + 8 * i); keccakf(sctx->st);