Skip to content

Commit 5440deb

Browse files
Use psa_hash_compute in psa_hmac_setup_internal
1 parent 206c2a0 commit 5440deb

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

library/psa_crypto.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2725,14 +2725,8 @@ static psa_status_t psa_hmac_setup_internal( psa_hmac_internal_data *hmac,
27252725

27262726
if( key_length > block_size )
27272727
{
2728-
status = psa_hash_setup( &hmac->hash_ctx, hash_alg );
2729-
if( status != PSA_SUCCESS )
2730-
goto cleanup;
2731-
status = psa_hash_update( &hmac->hash_ctx, key, key_length );
2732-
if( status != PSA_SUCCESS )
2733-
goto cleanup;
2734-
status = psa_hash_finish( &hmac->hash_ctx,
2735-
ipad, sizeof( ipad ), &key_length );
2728+
status = psa_hash_compute( hash_alg, key, key_length,
2729+
ipad, sizeof( ipad ), &key_length );
27362730
if( status != PSA_SUCCESS )
27372731
goto cleanup;
27382732
}

0 commit comments

Comments
 (0)