pub trait DigestLike<T>where
T: Update + FixedOutputReset + OutputSizeUser,{
const SIZE: usize = <T::OutputSize>::USIZE;
// Required method
fn internal_state(&mut self) -> &mut T;
// Provided methods
fn update(&mut self, data: &[u8]) { ... }
fn finalize_into(&mut self, out: &mut [u8]) { ... }
fn finalize(&mut self) -> GenericArray<u8, T::OutputSize> { ... }
}
Expand description
Generalization of digest-like operation (MAC, Digest,…)
Defines the update
and finalize
operations to produce digest value of arbitrary data.
Provided Associated Constants§
Required Methods§
Sourcefn internal_state(&mut self) -> &mut T
fn internal_state(&mut self) -> &mut T
Access to the internal state of the digest-like operation.
Provided Methods§
Sourcefn update(&mut self, data: &[u8])
fn update(&mut self, data: &[u8])
Update the internal state of the digest-like using the given input data.
Sourcefn finalize_into(&mut self, out: &mut [u8])
fn finalize_into(&mut self, out: &mut [u8])
Retrieve the final digest value into a prepared buffer and reset this instance so it could be reused for a new computation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.