Kinetis Bootloader  2.0.0
Common bootloader for Kinetis devices
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_ciphertext48 byte wrapped input array
unwrapped_plaintext48 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_kekExpanded kek (64 ints on host, 4 ints on device)
Return values
-1on error
0on success
void do_aes128_key_wrap ( const uint8_t  plaintext[],
uint8_t  wrapped_ciphertext[],
uint32_t  expanded_kek[] 
)

Encrypt and wrap plaintext key.

Parameters
plaintext40 byte plaintext input array
wrapped_ciphertext48 byte wrapped output array
expanded_kekExpanded kek (64 bytes)