Skip to content

Commit 84b8fc8

Browse files
Use psa_hash_compute in psa_hmac_setup_internal
1 parent 7b8efaf commit 84b8fc8

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
@@ -2737,14 +2737,8 @@ static psa_status_t psa_hmac_setup_internal( psa_hmac_internal_data *hmac,
27372737

27382738
if( key_length > block_size )
27392739
{
2740-
status = psa_hash_setup( &hmac->hash_ctx, hash_alg );
2741-
if( status != PSA_SUCCESS )
2742-
goto cleanup;
2743-
status = psa_hash_update( &hmac->hash_ctx, key, key_length );
2744-
if( status != PSA_SUCCESS )
2745-
goto cleanup;
2746-
status = psa_hash_finish( &hmac->hash_ctx,
2747-
ipad, sizeof( ipad ), &key_length );
2740+
status = psa_hash_compute( hash_alg, key, key_length,
2741+
ipad, sizeof( ipad ), &key_length );
27482742
if( status != PSA_SUCCESS )
27492743
goto cleanup;
27502744
}

0 commit comments

Comments
 (0)