Skip to content

Commit ec59a65

Browse files
Ard Biesheuvelherbertx
authored andcommitted
crypto: arm64/sha2-ce - prevent asm code finalization in final() path
Ensure that the asm code finalization path is not triggered when invoked via final(), since it already takes care of that itself. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent bf7883e commit ec59a65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ static int sha256_ce_finup(struct shash_desc *desc, const u8 *data,
7575

7676
static int sha256_ce_final(struct shash_desc *desc, u8 *out)
7777
{
78+
struct sha256_ce_state *sctx = shash_desc_ctx(desc);
79+
80+
sctx->finalize = 0;
7881
kernel_neon_begin_partial(28);
7982
sha256_base_do_finalize(desc, (sha256_block_fn *)sha2_ce_transform);
8083
kernel_neon_end();

0 commit comments

Comments
 (0)