Skip to main content

HashAlgorithm

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 = BLAKE2B_MAX_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = BLAKE2B_BLOCK_SIZE

Source§

const ALGORITHM_ID: &'static str = "BLAKE2b"

Source§

impl HashAlgorithm for Blake2sAlgorithm

Implement HashAlgorithm for Blake2s

Source§

const OUTPUT_SIZE: usize = BLAKE2S_MAX_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = BLAKE2S_BLOCK_SIZE

Source§

const ALGORITHM_ID: &'static str = "BLAKE2s"

Source§

impl HashAlgorithm for dcrypt_algorithms::hash::Sha256Algorithm

Source§

const OUTPUT_SIZE: usize = 32

Source§

const BLOCK_SIZE: usize = 64

Source§

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

Source§

impl HashAlgorithm for Keccak256Algorithm

Source§

const OUTPUT_SIZE: usize = KECCAK256_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = KECCAK256_RATE

Source§

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

Source§

impl HashAlgorithm for Sha1Algorithm

Source§

const OUTPUT_SIZE: usize = SHA1_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA1_BLOCK_SIZE

Source§

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

Source§

impl HashAlgorithm for Sha224Algorithm

Source§

const OUTPUT_SIZE: usize = SHA224_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA256_BLOCK_SIZE

Source§

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

Source§

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

Source§

const OUTPUT_SIZE: usize = SHA256_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA256_BLOCK_SIZE

Source§

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

Source§

impl HashAlgorithm for Sha384Algorithm

Source§

const OUTPUT_SIZE: usize = SHA384_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA512_BLOCK_SIZE

Source§

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

Source§

impl HashAlgorithm for Sha512Algorithm

Source§

const OUTPUT_SIZE: usize = SHA512_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA512_BLOCK_SIZE

Source§

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

Source§

impl HashAlgorithm for Sha512_224Algorithm

Source§

const OUTPUT_SIZE: usize = SHA224_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA512_BLOCK_SIZE

Source§

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

Source§

impl HashAlgorithm for Sha512_256Algorithm

Source§

const OUTPUT_SIZE: usize = SHA256_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA512_BLOCK_SIZE

Source§

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

Source§

impl HashAlgorithm for Sha3_224Algorithm

Source§

const OUTPUT_SIZE: usize = SHA3_224_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA3_224_RATE

Source§

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

Source§

impl HashAlgorithm for Sha3_256Algorithm

Source§

const OUTPUT_SIZE: usize = SHA3_256_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA3_256_RATE

Source§

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

Source§

impl HashAlgorithm for Sha3_384Algorithm

Source§

const OUTPUT_SIZE: usize = SHA3_384_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA3_384_RATE

Source§

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

Source§

impl HashAlgorithm for Sha3_512Algorithm

Source§

const OUTPUT_SIZE: usize = SHA3_512_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHA3_512_RATE

Source§

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

Source§

impl HashAlgorithm for Shake128Algorithm

Source§

const OUTPUT_SIZE: usize = SHAKE128_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHAKE128_RATE

Source§

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

Source§

impl HashAlgorithm for Shake256Algorithm

Source§

const OUTPUT_SIZE: usize = SHAKE256_OUTPUT_SIZE

Source§

const BLOCK_SIZE: usize = SHAKE256_RATE

Source§

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