pub trait HashEngine: Clone + Default {
type MidState;
const BLOCK_SIZE: usize;
// Required methods
fn midstate(&self) -> Self::MidState;
fn input(&mut self, data: &[u8]);
fn n_bytes_hashed(&self) -> usize;
}Expand description
A hashing engine which bytes can be serialized into.
Required Associated Constants§
Sourceconst BLOCK_SIZE: usize
const BLOCK_SIZE: usize
Length of the hash’s internal block size, in bytes.
Required Associated Types§
Required Methods§
Sourcefn midstate(&self) -> Self::MidState
fn midstate(&self) -> Self::MidState
Outputs the midstate of the hash engine. This function should not be used directly unless you really know what you’re doing.
Sourcefn n_bytes_hashed(&self) -> usize
fn n_bytes_hashed(&self) -> usize
Return the number of bytes already n_bytes_hashed(inputted).
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.