From e88bf1712b2d7a674f2091317dae58613b44f6ac Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Mon, 16 Jun 2014 11:02:15 +0100 Subject: [PATCH] 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: Ard Biesheuvel Fixes: f00bbc25b398 ("arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions") Signed-off-by: Catalin Marinas --- arch/arm64/crypto/ghash-ce-glue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce-glue.c index b92baf3f68c72..ef6aa69c4e0c9 100644 --- a/arch/arm64/crypto/ghash-ce-glue.c +++ b/arch/arm64/crypto/ghash-ce-glue.c @@ -72,6 +72,7 @@ static int ghash_update(struct shash_desc *desc, const u8 *src, partial ? ctx->buf : NULL); kernel_neon_end(); src += blocks * GHASH_BLOCK_SIZE; + partial = 0; } if (len) memcpy(ctx->buf + partial, src, len); -- 2.39.5