Creates an AES parameters object.
#include "huaes.h"
int hu_AESParamsCreate(int mode, size_t blockLen, sb_RNGCtx rngContext, sb_YieldCtx yieldCtx, sb_Params *aesParams, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
The mode of operation. The acceptable values are SB_AES_ECB, SB_AES_CBC, SB_AES_CFB128, SB_AES_CFB8, SB_AES_OFB128, SB_AES_KEYWRAP, SB_AES_CTR(ctrBits) and SB_AES_XTS(unitBytes). For SB_AES_CTR(ctrBits), ctrBits is the number of bits that will be used for the counter. ctrBits must be less than or equal to SB_AES_128_BLOCK_BITS. 0 is also acceptable since some adapters support hu_AESBeginV2(). For SB_AES_XTS(unitBytes), unitBytes is the number of bytes in a data unit. The number of bytes in a data unit must be a multiple of 16. By NIST SP 800-38E, the minimum number of bytes in a data unit is 16, and the maximum number of bytes allowed in a data unit is 2^24 = (0x1000000). Note that on platforms where int is 4 bytes, only up to 2^24 - 16 (=0xFFFFF0) can be specified.
The length (in bits) of an encryption block. If mode is SB_AES_KEYWRAP, the length must be SB_AES_KEYWRAP_BLOCK_BITS; otherwise, the length must be SB_AES_128_BLOCK_BITS.
An RNG context. (Optional - set to NULL if key generation will not be performed.)
A yield context. (Optional - set to NULL if yielding is not required.)
The AES parameters object pointer.
A global context.
The mode of operation and block length must be specified. An RNG context and/or yielding context must be supplied if key generation and/or yielding will be performed, respectively.
If XTS mode is used, the mode must be specified in this function in order to have correct keys are generated or set by the key functions.
mode is an invalid mode of operation.
blockLen is an invalid block length.
The aesParams object is NULL.
Memory allocation failure.
Success.