Trait coins_bip32::ecdsa::signature::digest::VariableOutputDirty[]

pub trait VariableOutputDirty {
    pub fn new(output_size: usize) -> Result<Self, InvalidOutputSize>;
pub fn output_size(&self) -> usize;
pub fn finalize_variable_dirty(&mut self, f: impl FnOnce(&[u8])); }

Trait for variable-sized output digest implementations to use to retrieve the hash output.

Usage of this trait in user code is discouraged. Instead use the VariableOutput::finalize_variable or VariableOutput::finalize_variable_reset methods.

Types which impl this trait along with Reset will receive a blanket impl of VariableOutput.

Required methods

pub fn new(output_size: usize) -> Result<Self, InvalidOutputSize>

Create new hasher instance with the given output size.

It will return Err(InvalidOutputSize) in case if hasher can not return specified output size. It will always return an error if output size equals to zero.

pub fn output_size(&self) -> usize

Get output size of the hasher instance provided to the new method

pub fn finalize_variable_dirty(&mut self, f: impl FnOnce(&[u8]))

Retrieve result into provided buffer and leave hasher in a dirty state.

This method is expected to only be called once unless Reset::reset is called, after which point it can be called again and reset again (and so on).

Loading content...

Implementations on Foreign Types

impl VariableOutputDirty for VarBlake2b

impl VariableOutputDirty for VarBlake2s

Loading content...

Implementors

Loading content...