pub trait HkdfVariant<const PRK_LENGTH: usize> {
type Prk: NewByteArray<PRK_LENGTH> + Zeroize + ZeroizeOnDrop;
const OUTPUT_BYTES_MIN: usize;
const OUTPUT_BYTES_MAX: usize;
// Required methods
fn extract(prk: &mut [u8; PRK_LENGTH], salt: Option<&[u8]>, ikm: &[u8]);
fn expand(
output: &mut [u8],
context: &[u8],
prk: &[u8; PRK_LENGTH],
) -> Result<(), Error>;
// Provided method
fn validate_output_len(output_len: usize) -> Result<(), Error> { ... }
}Expand description
HKDF algorithm variant used by Hkdf.
Required Associated Constants§
Sourceconst OUTPUT_BYTES_MIN: usize
const OUTPUT_BYTES_MIN: usize
Minimum output length accepted by this variant.
Sourceconst OUTPUT_BYTES_MAX: usize
const OUTPUT_BYTES_MAX: usize
Maximum output length accepted by this variant.
Required Associated Types§
Sourcetype Prk: NewByteArray<PRK_LENGTH> + Zeroize + ZeroizeOnDrop
type Prk: NewByteArray<PRK_LENGTH> + Zeroize + ZeroizeOnDrop
Default stack-allocated PRK type for this variant.
Required Methods§
Provided Methods§
Sourcefn validate_output_len(output_len: usize) -> Result<(), Error>
fn validate_output_len(output_len: usize) -> Result<(), Error>
Validates an output length before allocating output storage.
§Errors
Returns an error if output_len is smaller than
Self::OUTPUT_BYTES_MIN or larger than Self::OUTPUT_BYTES_MAX.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".