pub trait Digest<const HASH_LEN: usize> {
// Required methods
fn update(&mut self, data: &[u8]) -> Result<(), Error>;
fn finish_current(
&mut self,
hash: &mut CryptoSensitive<HASH_LEN>,
) -> Result<(), Error>;
fn finish(self, hash: &mut CryptoSensitive<HASH_LEN>) -> Result<(), Error>;
}Expand description
Trait representing a generic digest (hash) algorithm.
The digest algorithm should support incremental updates and finalization.
Used for both hashing and HMAC.
Required Methods§
Sourcefn finish_current(
&mut self,
hash: &mut CryptoSensitive<HASH_LEN>,
) -> Result<(), Error>
fn finish_current( &mut self, hash: &mut CryptoSensitive<HASH_LEN>, ) -> Result<(), Error>
Finish the digest and write the result into the given buffer, without consuming the hasher instance, allowing for further updates and finalizations.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".