mbedtls_psa_cipher_set_iv() function
Set the IV for a symmetric encryption or decryption operation. This function sets the IV (initialization vector), nonce or initial counter value for the encryption or decryption operation.
Arguments
operation
Active cipher operation.
iv
Buffer containing the IV to use.
iv_length
Size of the IV in bytes. It is guaranteed by the core to be less or equal to PSA_CIPHER_IV_MAX_SIZE.
Return value
#PSA_SUCCESS \emptydescription #PSA_ERROR_INVALID_ARGUMENT The size of \p iv is not acceptable for the chosen algorithm, or the chosen algorithm does not use an IV. #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
Notes
The signature of this function is that of a PSA driver cipher_set_iv entry point. This function behaves as a cipher_set_iv entry point as defined in the PSA driver interface specification for transparent drivers.
mbedtls_psa_cipher_set_iv() is called by 3 functions and calls 2 functions:
![]()
mbedtls_psa_cipher_set_iv()
mbedtls_psa_cipher_set_iv() reads 2 variables:
![]()
mbedtls_psa_cipher_set_iv()