Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 915 Bytes

GUID-83DEB663-ADA8-48BF-8152-C08E351169FF.md

File metadata and controls

50 lines (30 loc) · 915 Bytes

CRYPT_AES_IvSet Function

Parent topic:MPLAB® Harmony Crypto Library

C

int CRYPT_AES_IvSet(
CRYPT_AES_CTX* aes, 
const unsigned char* iv
);

Description

This function sets the IV that AES will use for later processing.

Preconditions

The key must be set previously with CRYPT_AES_KeySet.

Parameters

Parameters Description
aes Pointer to context which saves state between calls.
iv Pointer to buffer holding the initialization vector.

Returns

  • BAD_FUNC_ARG - An invalid pointer was passed to the function.

  • 0 - An invalid pointer was not passed to the function.

Remarks

Direction, as set previously in CRYPT_AES_KeySet, is preserved.

Example

CRYPT_AES_CTX mcAes;
int           ret;

strncpy((char*)iv,  "1234567890abcdef", 16);

ret = CRYPT_AES_IvSet(&mcAes, iv);