ExtendableOutputFunction

Trait ExtendableOutputFunction 

Source
pub trait ExtendableOutputFunction {
    // Required methods
    fn new() -> Self;
    fn update(&mut self, data: &[u8]) -> Result<()>;
    fn finalize(&mut self) -> Result<()>;
    fn squeeze(&mut self, output: &mut [u8]) -> Result<()>;
    fn squeeze_into_vec(&mut self, len: usize) -> Result<Vec<u8>>;
    fn reset(&mut self) -> Result<()>;
    fn security_level() -> usize;

    // Provided method
    fn generate(data: &[u8], len: usize) -> Result<Vec<u8>>
       where Self: Sized { ... }
}
Expand description

Trait for extendable output functions

Required Methods§

Source

fn new() -> Self

Creates a new instance of the XOF

Source

fn update(&mut self, data: &[u8]) -> Result<()>

Updates the XOF state with new data

Source

fn finalize(&mut self) -> Result<()>

Finalizes the XOF state for output

Source

fn squeeze(&mut self, output: &mut [u8]) -> Result<()>

Squeezes output bytes into the provided buffer

Source

fn squeeze_into_vec(&mut self, len: usize) -> Result<Vec<u8>>

Squeezes the specified number of output bytes into a new vector

Source

fn reset(&mut self) -> Result<()>

Resets the XOF state

Source

fn security_level() -> usize

Returns the security level in bits

Provided Methods§

Source

fn generate(data: &[u8], len: usize) -> Result<Vec<u8>>
where Self: Sized,

Convenience method to generate output in a single call

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.

Implementors§