psa_cipher_update() function
Encrypt or decrypt a message fragment in an active cipher operation. Before calling this function, you must: 1. Call either psa_cipher_encrypt_setup() or psa_cipher_decrypt_setup(). The choice of setup function determines whether this function encrypts or decrypts its input. 2. If the algorithm requires an IV, call psa_cipher_generate_iv() (recommended when encrypting) or psa_cipher_set_iv(). If this function returns an error status, the operation enters an error state and must be aborted by calling psa_cipher_abort().
Arguments
operation
Active cipher operation.
input
Buffer containing the message fragment to encrypt or decrypt.
input_length
Size of the \p input buffer in bytes.
output
Buffer where the output is to be written.
output_size
Size of the \p output buffer in bytes.
output_length
On success, the number of bytes that make up the returned output.
Return value
#PSA_SUCCESS Success. #PSA_ERROR_BUFFER_TOO_SMALL The size of the \p output buffer is too small. #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription #PSA_ERROR_HARDWARE_FAILURE \emptydescription #PSA_ERROR_CORRUPTION_DETECTED \emptydescription #PSA_ERROR_STORAGE_FAILURE \emptydescription #PSA_ERROR_BAD_STATE The operation state is not valid (it must be active, with an IV set if required for the algorithm), or the library has not been previously initialized by psa_crypto_init(). It is implementation-dependent whether a failure to initialize results in this error code.