Aes_key_wrap

## aes_key_wrap

void | do_aes128_key_wrap (const uint8_t plaintext[], uint8_t wrapped_ciphertext[], uint32_t expanded_kek[])
| Encrypt and wrap plaintext key. More...
uint32_t | do_aes128_key_unwrap (const uint8_t wrapped_ciphertext[], uint8_t unwrapped_plaintext[], uint32_t expanded_kek[])
| Decrypt and unwrap wrapped key. More...

## Usage Information

## Function Documentation

uint32_t do_aes128_key_unwrap | ( | const uint8_t | wrapped_ciphertext[],
|  | uint8_t | unwrapped_plaintext[],
|  | uint32_t | expanded_kek[]
| ) |  |

Decrypt and unwrap wrapped key.

Parameters

  wrapped_ciphertext | 48 byte wrapped input array
  unwrapped_plaintext | 48 byte plaintext output array, Note: this includes an 8 byte IV header that is added to start of the original 40 input bytes by the wrapping
  expanded_kek | Expanded kek (64 ints on host, 4 ints on device)

Return values

  -1 | on error
  0 | on success

void do_aes128_key_wrap | ( | const uint8_t | plaintext[],
|  | uint8_t | wrapped_ciphertext[],
|  | uint32_t | expanded_kek[]
| ) |  |

Encrypt and wrap plaintext key.

Parameters

  plaintext | 40 byte plaintext input array
  wrapped_ciphertext | 48 byte wrapped output array
  expanded_kek | Expanded kek (64 bytes)