mbedtls_ccm_starts() function
This function starts a CCM encryption or decryption operation. This function and mbedtls_ccm_set_lengths() must be called before calling mbedtls_ccm_update_ad() or mbedtls_ccm_update(). This function can be called before or after mbedtls_ccm_set_lengths().
Arguments
ctx
The CCM context. This must be initialized.
mode
The operation to perform: #MBEDTLS_CCM_ENCRYPT or #MBEDTLS_CCM_DECRYPT or #MBEDTLS_CCM_STAR_ENCRYPT or #MBEDTLS_CCM_STAR_DECRYPT.
iv
The initialization vector. 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.
Return value
\c 0 on success. #MBEDTLS_ERR_CCM_BAD_INPUT on failure: \p ctx is in an invalid state, \p mode is invalid, \p iv_len is invalid (lower than \c 7 or greater than \c 13).
Notes
This function is not implemented in Mbed TLS yet.
mbedtls_ccm_starts() is called by 3 functions and calls 1 function:
![]()
mbedtls_ccm_starts()
mbedtls_ccm_starts() reads 4 variables and writes 3 variables:
![]()
mbedtls_ccm_starts()