[][src]Trait sequoia_openpgp::crypto::hash::Digest

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

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

pub fn algo(&self) -> HashAlgorithm[src]

Returns the algorithm.

pub fn digest_size(&self) -> usize[src]

Size of the digest in bytes

pub fn update(&mut self, data: &[u8])[src]

Writes data into the hash function.

pub fn digest(&mut self, digest: &mut [u8]) -> Result<()>[src]

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.

Loading content...

Provided methods

pub fn into_digest(self) -> Result<Vec<u8>> where
    Self: Sized
[src]

Finalizes the hash function and computes the digest.

Loading content...

Implementations on Foreign Types

impl Digest for Sha1CD[src]

impl Digest for Sha224[src]

impl Digest for Sha256[src]

impl Digest for Sha384[src]

impl Digest for Sha512[src]

impl Digest for Sha1[src]

impl Digest for Md5[src]

impl Digest for Ripemd160[src]

impl Digest for Box<dyn Digest>[src]

pub fn update(&mut self, data: &[u8])[src]

Writes data into the hash function.

pub fn digest(&mut self, digest: &mut [u8]) -> Result<()>[src]

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.

Loading content...

Implementors

Loading content...