Trait Digest

Source
pub trait Digest {
    // Required methods
    fn block_size(&self) -> Option<usize>;
    fn bits_len(&self) -> usize;
    fn write(&mut self, data: &[u8]);
    fn checksum(&mut self, digest: &mut Vec<u8>);
    fn reset(&mut self);
}
Expand description

A trait for message digest algorithm used in the cryptography

Required Methods§

Source

fn block_size(&self) -> Option<usize>

used for HMAC, None means that the digest algorithm doesn’t support used in the HMAC.

Source

fn bits_len(&self) -> usize

the digest length(in bits)

Source

fn write(&mut self, data: &[u8])

write byte data to the Digester

Source

fn checksum(&mut self, digest: &mut Vec<u8>)

compute the checksum for all data in the digester, the checksum will be same
if no new data write to the digester

Source

fn reset(&mut self)

reset internal state of the Digester to the init state

Implementors§

Source§

impl Digest for SHA3

Source§

impl Digest for rcrypto::sha3::SHA224

Source§

impl Digest for rcrypto::sha3::SHA256

Source§

impl Digest for rcrypto::sha3::SHA384

Source§

impl Digest for rcrypto::sha3::SHA512

Source§

impl Digest for Shake128

Source§

impl Digest for Shake256

Source§

impl Digest for SHA1

Source§

impl Digest for rcrypto::sha::SHA224

Source§

impl Digest for rcrypto::sha::SHA256

Source§

impl Digest for rcrypto::sha::SHA384

Source§

impl Digest for rcrypto::sha::SHA512

Source§

impl Digest for SHA512T224

Source§

impl Digest for SHA512T256

Source§

impl Digest for SHA512T

Source§

impl Digest for SHA

Source§

impl Digest for MD5

Source§

impl Digest for SM3

Source§

impl Digest for ZUCMac

Source§

impl<C: Cipher> Digest for CMAC<C>

Source§

impl<D: Digest> Digest for HMAC<D>