Function esp_idf_sys::mbedtls_ccm_auth_decrypt
source ยท pub unsafe extern "C" fn mbedtls_ccm_auth_decrypt(
ctx: *mut mbedtls_ccm_context,
length: usize,
iv: *const c_uchar,
iv_len: usize,
ad: *const c_uchar,
ad_len: usize,
input: *const c_uchar,
output: *mut c_uchar,
tag: *const c_uchar,
tag_len: usize,
) -> c_int
Expand description
\brief This function performs a CCM authenticated decryption of a buffer.
\param ctx The CCM context to use for decryption. This must be initialized and bound to a key. \param length The length of the input data in Bytes. \param iv The initialization vector (nonce). This must be a readable buffer of at least \p iv_len Bytes. \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, or 13. The length L of the message length field is 15 - \p iv_len. \param ad The additional data field. This must be a readable buffer of at least that \p ad_len Bytes.. \param ad_len The length of additional data in Bytes. This must be less than 2^16 - 2^8. \param input The buffer holding the input data. If \p length is greater than zero, \p input must be a readable buffer of at least that length. \param output The buffer holding the output data. If \p length is greater than zero, \p output must be a writable buffer of at least that length. \param tag The buffer holding the authentication field. This must be a readable buffer of at least \p tag_len Bytes. \param tag_len The length of the authentication field to generate in Bytes: 4, 6, 8, 10, 12, 14 or 16.
\return \c 0 on success. This indicates that the message is authentic. \return #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match. \return A cipher-specific error code on calculation failure.