CRYPT_AES_GCM_SetKey Function

C

int CRYPT_AES_GCM_SetKey(
    CRYPT_AES_CTX* aes, 
    const unsigned char* key, 
    unsigned int len
);

Description

This function sets the key that AES will later perform.

Preconditions

None.

Parameters

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.

Returns

Remarks

None.

Example

CRYPT_AES_CTX mcAes;
int           ret;

strncpy((char*)key, "1234567890abcdefghijklmnopqrstuv", 32);

ret = CRYPT_AES_GCM_SetKey(&mcAes, key, 16);