Expand description
Key wrapping over the tc_block_cipher traits: RFC 3394 (AES key wrap),
RFC 5649 (AES key wrap with padding) and RFC 3211, with the KeyWrap and
KeyWrapInit contracts that algorithm-specific wrappers such as
tc_des_wrap also implement.
The crate is no_std and needs no allocator by default. The default build
provides the traits, parameter containers and errors that wrappers such as
tc_des_wrap build on; each algorithm is behind its own feature:
rfc3394—Rfc3394WrapEngine.rfc5649—Rfc5649WrapEngine; enablesrfc3394, whose register loop it shares.rfc3211—Rfc3211WrapEngine; enablesallocand therand_coredependency, since it sizes its state from the cipher at run time and draws random padding from a caller-supplied generator.alloc—KeyWithIvOwnedandKeyWithIvOptOwned.
Each engine’s documentation carries a usage example.
Structs§
- KeyWith
IvFixed - Owned, fixed-size key and initialization-vector parameters, wiped on drop.
- KeyWith
IvOpt Fixed - Owned, fixed-size key and optional initialization vector, wiped on drop.
- KeyWith
IvOpt Owned - Owned key and optional initialization-vector vectors, wiped on drop.
- KeyWith
IvOpt Ref - Borrowed key and optional initialization vector.
- KeyWith
IvOwned - Owned key and initialization-vector vectors, wiped on drop.
- KeyWith
IvRef - Borrowed key and initialization-vector parameters.
- Rfc3211
Wrap Engine - RFC 3211 key wrapping (the PWRI-KEK algorithm) over a cipher
Cwith blocks of 4 bytes or more. - Rfc3394
Wrap Engine - RFC 3394 key wrapping (AES key wrap) over a cipher
Cwith 16-byte blocks. - Rfc5649
Wrap Engine - RFC 5649 key wrapping with padding over a cipher
Cwith 16-byte blocks.
Enums§
- KeyWrap
Error - Why a key wrapper could not size, wrap or unwrap;
Eis the cipher’s error. - KeyWrap
Init Error - Why a key wrapper could not be initialized;
Eis the cipher’s initialization error. - Wrap
Direction - The operation selected during key-wrapper initialization.
Traits§
- IvOpt
Params - Parameters that may provide an initialization vector.
- IvParams
- Parameters that provide an initialization vector.
- KeyWrap
- An initialized key-wrapping algorithm.
- KeyWrap
Init - Initializes a key wrapper from parameters of type
P.