SE050 Driver
API reference
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
se050::rfc3394 Namespace Reference

Typedefs

using 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 LoadBe64 (const std::uint8_t *p) noexcept
 
void StoreBe64 (std::uint8_t *p, std::uint64_t v) noexcept
 
Error 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 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 kIntegrityIv = 0xA6A6A6A6A6A6A6A6ULL
 
constexpr std::size_t kAes256CekLen = 32U
 
constexpr std::size_t kAes256WrappedLen = 40U
 

Typedef Documentation

◆ AesBlockFn

using se050::rfc3394::AesBlockFn = typedef 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).

Function Documentation

◆ LoadBe64()

std::uint64_t se050::rfc3394::LoadBe64 ( const std::uint8_t *  p)
inlinenoexcept

◆ StoreBe64()

void se050::rfc3394::StoreBe64 ( std::uint8_t *  p,
std::uint64_t  v 
)
inlinenoexcept

◆ Unwrap()

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 
)
inlinenoexcept

RFC 3394 unwrap. wrapped_len must be 8*(n+1) with n >= 2.

Parameters
decryptAES-1 of the wrapping key (KEK).

◆ Wrap()

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 
)
inlinenoexcept

RFC 3394 wrap. plain_len must be 8*n with n >= 2.

Parameters
encryptAES of the wrapping key (KEK).

Variable Documentation

◆ kAes256CekLen

constexpr std::size_t se050::rfc3394::kAes256CekLen = 32U
inlineconstexpr

◆ kAes256WrappedLen

constexpr std::size_t se050::rfc3394::kAes256WrappedLen = 40U
inlineconstexpr

◆ kIntegrityIv

constexpr std::uint64_t se050::rfc3394::kIntegrityIv = 0xA6A6A6A6A6A6A6A6ULL
inlineconstexpr