Trait XofAlgorithm

Source
pub trait XofAlgorithm {
    const SECURITY_LEVEL: usize;
    const MIN_OUTPUT_SIZE: usize;
    const MAX_OUTPUT_SIZE: Option<usize>;
    const ALGORITHM_ID: &'static str;

    // Provided methods
    fn name() -> &'static str { ... }
    fn validate_output_length(len: usize) -> Result<()> { ... }
}
Expand description

Trait for XOF algorithms with compile-time guarantees

Required Associated Constants§

Source

const SECURITY_LEVEL: usize

Security level in bits

Source

const MIN_OUTPUT_SIZE: usize

Minimum recommended output size in bytes

Source

const MAX_OUTPUT_SIZE: Option<usize>

Maximum output size in bytes (None for unlimited)

Source

const ALGORITHM_ID: &'static str

Algorithm identifier

Provided Methods§

Source

fn name() -> &'static str

Algorithm name

Source

fn validate_output_length(len: usize) -> Result<()>

Validate output length

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§