Does an Authenticated Encryption according to the mode desired, using the given symmetric parameters, the mode and the encryption parameters.
#include "huauthenc.h"
int hu_AuthEncAuthenticateEncryptMsg(sb_Params symParams, int mode, sb_Key authEncKey, 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 *mac, unsigned char *ciphertext, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
A symmetric algorithm parameters object. AES is the only algorithm currently supported.
The mode of operation. The acceptable values are SB_CCM, SB_CCM_STAR and SB_GCM.
An authenticated encryption key
The length (in bytes) of nonce. For SB_CCM and SB_CCM_STAR, acceptable values are 7, 8, 9, 10, 11, 12 and 13. For SB_GCM, nonceLen must be greater than 0 and the recommended value is 12.
Nonce buffer.
The length (in bytes) of additional data that will be processed. This is optional for SB_GCM.
The additional data buffer.
The length (in bytes) of plaintext.
The plaintext buffer.
The length (in bytes) of the mac buffer. The macLen must match the value supplied in the hu_AuthEncBegin() function.
The mac buffer.
The ciphertext buffer.
A global context.
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.