tc_ccm_decryption_verification() function
CCM decryption and tag verification procedure @note: out buffer should be at least (plen - c->mlen) bytes long. @note: The sequence b for encryption is formatted as follows: b = [FLAGS | nonce | counter ], where: FLAGS is 1 byte long nonce is 13 bytes long counter is 2 bytes long The byte FLAGS is composed by the following 8 bits: 0-2 bits: used to represent the value of q-1 3-7 btis: always 0's @note: The sequence b for authentication is formatted as follows: b = [FLAGS | nonce | length(mac length)], where: FLAGS is 1 byte long nonce is 13 bytes long length(mac length) is 2 bytes long The byte FLAGS is composed by the following 8 bits: 0-2 bits: used to represent the value of q-1 3-5 bits: mac length (encoded as: (mlen-2)/2) 6: Adata (0 if alen == 0, and 1 otherwise) 7: always 0
Arguments
associated_data
IN -- associated data
alen
IN -- associated data length in bytes
plen
IN -- payload length in bytes
Return value
returns TC_CRYPTO_SUCCESS (1) returns TC_CRYPTO_FAIL (0) if: out == NULL or c == NULL or ((plen > 0) and (payload == NULL)) or ((alen > 0) and (associated_data == NULL)) or (alen >= TC_CCM_AAD_MAX_BYTES) or (plen >= TC_CCM_PAYLOAD_MAX_BYTES) or (olen mlen)
tc_ccm_decryption_verification() calls 7 functions:
![]()
tc_ccm_decryption_verification()
tc_ccm_decryption_verification() reads 3 variables:
![]()
tc_ccm_decryption_verification()