Function esp_idf_svc::sys::mbedtls_ccm_update_ad
source ยท pub unsafe extern "C" fn mbedtls_ccm_update_ad(
ctx: *mut mbedtls_ccm_context,
ad: *const u8,
ad_len: usize,
) -> i32
Expand description
\brief 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().
\note This function is not implemented in Mbed TLS yet.
\param 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(). \param ad The buffer holding the additional data, or \c NULL if \p ad_len is \c 0. \param ad_len The length of the additional data. If \c 0, \p ad may be \c NULL.
\return \c 0 on success. \return #MBEDTLS_ERR_CCM_BAD_INPUT on failure: \p ctx is in an invalid state, total input length too long.