Trait digest::ExtendableOutputReset [−][src]
pub trait ExtendableOutputReset: ExtendableOutput + Reset {
fn finalize_xof_reset(&mut self) -> Self::Reader;
fn finalize_xof_reset_into(&mut self, out: &mut [u8]) { ... }
fn finalize_boxed_reset(&mut self, output_size: usize) -> Box<[u8]> { ... }
}
Expand description
Trait for hash functions with extendable-output (XOF) able to reset themselves.
Required methods
fn finalize_xof_reset(&mut self) -> Self::Reader
fn finalize_xof_reset(&mut self) -> Self::Reader
Retrieve XOF reader and reset hasher instance state.
Provided methods
fn finalize_xof_reset_into(&mut self, out: &mut [u8])
fn finalize_xof_reset_into(&mut self, out: &mut [u8])
Finalize XOF, write result into out
, and reset the hasher state.
This is supported on crate feature
alloc
only.Retrieve result into a boxed slice of the specified size and reset the hasher state.
Box<[u8]>
is used instead of Vec<u8>
to save stack space, since
they have size of 2 and 3 words respectively.
Implementors
impl<T> ExtendableOutputReset for CoreWrapper<T> where
T: ExtendableOutputCore + Reset,
T::BlockSize: IsLess<U256>,
Le<T::BlockSize, U256>: NonZero,
<T::ReaderCore as BlockSizeUser>::BlockSize: IsLess<U256>,
Le<<T::ReaderCore as BlockSizeUser>::BlockSize, U256>: NonZero,
This is supported on crate feature
core-api
only.