Skip to main content

ExtendableOutputReset

Trait ExtendableOutputReset 

Source
pub trait ExtendableOutputReset: ExtendableOutput + Reset {
    // Required method
    fn finalize_xof_reset(&mut self) -> Self::Reader;

    // Provided methods
    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§

Source

fn finalize_xof_reset(&mut self) -> Self::Reader

Retrieve XOF reader and reset hasher instance state.

Provided Methods§

Source

fn finalize_xof_reset_into(&mut self, out: &mut [u8])

Finalize XOF, write result into out, and reset the hasher state.

Source

fn finalize_boxed_reset(&mut self, output_size: usize) -> Box<[u8]>

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ExtendableOutputReset for CShake128

Source§

impl ExtendableOutputReset for CShake256

Source§

impl<const DS: u8> ExtendableOutputReset for TurboShake128<DS>

Source§

impl<const DS: u8> ExtendableOutputReset for TurboShake256<DS>

Implementors§