Trait HashAlgorithm

Source
pub trait HashAlgorithm {
    const OUTPUT_SIZE: usize;
    const BLOCK_SIZE: usize;
    const ALGORITHM_ID: &'static str;

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

Marker trait for hash algorithms with compile-time guarantees

Required Associated Constants§

Source

const OUTPUT_SIZE: usize

Output size in bytes

Source

const BLOCK_SIZE: usize

Block size in bytes

Source

const ALGORITHM_ID: &'static str

Static algorithm identifier for compile-time checking

Provided Methods§

Source

fn name() -> String

Algorithm name for display purposes

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 HashAlgorithm for Blake2bAlgorithm

Source§

const OUTPUT_SIZE: usize = 64usize

Source§

const BLOCK_SIZE: usize = 128usize

Source§

const ALGORITHM_ID: &'static str = "BLAKE2b"

Source§

impl HashAlgorithm for Blake2sAlgorithm

Implement HashAlgorithm for Blake2s

Source§

const OUTPUT_SIZE: usize = 32usize

Source§

const BLOCK_SIZE: usize = 64usize

Source§

const ALGORITHM_ID: &'static str = "BLAKE2s"

Source§

impl HashAlgorithm for dcrypt_algorithms::hash::Sha256Algorithm

Source§

const OUTPUT_SIZE: usize = 32usize

Source§

const BLOCK_SIZE: usize = 64usize

Source§

const ALGORITHM_ID: &'static str = "SHA-256"

Source§

impl HashAlgorithm for Sha1Algorithm

Source§

const OUTPUT_SIZE: usize = 20usize

Source§

const BLOCK_SIZE: usize = 64usize

Source§

const ALGORITHM_ID: &'static str = "SHA-1"

Source§

impl HashAlgorithm for Sha224Algorithm

Source§

const OUTPUT_SIZE: usize = 28usize

Source§

const BLOCK_SIZE: usize = 64usize

Source§

const ALGORITHM_ID: &'static str = "SHA-224"

Source§

impl HashAlgorithm for dcrypt_algorithms::hash::sha2::Sha256Algorithm

Source§

const OUTPUT_SIZE: usize = 32usize

Source§

const BLOCK_SIZE: usize = 64usize

Source§

const ALGORITHM_ID: &'static str = "SHA-256"

Source§

impl HashAlgorithm for Sha384Algorithm

Source§

const OUTPUT_SIZE: usize = 48usize

Source§

const BLOCK_SIZE: usize = 128usize

Source§

const ALGORITHM_ID: &'static str = "SHA-384"

Source§

impl HashAlgorithm for Sha512Algorithm

Source§

const OUTPUT_SIZE: usize = 64usize

Source§

const BLOCK_SIZE: usize = 128usize

Source§

const ALGORITHM_ID: &'static str = "SHA-512"

Source§

impl HashAlgorithm for Sha512_224Algorithm

Source§

const OUTPUT_SIZE: usize = 28usize

Source§

const BLOCK_SIZE: usize = 128usize

Source§

const ALGORITHM_ID: &'static str = "SHA-512/224"

Source§

impl HashAlgorithm for Sha512_256Algorithm

Source§

const OUTPUT_SIZE: usize = 32usize

Source§

const BLOCK_SIZE: usize = 128usize

Source§

const ALGORITHM_ID: &'static str = "SHA-512/256"

Source§

impl HashAlgorithm for Sha3_224Algorithm

Source§

const OUTPUT_SIZE: usize = 28usize

Source§

const BLOCK_SIZE: usize = 144usize

Source§

const ALGORITHM_ID: &'static str = "SHA3-224"

Source§

impl HashAlgorithm for Sha3_256Algorithm

Source§

const OUTPUT_SIZE: usize = 32usize

Source§

const BLOCK_SIZE: usize = 136usize

Source§

const ALGORITHM_ID: &'static str = "SHA3-256"

Source§

impl HashAlgorithm for Sha3_384Algorithm

Source§

const OUTPUT_SIZE: usize = 48usize

Source§

const BLOCK_SIZE: usize = 104usize

Source§

const ALGORITHM_ID: &'static str = "SHA3-384"

Source§

impl HashAlgorithm for Sha3_512Algorithm

Source§

const OUTPUT_SIZE: usize = 64usize

Source§

const BLOCK_SIZE: usize = 72usize

Source§

const ALGORITHM_ID: &'static str = "SHA3-512"

Source§

impl HashAlgorithm for Shake128Algorithm

Source§

const OUTPUT_SIZE: usize = 32usize

Source§

const BLOCK_SIZE: usize = 168usize

Source§

const ALGORITHM_ID: &'static str = "SHAKE-128"

Source§

impl HashAlgorithm for Shake256Algorithm

Source§

const OUTPUT_SIZE: usize = 64usize

Source§

const BLOCK_SIZE: usize = 136usize

Source§

const ALGORITHM_ID: &'static str = "SHAKE-256"