Skip to main content

Blake2sHash

Struct Blake2sHash 

Source
pub struct Blake2sHash<const OUT_SIZE: usize>;
Expand description

A struct that implements libcrux_traits::digest traits.

Blake2sHasher is a convenience hasher for this struct.

Trait Implementations§

Source§

impl<const OUT_SIZE: usize> DigestIncremental<OUT_SIZE> for Blake2sHash<OUT_SIZE>

Source§

fn finish(state: &mut Self::IncrementalState, dst: &mut [u8; OUT_SIZE])

Writes the digest into digest. Read more
Source§

impl<const OUT_SIZE: usize> DigestIncremental for Blake2sHash<OUT_SIZE>

Source§

fn finish( state: &mut Self::IncrementalState, digest: &mut [u8], ) -> Result<usize, FinishError>

Writes the digest into digest. Read more
Source§

impl<const OUT_SIZE: usize> DigestIncrementalBase for Blake2sHash<OUT_SIZE>

Source§

type IncrementalState = Blake2s<ConstKeyLenConstDigestLen<0, OUT_SIZE>>

The digest state.
Source§

fn update( state: &mut Self::IncrementalState, chunk: &[u8], ) -> Result<(), UpdateError>

Update the digest state with the payload.
Source§

fn reset(state: &mut Self::IncrementalState)

Reset the digest state.
Source§

impl<const OUT_SIZE: usize> Hash<OUT_SIZE> for Blake2sHash<OUT_SIZE>

Source§

fn hash(digest: &mut [u8; OUT_SIZE], payload: &[u8]) -> Result<(), HashError>

Writes the digest for the given input byte slice, into digest in immediate mode.
Source§

impl<const OUT_SIZE: usize> Hash for Blake2sHash<OUT_SIZE>

Source§

fn hash(digest: &mut [u8], payload: &[u8]) -> Result<usize, HashError>

Writes the digest for the given input byte slice, into digest in immediate mode.

Auto Trait Implementations§

§

impl<const OUT_SIZE: usize> Freeze for Blake2sHash<OUT_SIZE>

§

impl<const OUT_SIZE: usize> RefUnwindSafe for Blake2sHash<OUT_SIZE>

§

impl<const OUT_SIZE: usize> Send for Blake2sHash<OUT_SIZE>

§

impl<const OUT_SIZE: usize> Sync for Blake2sHash<OUT_SIZE>

§

impl<const OUT_SIZE: usize> Unpin for Blake2sHash<OUT_SIZE>

§

impl<const OUT_SIZE: usize> UnsafeUnpin for Blake2sHash<OUT_SIZE>

§

impl<const OUT_SIZE: usize> UnwindSafe for Blake2sHash<OUT_SIZE>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> Classify for T

Source§

type Classified = T

Source§

fn classify(self) -> T

Source§

impl<T> Declassify for T

Source§

impl<const OUTPUT_LEN: usize, D> DigestIncremental<OUTPUT_LEN> for D
where D: DigestIncremental<OUTPUT_LEN>,

Source§

fn finish( state: &mut <D as DigestIncrementalBase>::IncrementalState, ) -> [u8; OUTPUT_LEN]

Returns the digest as an array. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<const OUTPUT_LEN: usize, D> Hash<OUTPUT_LEN> for D
where D: Hash<OUTPUT_LEN>,

Source§

fn hash(payload: &[u8]) -> Result<[u8; OUTPUT_LEN], HashError>

Returns the digest for the given input byte slice, as an array, in immediate mode.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.