Creates an AES key object from the given key value that can later be used for encryption and/or decryption.
#include "huaes.h"
int hu_AESKeySet(sb_Params aesParams, size_t keyLen, const unsigned char *keyValue, sb_Key *aesKey, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
An AES parameters object.
The length (in bits) of the AES key value. The acceptable values are SB_AES_128_KEY_BITS, SB_AES_192_KEY_BITS, SB_AES_256_KEY_BITS, SB_AES_128_XTS_KEY_BITS and SB_AES_256_XTS_KEY_BITS.
The key value.
The AES key object pointer.
A global context.
If the key will be used exclusively for either encryption or decryption, then hu_AESEncryptKeySet() or hu_AESDecryptKeySet() should be called, respectively, as they use fewer resources.
In XTS mode, two AES keys are used. Therefore, the key size for XTS mode is twice as large as an AES key.
The aesParams object is NULL.
The tag for the params object is not of the expected type.
keyLen is an invalid key length.
keyValue is NULL.
aesKey is NULL.
Memory allocation failure.
Success.