pub unsafe extern "C" fn bt_ccm_encrypt(
key: *const u8,
nonce: *mut u8,
plaintext: *const u8,
len: usize,
aad: *const u8,
aad_len: usize,
enc_data: *mut u8,
mic_size: usize,
) -> i32
Expand description
@brief Encrypt big-endian data with AES-CCM.
Encrypts and generates a MIC from @c plaintext with AES-CCM, as described in https://tools.ietf.org/html/rfc3610.
Places the MIC directly after the encrypted data.
@param key 128 bit MS byte first key @param nonce 13 byte MS byte first nonce @param plaintext Plaintext buffer to encrypt @param len Length of the encrypted data @param aad Additional authenticated data @param aad_len Additional authenticated data length @param enc_data Buffer to place encrypted data in @param mic_size Size of the trailing MIC (in bytes)
@retval 0 Successfully encrypted the data. @retval -EINVAL Invalid parameters.