Creates an Authenticated Encryption context initialized with the given symmetric parameters and key.
#include "huauthenc.h"
int hu_AuthEncBegin(sb_Params symParams, sb_Key authEncKey, size_t nonceLen, const unsigned char *nonce, size_t addDataLen, size_t plaintextLen, size_t macLen, sb_Context *authEncCtx, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
The symmetric algorithm parameters object. AES is the only algorithm currently supported.
An authenticated encryption key
The length (in bytes) of the 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 length (in bytes) of plaintext that will be processed. This is optional for SB_GCM.
The length of the MAC used for authentication. For SB_CCM and SB_CCM_STAR, acceptable values are 4, 6, 8, 10, 12, 14 and 16. SB_CCM_STAR may also specify a macLen of 0 if authentication is not required. For SB_GCM, macLen must be greater than or equal to 4 and less than or equal to 16.
The Authenticated Encryption context object pointer.
Global context.
The addDataLen and plaintextLen parameters are required for the SB_CCM and SB_CCM_STAR modes, and are optional for the SB_GCM mode. If those parameters are provided for the SB_GCM mode, then a check will be done in the hu_AuthEncEncryptEnd() and hu_AuthEncDecryptEnd() functions to ensure the length of plaintext and additional data processed matches the lengths specified in the hu_AuthEncBegin() function.
The authEncKey parameter is of the wrong type.
The nonceLen parameter violates acceptable values
The nonce parameter is NULL
The macLen parameter violates acceptable values.