Does an authenticated decryption according to the AES CCM algorithm with the given AES parameters and key objects.
#include "huaes.h"
int hu_AESCCMAuthDecrypt(sb_Params aesParams, sb_Key aesKey, size_t nonceLen, const unsigned char *nonce, size_t addDataLen, const unsigned char *addData, size_t ciphertextLen, const unsigned char *ciphertext, size_t macLen, unsigned char *plaintext, 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 ciphertext. If ciphertextLen is not 0, then ciphertext cannot be NULL.
Ciphertext buffer. This data will be authenticated and decrypted.
The length of the CBC-MAC used for authentication. Acceptable values are 4, 6, 8, 10, 12, 14 and 16.
The plaintext buffer. The plaintext buffer must be at least ciphertext - 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 ciphertext, nonce, or addData buffer is NULL.
The macLen is invalid.
The plaintext buffer is NULL.
ciphertextLen is not consistent with nonceLen.
The MAC is invalid.
Memory allocation failure.
Success.