Crate rust_kbkdf

Source
Expand description

§Rust Implementation of NIST SP800-108 Key Based Key Derivation Function (KBKDF)

This crate provides a Rust implementation of the NIST SP800-108 standard for performing key-derivation based on a source key.

This crate implements the KBKDF in the following modes:

  • Counter
  • Feedback
  • Double-Pipeline Iteration

This crate was designed such that the user may provide their own Pseudo Random Function (as defined in Section 4 of SP800-108) via the implementation of two traits:

§Psuedo Random Function Trait

The purpose of the PRF trait is to allow a user to provide their own implementation of a PRF (as defined in Section 4 of SP800-108).

Please note, that in order for an implementation of KBKDF to be NIST approved, an approved PRF must be used!

The author of this crate does not guarantee that this implementation is NIST approved!

§Pseudo Random Function Key

This trait is used to ensure that the implementation of the PseudoRandomFunction trait can access the necessary source key in a way that passes Rust’s borrow checker.

§Example

An example of how to use the two traits are found in the tests module utilizing the OpenSSL Crate.

Structs§

CounterMode
Counter mode options
DoublePipelineIterationMode
Defines options for KDF in double-pipeline iteration mode
FeedbackMode
Defines options for KDF in feedback mode
FixedInput
Fixed input used when implementation is under test
SpecifiedInput
Specified input for PRF

Enums§

CounterLocation
Used to set location of counter when using fixed input
InputType
The type of input. May be a fixed input
KDFMode
Defines types and arguments for specific KDF modes

Traits§

PseudoRandomFunction
Defines how the KBKDF crate will interact with PRFs This allows the user of this crate to provide their own implementation of a PRF, however, only SP800-108 specified PRFs are allowed in the approved mode of operation. Given that, this crate cannot test for that and assumes that the user is using an approved PRF.
PseudoRandomFunctionKey
Defines how a PseudoRandomFunction handles a key

Functions§

kbkdf
Performs SP800-108 key-based key derivation function