mbedtls_psa_aead_update() function
Encrypt or decrypt a message fragment in an active AEAD operation. Before calling this function, the PSA core will: 1. Call either mbedtls_psa_aead_encrypt_setup() or mbedtls_psa_aead_decrypt_setup(). The choice of setup function determines whether this function encrypts or decrypts its input. 2. Set the nonce with mbedtls_psa_aead_set_nonce(). 3. Call mbedtls_psa_aead_update_ad() to pass all the additional data. If this function returns an error status, the PSA core will call mbedtls_psa_aead_abort(). This function does not require the input to be aligned to any particular block boundary. If the implementation can only process a whole block at a time, it must consume all the input provided, but it may delay the end of the corresponding output until a subsequent call to mbedtls_psa_aead_update(), mbedtls_psa_aead_finish() provides sufficient input. The amount of data that can be delayed in this way is bounded by #PSA_AEAD_UPDATE_OUTPUT_SIZE.
Arguments
operation
Active AEAD 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. This must be appropriate for the selected algorithm and key: - A sufficient output size is #PSA_AEAD_UPDATE_OUTPUT_SIZE(\c key_type, \c alg, \p input_length) where \c key_type is the type of key and \c alg is the algorithm that were used to set up the operation. - #PSA_AEAD_UPDATE_OUTPUT_MAX_SIZE(\p input_length) evaluates to the maximum output size of any supported AEAD algorithm.
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_AEAD_UPDATE_OUTPUT_SIZE(\c key_type, \c alg, \p input_length) or #PSA_AEAD_UPDATE_OUTPUT_MAX_SIZE(\p input_length) can be used to determine the required buffer size.
Notes
The signature of this function is that of a PSA driver aead_update entry point. This function behaves as an aead_update entry point as defined in the PSA driver interface specification for transparent drivers.
mbedtls_psa_aead_update() is called by 1 function and calls 4 functions:
![]()
mbedtls_psa_aead_update()
mbedtls_psa_aead_update() reads 2 variables:
![]()
mbedtls_psa_aead_update()