Skip to content

mach-systems/tiny-AES-KW-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

Tiny AES KW in C

Lightweight AES Key Wrap implementation as per RFC 3394.

It was written as part of an IEEE 802.1X/MKA (MACsec Key Agreement) implementation, where AES-KW is used for secure key transport.

Designed to be used with tiny-AES-c library – fork enabling runtime selection of key width.

Tests

tests/ subdirectory contains a reference test against all the RFC 3394 test vectors.

API

void AES_KW_init_ctx(struct AES_KW_ctx* ctx,
                     void (*aes_encrypt_callback)(uint8_t*),
                     void (*aes_decrypt_callback)(uint8_t*));

uint32_t AES_KW_wrap(const struct AES_KW_ctx* ctx,
                     const uint8_t *plaintext, uint32_t pt_len,
                     uint8_t *ciphertext);

uint32_t AES_KW_unwrap(const struct AES_KW_ctx* ctx,
                       const uint8_t *ciphertext, uint32_t ct_len,
                       uint8_t *plaintext);

Usage

  1. Specifically for tiny-AES-C: initialize the AES context with AES_init_ctx().
  2. Initialize the Key Wrap module using AES_CMAC_init_ctx() – pass the encrypt and decrypt callbacks.
  3. Call AES_KW_wrap() and AES_KW_wrap() to wrapp or unwrap the key material.

Acknowledgment

This project was inspired by AES CMAC implementation that uses the same AES library.

Other implementations

About

C library for generating RFC 3394 AES Key Wrap

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors