1.2.11.4.9 AES_Wrapper_WrapKey Function

C

void AES_Wrapper_WrapKey(uint8_t *key, uint32_t keyLen, 
                         uint8_t *in, uint32_t inLen, 
                         uint8_t *out)

Summary

Wraps a key with AES Key Wrap Algorithm.

Description

This function wraps a key using AES Key Wrap Algorithm.

Precondition

None.

Parameters

ParamDescription
keyPointer to buffer holding the AES key for the algorithm.
keyLenLength of key in bytes.
inPointer to buffer where the key to wrap is located.
inLenLength in bytes of the key to wrap.
outPointer to buffer to store the wrapped key.

Returns

None.

Example

uint8_t in1[16];
uint8_t out1[24];
uint8_t key[] = { some 16, 24, or 32 byte key };

AES_Wrapper_WrapKey(key, sizeof(key), in1, sizeof(in1), out1);

Remarks

The wrapped key is one byte longer than the plain key.