Parent topic:MPLABĀ® Harmony Crypto Library
int CRYPT_AES_GCM_SetKey(
CRYPT_AES_CTX* aes,
const unsigned char* key,
unsigned int len
);
This function sets the key that AES will later perform.
None.
| Parameters | Description |
|---|---|
| aes | Pointer to context which saves state between calls. |
| key | Pointer to buffer holding the key itself. |
| len | Length of key in bytes. |
BAD_FUNC_ARG - An invalid pointer was passed to the function.
0 - An invalid pointer was not passed to the function.
None.
CRYPT_AES_CTX mcAes;
int ret;
strncpy((char*)key, "1234567890abcdefghijklmnopqrstuv", 32);
ret = CRYPT_AES_GCM_SetKey(&mcAes, key, 16);