Key wrapping
Encrypt key material under a key-encryption key.
wrap(kek, key) returns the wrapped key and unwrap(kek, wrapped) returns the key. If the integrity check fails, unwrap raises oxcrypto.InvalidTag and returns nothing.
- AES-KW and AES-KWP from RFC 3394, RFC 5649 and NIST SP 800-38F.
- BelT-KWP from STB 34.101.31-2020.
The key-wrap crates are written to zeroize their expanded keys on drop (oxcrypto has not verified this independently), and oxcrypto zeroizes the unwrapped key buffer it owns. The bytes objects returned to Python are not wiped; see zeroization.