logo
pub trait Digest: DynClone + Write + Send + Sync {
    fn algo(&self) -> HashAlgorithm;
fn digest_size(&self) -> usize;
fn update(&mut self, data: &[u8]);
fn digest(&mut self, digest: &mut [u8]) -> Result<()>; fn into_digest(self) -> Result<Vec<u8>>
    where
        Self: Sized
, { ... } }
Expand description

Hasher capable of calculating a digest for the input byte stream.

This provides an abstract interface to the hash functions used in OpenPGP. Digests can be are created using HashAlgorithm::context.

Required methods

Returns the algorithm.

Size of the digest in bytes

Writes data into the hash function.

Finalizes the hash function and writes the digest into the provided slice.

Resets the hash function contexts.

digest must be at least self.digest_size() bytes large, otherwise the digest will be truncated.

Provided methods

Finalizes the hash function and computes the digest.

Implementations on Foreign Types

Writes data into the hash function.

Finalizes the hash function and writes the digest into the provided slice.

Resets the hash function contexts.

digest must be at least self.digest_size() bytes large, otherwise the digest will be truncated.

Implementors