Skip to content

Commit 4053919

Browse files
Use psa_hash_compute in psa_hmac_setup_internal
1 parent 86bc30f commit 4053919

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

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

0 commit comments

Comments
 (0)