Struct miden_crypto::hash::blake::Blake3_160
source · pub struct Blake3_160;
Expand description
160-bit output blake3 hasher.
Implementations§
source§impl Blake3_160
impl Blake3_160
sourcepub fn hash(bytes: &[u8]) -> Blake3Digest<DIGEST20_BYTES>
pub fn hash(bytes: &[u8]) -> Blake3Digest<DIGEST20_BYTES>
Returns a hash of the provided sequence of bytes.
sourcepub fn merge(
values: &[Blake3Digest<DIGEST20_BYTES>; 2]
) -> Blake3Digest<DIGEST20_BYTES>
pub fn merge( values: &[Blake3Digest<DIGEST20_BYTES>; 2] ) -> Blake3Digest<DIGEST20_BYTES>
Returns a hash of two digests. This method is intended for use in construction of Merkle trees and verification of Merkle paths.
sourcepub fn hash_elements<E>(elements: &[E]) -> Blake3Digest<DIGEST20_BYTES>where
E: FieldElement<BaseField = Felt>,
pub fn hash_elements<E>(elements: &[E]) -> Blake3Digest<DIGEST20_BYTES>where E: FieldElement<BaseField = Felt>,
Returns a hash of the provided field elements.
Trait Implementations§
source§impl Clone for Blake3_160
impl Clone for Blake3_160
source§fn clone(&self) -> Blake3_160
fn clone(&self) -> Blake3_160
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Blake3_160
impl Debug for Blake3_160
source§impl ElementHasher for Blake3_160
impl ElementHasher for Blake3_160
§type BaseField = BaseElement
type BaseField = BaseElement
Specifies a base field for elements which can be hashed with this hasher.
source§fn hash_elements<E>(elements: &[E]) -> Self::Digestwhere
E: FieldElement<BaseField = Self::BaseField>,
fn hash_elements<E>(elements: &[E]) -> Self::Digestwhere E: FieldElement<BaseField = Self::BaseField>,
Returns a hash of the provided field elements.
source§impl Hasher for Blake3_160
impl Hasher for Blake3_160
source§const COLLISION_RESISTANCE: u32 = 80u32
const COLLISION_RESISTANCE: u32 = 80u32
Blake3 collision resistance is 80-bits for 20-bytes output.
§type Digest = Blake3Digest<20>
type Digest = Blake3Digest<20>
Specifies a digest type returned by this hasher.
source§impl PartialEq for Blake3_160
impl PartialEq for Blake3_160
source§fn eq(&self, other: &Blake3_160) -> bool
fn eq(&self, other: &Blake3_160) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for Blake3_160
impl Eq for Blake3_160
impl StructuralEq for Blake3_160
impl StructuralPartialEq for Blake3_160
Auto Trait Implementations§
impl RefUnwindSafe for Blake3_160
impl Send for Blake3_160
impl Sync for Blake3_160
impl Unpin for Blake3_160
impl UnwindSafe for Blake3_160
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more