1.19 CRYPT_AES_IvSet Function

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

ParametersDescription
aesPointer to context which saves state between calls.
ivPointer 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);