Skip to main content

HashDigestAlgorithm

Trait HashDigestAlgorithm 

Source
pub trait HashDigestAlgorithm {
    const ALG: HashAlgorithm;

    // Required method
    fn digest(message: &[u8]) -> Result<Vec<u8>, AlgorithmError>;
}
Expand description

Adapter contract for a cryptographic hash algorithm.

Required Associated Constants§

Source

const ALG: HashAlgorithm

The hash algorithm selector this adapter implements.

Required Methods§

Source

fn digest(message: &[u8]) -> Result<Vec<u8>, AlgorithmError>

Compute the digest of message, returning the raw digest bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl HashDigestAlgorithm for Sha2_256Algo

Source§

const ALG: HashAlgorithm = HashAlgorithm::Sha2_256

Source§

impl HashDigestAlgorithm for Sha2_384Algo

Source§

const ALG: HashAlgorithm = HashAlgorithm::Sha2_384

Source§

impl HashDigestAlgorithm for Sha2_512Algo

Source§

const ALG: HashAlgorithm = HashAlgorithm::Sha2_512

Source§

impl HashDigestAlgorithm for Sha3_224Algo

Source§

const ALG: HashAlgorithm = HashAlgorithm::Sha3_224

Source§

impl HashDigestAlgorithm for Sha3_256Algo

Source§

const ALG: HashAlgorithm = HashAlgorithm::Sha3_256

Source§

impl HashDigestAlgorithm for Sha3_384Algo

Source§

const ALG: HashAlgorithm = HashAlgorithm::Sha3_384

Source§

impl HashDigestAlgorithm for Sha3_512Algo

Source§

const ALG: HashAlgorithm = HashAlgorithm::Sha3_512