mbedtls_ccm_update_ad() function
This function feeds an input buffer as associated data (authenticated but not encrypted data) in a CCM encryption or decryption operation. You may call this function zero, one or more times to pass successive parts of the additional data. The lengths \p ad_len of the data parts should eventually add up exactly to the total length of additional data \c total_ad_len passed to mbedtls_ccm_set_lengths(). You may not call this function after calling mbedtls_ccm_update().
Arguments
ctx
The CCM context. This must have been started with mbedtls_ccm_starts(), the lengths of the message and additional data must have been declared with mbedtls_ccm_set_lengths() and this must not have yet received any input with mbedtls_ccm_update().
ad
The buffer holding the additional data, or \c NULL if \p ad_len is \c 0.
ad_len
The length of the additional data. If \c 0, \p ad may be \c NULL.
Return value
\c 0 on success. #MBEDTLS_ERR_CCM_BAD_INPUT on failure: \p ctx is in an invalid state, total input length too long.
Notes
This function is not implemented in Mbed TLS yet.
mbedtls_ccm_update_ad() is called by 2 functions and calls 2 functions:
![]()
mbedtls_ccm_update_ad()
mbedtls_ccm_update_ad() reads 4 variables and writes 2 variables:
![]()
mbedtls_ccm_update_ad()