pub struct Algorithm {
output_len: usize,
chaining_len: usize,
block_len: usize,
len_len: usize,
block_data_order: unsafe extern "C" fn(state: &mut State, data: *const u8, num: usize),
format_output: fn(input: State) -> Output,
initial_state: State,
id: AlgorithmID,
}
Expand description
A digest algorithm.
Fields§
§output_len: usize
§chaining_len: usize
§block_len: usize
§len_len: usize
The length of the length in the padding.
block_data_order: unsafe extern "C" fn(state: &mut State, data: *const u8, num: usize)
§format_output: fn(input: State) -> Output
§initial_state: State
§id: AlgorithmID
Implementations§
source§impl Algorithm
impl Algorithm
sourcepub fn chaining_len(&self) -> usize
pub fn chaining_len(&self) -> usize
The size of the chaining value of the digest function, in bytes.
For non-truncated algorithms (SHA-1, SHA-256, SHA-512), this is equal
to Self::output_len()
. For truncated algorithms (e.g. SHA-384,
SHA-512/256), this is equal to the length before truncation. This is
mostly helpful for determining the size of an HMAC key that is
appropriate for the digest algorithm.
sourcepub fn output_len(&self) -> usize
pub fn output_len(&self) -> usize
The length of a finalized digest.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnwindSafe for Algorithm
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more