psa: cipher: Add IV parameters to cipher_encrypt entry point
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 20f525b..028eafc 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -3604,15 +3604,17 @@
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 );