Jump to main content

# 1.2.11.4.10 AES_Wrapper_UnwrapKey Function

## C

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

## Summary

Unwraps a key with AES Key Wrap Algorithm.

## Description

This function unwraps a key using AES Key Wrap Algorithm.

## Precondition

None.

## Parameters

Param | Description
--- | ---
key | Pointer to buffer holding the AES key for the algorithm.
keyLen | Length of key in bytes.
in | Pointer to buffer where the wrapped key is located.
inLen | Length in bytes of the key to unwrap.
out | Pointer to buffer to store the unwrapped key.

## Returns

None.

## Example

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

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

## Remarks

The unwrapped key is one byte shorter than the wrapped key.

Rev: G