Does an authenticated encryption according to the AES CCM algorithm with the given AES parameters and key objects.
#include "huaes.h"
int hu_AESCCMAuthEncrypt(sb_Params aesParams, sb_Key aesKey, size_t nonceLen, const unsigned char *nonce, size_t addDataLen, const unsigned char *addData, size_t plaintextLen, const unsigned char *plaintext, size_t macLen, unsigned char *ciphertext, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
The AES parameters object.
The AES key object. The key must be a valid encryption key.
The length (in bytes) of nonce. Acceptable values are 7, 8, 9, 10, 11, 12 and 13.
Nonce buffer.
The length (in bytes) of additional data. If addDataLen is not 0, then addData cannot be NULL.
Additional data buffer. This data will be authenticated, but will not be encrypted.
The length (in bytes) of plaintext. If plaintextLen is not 0, then plaintext cannot be NULL.
Plaintext buffer. This data will be authenticated and encrypted.
The length of the CBC-MAC used for authentication. Acceptable values are 4, 6, 8, 10, 12, 14 and 16.
The ciphertext buffer. The ciphertext buffer must be at least plaintext + macLen bytes in length.
A global context.
CCM is described in NIST Special Publication 800-38C.
The plaintext and ciphertext buffers may overlap in memory subject to the constraints described in the API Reference section on overlapping buffers.
The adapter registered for AES must support SB_AES_ECB and SB_AES_CBC.
This function should only be called for buffers of plaintext and ciphertext that can be stored entirely in memory.
The aesParams object is NULL.
The tag for the params object is not of the expected type.
The aesKey object is NULL.
The aesKey object is invalid.
aesParams uses an invalid mode of operation.
The plaintext, nonce, or addData buffer is NULL.
The nonceLen is invalid.
The macLen is invalid.
The ciphertext buffer is NULL.
Memory allocation failure.
Success.