Commit 6aa8b209 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Catalin Marinas

arm64/crypto: fix data corruption bug in GHASH algorithm

This fixes a bug in the GHASH algorithm resulting in the calculated hash to be
incorrect if the input is presented in chunks whose size is not a multiple of
16 bytes.
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: fdd23894 ("arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions")
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 89072728
...@@ -72,6 +72,7 @@ static int ghash_update(struct shash_desc *desc, const u8 *src, ...@@ -72,6 +72,7 @@ static int ghash_update(struct shash_desc *desc, const u8 *src,
partial ? ctx->buf : NULL); partial ? ctx->buf : NULL);
kernel_neon_end(); kernel_neon_end();
src += blocks * GHASH_BLOCK_SIZE; src += blocks * GHASH_BLOCK_SIZE;
partial = 0;
} }
if (len) if (len)
memcpy(ctx->buf + partial, src, len); memcpy(ctx->buf + partial, src, len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment