Parent topic:MPLABĀ® Harmony Crypto Library
int CRYPT_AES_IvSet(
CRYPT_AES_CTX* aes, 
const unsigned char* iv
);
This function sets the IV that AES will use for later processing.
The key must be set previously with CRYPT_AES_KeySet.
| Parameters | Description | 
|---|---|
| aes | Pointer to context which saves state between calls. | 
| iv | Pointer to buffer holding the initialization vector. | 
BAD_FUNC_ARG - An invalid pointer was passed to the function.
0 - An invalid pointer was not passed to the function.
Direction, as set previously in CRYPT_AES_KeySet, is preserved.
CRYPT_AES_CTX mcAes;
int           ret;
strncpy((char*)iv,  "1234567890abcdef", 16);
ret = CRYPT_AES_IvSet(&mcAes, iv);