1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-07-23 01:32:15 +08:00

Fix when reusing the same context for another operation.

Occurs in hmac, where multiple hashes are performed with the same context) and thus, it requires to reinitialize the internal states to 0.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-05-20 16:01:07 +02:00
parent ebb3640ada
commit 938b5abb13
No known key found for this signature in database
GPG Key ID: C0095B7870A4CCD3

View File

@ -212,6 +212,9 @@ int mbedtls_sha3_starts( mbedtls_sha3_context *ctx, mbedtls_sha3_id id )
ctx->xor_byte = p->xor_byte;
ctx->max_block_size = ctx->r / 8;
memset( ctx->state, 0, sizeof( ctx->state ) );
ctx->index = 0;
return( 0 );
}