1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

psa: cipher: Add IV parameters to cipher_encrypt entry point

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron
2021-07-09 09:19:35 +02:00
parent e25351ad5b
commit a833169914
7 changed files with 49 additions and 30 deletions

View File

@ -3604,15 +3604,17 @@ psa_status_t psa_cipher_encrypt( mbedtls_svc_key_id_t key,
status = psa_driver_wrapper_cipher_encrypt(
&attributes, slot->key.data, slot->key.bytes,
alg, input, input_length,
output, output_size, output_length );
alg, output, iv_length, input, input_length,
output + iv_length, output_size - iv_length, output_length );
exit:
unlock_status = psa_unlock_key_slot( slot );
if( status == PSA_SUCCESS )
status = unlock_status;
if( status != PSA_SUCCESS )
if( status == PSA_SUCCESS )
*output_length += iv_length;
else
*output_length = 0;
return( status );