hopr_crypto_types::primitives

Trait DigestLike

Source
pub trait DigestLike<T>
where T: Update + FixedOutputReset + OutputSizeUser,
{ const SIZE: usize = <T::OutputSize>::USIZE; // Required method fn internal_state(&mut self) -> &mut T; // Provided methods fn update(&mut self, data: &[u8]) { ... } fn finalize_into(&mut self, out: &mut [u8]) { ... } fn finalize(&mut self) -> GenericArray<u8, T::OutputSize> { ... } }
Expand description

Generalization of digest-like operation (MAC, Digest,…) Defines the update and finalize operations to produce digest value of arbitrary data.

Provided Associated Constants§

Source

const SIZE: usize = <T::OutputSize>::USIZE

Length of the digest in bytes

Required Methods§

Source

fn internal_state(&mut self) -> &mut T

Access to the internal state of the digest-like operation.

Provided Methods§

Source

fn update(&mut self, data: &[u8])

Update the internal state of the digest-like using the given input data.

Source

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

Retrieve the final digest value into a prepared buffer and reset this instance so it could be reused for a new computation.

Source

fn finalize(&mut self) -> GenericArray<u8, T::OutputSize>

Retrieve the final digest value and reset this instance so it could be reused for a new computation.

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§

Source§

impl DigestLike<Blake2sMac<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for SimpleMac

Source§

impl DigestLike<CoreWrapper<CtVariableCoreWrapper<Blake2sVarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>>> for SimpleDigest

Source§

impl DigestLike<CoreWrapper<Keccak256Core>> for EthDigest