No need to recalculate iv_length

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2022-04-05 16:32:07 +02:00
parent 2773f26971
commit f96e977584

View file

@ -181,7 +181,7 @@ static int exercise_cipher_key( mbedtls_svc_key_id_t key,
if( usage & PSA_KEY_USAGE_ENCRYPT ) if( usage & PSA_KEY_USAGE_ENCRYPT )
{ {
PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) ); PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
if( PSA_CIPHER_IV_LENGTH( key_type, alg ) != 0 ) if( iv_length != 0 )
{ {
PSA_ASSERT( psa_cipher_generate_iv( &operation, PSA_ASSERT( psa_cipher_generate_iv( &operation,
iv, sizeof( iv ), iv, sizeof( iv ),