Skip to main content

Blake2b

Struct Blake2b 

Source
pub struct Blake2b<T> { /* private fields */ }
Expand description

A hasher struct for the Blake2b (optionally keyed) hash function.

Implementations§

Source§

impl<T> Blake2b<T>

Source

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

Updates the hash state by adding the bytes from chunk to the hashed data.

Source§

impl<const KEY_LEN: usize> Blake2b<ConstKeyLen<KEY_LEN>>

Source

pub fn finalize(&self, dst: &mut [u8]) -> Result<usize, Error>

Compute the hash for the current hash state and write it to dst.

Returns a Result that contains the length of the digest on success.

Source§

impl Blake2b<Dynamic>

Source

pub fn finalize(&self, dst: &mut [u8]) -> Result<usize, Error>

Compute the hash for the current hash state and write it to dst.

Returns a Result that contains the length of the digest on success.

Source§

impl<const KEY_LEN: usize, const OUT_LEN: usize> Blake2b<ConstKeyLenConstDigestLen<KEY_LEN, OUT_LEN>>

Source

pub fn finalize(&self, dst: &mut [u8; OUT_LEN])

Compute the hash for the current hash state and write it to dst.

Source§

impl<const OUT_LEN: usize> Blake2b<ConstDigestLen<OUT_LEN>>

Source

pub fn finalize(&self, dst: &mut [u8; OUT_LEN])

Compute the hash for the current hash state and write it to dst.

Source§

impl<const KEY_LEN: usize, const OUT_LEN: usize> Blake2b<ConstKeyLenConstDigestLen<KEY_LEN, OUT_LEN>>

Source

pub fn reset_with_key(&mut self, key: &[u8; KEY_LEN])

Reset the hash state and update the key to the contents of key.

Source§

impl<const KEY_LEN: usize> Blake2b<ConstKeyLen<KEY_LEN>>

Source

pub fn reset_with_key(&mut self, key: &[u8; KEY_LEN])

Reset the hash state and update the key to the contents of key.

Source§

impl<const OUT_LEN: usize> Blake2b<ConstDigestLen<OUT_LEN>>

Source

pub fn reset_with_key(&mut self, key: &[u8]) -> Result<(), Error>

Reset the hash state and update the key to the contents of key.

Source§

impl Blake2b<Dynamic>

Source

pub fn reset_with_key(&mut self, key: &[u8]) -> Result<(), Error>

Reset the hash state and update the key to the contents of key.

Source§

impl Blake2b<ConstKeyLen<0>>

Source

pub fn reset(&mut self)

Reset the hash state.

Source§

impl<const OUT_LEN: usize> Blake2b<ConstKeyLenConstDigestLen<0, OUT_LEN>>

Source

pub fn reset(&mut self)

Reset the hash state.

Source§

impl<const OUT_LEN: usize> Blake2b<ConstDigestLen<OUT_LEN>>

Source

pub fn reset(&mut self) -> Result<(), Error>

Reset the hash state.

Source§

impl Blake2b<Dynamic>

Source

pub fn reset(&mut self) -> Result<(), Error>

Reset the hash state.

Trait Implementations§

Source§

impl<const OUT_SIZE: usize> From<Blake2b<ConstKeyLenConstDigestLen<0, OUT_SIZE>>> for Blake2bHasher<OUT_SIZE>

Source§

fn from(state: Blake2b<ConstKeyLenConstDigestLen<0, OUT_SIZE>>) -> Self

Converts to this type from the input type.
Source§

impl<const OUT_SIZE: usize> InitializeDigestState for Blake2b<ConstKeyLenConstDigestLen<0, OUT_SIZE>>

Source§

fn new() -> Self

Initialize a new incremental digest state.

Auto Trait Implementations§

§

impl<T> Freeze for Blake2b<T>

§

impl<T> RefUnwindSafe for Blake2b<T>
where T: RefUnwindSafe,

§

impl<T> Send for Blake2b<T>
where T: Send,

§

impl<T> Sync for Blake2b<T>
where T: Sync,

§

impl<T> Unpin for Blake2b<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Blake2b<T>

§

impl<T> UnwindSafe for Blake2b<T>
where T: UnwindSafe,

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.
Source§

impl<T, const LEN: usize> SupportsKeyLen<LEN> for T
where T: SupportsKeyLenInternal<LEN>,

Source§

impl<T, const LEN: usize> SupportsOutLen<LEN> for T
where T: SupportsOutLenInternal<LEN>,