|
SE050 Driver
API reference
|
RFC 3394 AES Key Wrap / Unwrap with a caller-supplied AES-128 block. More...
Go to the source code of this file.
Namespaces | |
| namespace | se050 |
| namespace | se050::rfc3394 |
Typedefs | |
| using | se050::rfc3394::AesBlockFn = Error(*)(const std::uint8_t in[16], std::uint8_t out[16], void *ctx) |
| AES-ECB encrypt or decrypt of one 16-byte block (KEK size is the oracle's). | |
Functions | |
| std::uint64_t | se050::rfc3394::LoadBe64 (const std::uint8_t *p) noexcept |
| void | se050::rfc3394::StoreBe64 (std::uint8_t *p, std::uint64_t v) noexcept |
| Error | se050::rfc3394::Unwrap (const std::uint8_t *wrapped, std::size_t wrapped_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len, AesBlockFn decrypt, void *ctx) noexcept |
RFC 3394 unwrap. wrapped_len must be 8*(n+1) with n >= 2. | |
| Error | se050::rfc3394::Wrap (const std::uint8_t *plain, std::size_t plain_len, std::uint8_t *out, std::size_t out_cap, std::size_t *out_len, AesBlockFn encrypt, void *ctx) noexcept |
RFC 3394 wrap. plain_len must be 8*n with n >= 2. | |
Variables | |
| constexpr std::uint64_t | se050::rfc3394::kIntegrityIv = 0xA6A6A6A6A6A6A6A6ULL |
| constexpr std::size_t | se050::rfc3394::kAes256CekLen = 32U |
| constexpr std::size_t | se050::rfc3394::kAes256WrappedLen = 40U |
RFC 3394 AES Key Wrap / Unwrap with a caller-supplied AES-128 block.
The wrapping key never needs to exist in MCU RAM: the 16-byte encrypt/decrypt callbacks may be SE050 CipherOneShot AES-ECB (AN12413 P1_CIPHER / P2_ENCRYPT_ONESHOT|P2_DECRYPT_ONESHOT) or a host software AES. AES-256 CEK wrap is 40 bytes (4 × 8-byte semiblocks plus the 8-byte integrity IV).