mbedtls_ccm_star_auth_decrypt() function
This function performs a CCM* authenticated decryption of a buffer. \warning Passing \c 0 as \p tag_len means that the message is nos longer authenticated.
Arguments
ctx
The CCM context to use for decryption. This must be initialized and bound to a key.
length
The length of the input data in Bytes. For tag length = 0, input length is ignored.
iv
The initialization vector (nonce). This must be a readable buffer of at least \p iv_len Bytes.
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.
ad
The additional data field. This must be a readable buffer of at least that \p ad_len Bytes.
ad_len
The length of additional data in Bytes. This must be less than 2^16 - 2^8.
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.
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.
tag
The buffer holding the authentication field. This must be a readable buffer of at least \p tag_len Bytes.
tag_len
The length of the authentication field in Bytes. 0, 4, 6, 8, 10, 12, 14 or 16.
Return value
\c 0 on success. #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match. A cipher-specific error code on calculation failure.
Notes
When using this function in a variable tag length context, the tag length has to be decoded from \p iv and passed to this function as \p tag_len. (\p tag needs to be adjusted accordingly.)
mbedtls_ccm_star_auth_decrypt() calls 1 function:
![]()
mbedtls_ccm_star_auth_decrypt()
mbedtls_ccm_star_auth_decrypt():
![]()
mbedtls_ccm_star_auth_decrypt()