Trait KdfAlgorithm

Source
pub trait KdfAlgorithm {
    const MIN_SALT_SIZE: usize;
    const DEFAULT_OUTPUT_SIZE: usize;
    const ALGORITHM_ID: &'static str;

    // Required method
    fn security_level() -> SecurityLevel;

    // Provided method
    fn name() -> String { ... }
}
Expand description

Marker trait for KDF algorithms

Required Associated Constants§

Source

const MIN_SALT_SIZE: usize

Minimum salt size in bytes

Source

const DEFAULT_OUTPUT_SIZE: usize

Default output size in bytes

Source

const ALGORITHM_ID: &'static str

Static algorithm identifier for compile-time checking

Required Methods§

Source

fn security_level() -> SecurityLevel

Security level provided by this KDF

Provided Methods§

Source

fn name() -> String

Returns the KDF algorithm name

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl KdfAlgorithm for Argon2Algorithm

Source§

const MIN_SALT_SIZE: usize = 8usize

Source§

const DEFAULT_OUTPUT_SIZE: usize = 32usize

Source§

const ALGORITHM_ID: &'static str = "argon2"

Source§

impl<H: HashFunction> KdfAlgorithm for dcrypt_algorithms::kdf::HkdfAlgorithm<H>

Source§

const MIN_SALT_SIZE: usize = 16usize

Source§

const DEFAULT_OUTPUT_SIZE: usize = 32usize

Source§

const ALGORITHM_ID: &'static str = "HKDF"

Source§

impl<H: HashFunction> KdfAlgorithm for dcrypt_algorithms::kdf::Pbkdf2Algorithm<H>

Source§

const MIN_SALT_SIZE: usize = 16usize

Source§

const DEFAULT_OUTPUT_SIZE: usize = 32usize

Source§

const ALGORITHM_ID: &'static str = "PBKDF2"

Source§

impl<H: HashFunction> KdfAlgorithm for dcrypt_algorithms::kdf::hkdf::HkdfAlgorithm<H>

Source§

const MIN_SALT_SIZE: usize = 16usize

Source§

const DEFAULT_OUTPUT_SIZE: usize = 32usize

Source§

const ALGORITHM_ID: &'static str = "HKDF"

Source§

impl<H: HashFunction> KdfAlgorithm for dcrypt_algorithms::kdf::pbkdf2::Pbkdf2Algorithm<H>

Source§

const MIN_SALT_SIZE: usize = 16usize

Source§

const DEFAULT_OUTPUT_SIZE: usize = 32usize

Source§

const ALGORITHM_ID: &'static str = "PBKDF2"