Skip to content

Commit f6a4587

Browse files
author
Eric Biggers
committed
crypto: arm64/ghash - Fix incorrect output from ghash-neon
Commit 9a7c987 ("crypto: arm64/ghash - Use API partial block handling") made ghash_finup() pass the wrong buffer to ghash_do_simd_update(). As a result, ghash-neon now produces incorrect outputs when the message length isn't divisible by 16 bytes. Fix this. (I didn't notice this earlier because this code is reached only on CPUs that support NEON but not PMULL. I haven't yet found a way to get qemu-system-aarch64 to emulate that configuration.) Fixes: 9a7c987 ("crypto: arm64/ghash - Use API partial block handling") Cc: stable@vger.kernel.org Reported-by: Diederik de Haas <diederik@cknow-tech.com> Closes: https://lore.kernel.org/linux-crypto/DETXT7QI62KE.F3CGH2VWX1SC@cknow-tech.com/ Tested-by: Diederik de Haas <diederik@cknow-tech.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Link: https://lore.kernel.org/r/20251209223417.112294-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 6f7d948 commit f6a4587

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/crypto/ghash-ce-glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static int ghash_finup(struct shash_desc *desc, const u8 *src,
133133
u8 buf[GHASH_BLOCK_SIZE] = {};
134134

135135
memcpy(buf, src, len);
136-
ghash_do_simd_update(1, ctx->digest, src, key, NULL,
136+
ghash_do_simd_update(1, ctx->digest, buf, key, NULL,
137137
pmull_ghash_update_p8);
138138
memzero_explicit(buf, sizeof(buf));
139139
}

0 commit comments

Comments
 (0)