pub struct VisionHasherMultiDigest<const N: usize, const MN: usize> { /* private fields */ }Expand description
A Vision hasher with state size M=6 suited for parallelization.
Without using packed fields, there is only one advantage of an explicit parallelized Vision hasher over invoking the Vision hasher multiple times in parallel: we can amortize the cost of inversion in the sbox using Montogery’s trick. We slightly modify Montogery’s trick to use a binary tree structure, maximizing independence of multiplications for better instruction pipelining.
Trait Implementations§
Source§impl<const N: usize, const MN: usize> Clone for VisionHasherMultiDigest<N, MN>
impl<const N: usize, const MN: usize> Clone for VisionHasherMultiDigest<N, MN>
Source§fn clone(&self) -> VisionHasherMultiDigest<N, MN>
fn clone(&self) -> VisionHasherMultiDigest<N, MN>
Returns a duplicate 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<const N: usize, const MN: usize> MultiDigest<N> for VisionHasherMultiDigest<N, MN>
impl<const N: usize, const MN: usize> MultiDigest<N> for VisionHasherMultiDigest<N, MN>
Source§type Digest = VisionHasherDigest
type Digest = VisionHasherDigest
The corresponding non-parallelized hash function.
Source§fn update(&mut self, data: [&[u8]; N])
fn update(&mut self, data: [&[u8]; N])
Process data, updating the internal state.
The number of rows in
data must be equal to parallel_instances().Source§fn finalize_into(self, out: &mut [MaybeUninit<Output<Self::Digest>>; N])
fn finalize_into(self, out: &mut [MaybeUninit<Output<Self::Digest>>; N])
Write result into provided array and consume the hasher instance.
Source§fn finalize_into_reset(
&mut self,
out: &mut [MaybeUninit<Output<Self::Digest>>; N],
)
fn finalize_into_reset( &mut self, out: &mut [MaybeUninit<Output<Self::Digest>>; N], )
Write result into provided array and reset the hasher instance.
Source§fn new_with_prefix(data: impl AsRef<[u8]>) -> Self
fn new_with_prefix(data: impl AsRef<[u8]>) -> Self
Create new hasher instance which has processed the provided data.
Source§fn chain_update(self, data: [&[u8]; N]) -> Self
fn chain_update(self, data: [&[u8]; N]) -> Self
Process input data in a chained manner.
Auto Trait Implementations§
impl<const N: usize, const MN: usize> Freeze for VisionHasherMultiDigest<N, MN>
impl<const N: usize, const MN: usize> RefUnwindSafe for VisionHasherMultiDigest<N, MN>
impl<const N: usize, const MN: usize> Send for VisionHasherMultiDigest<N, MN>
impl<const N: usize, const MN: usize> Sync for VisionHasherMultiDigest<N, MN>
impl<const N: usize, const MN: usize> Unpin for VisionHasherMultiDigest<N, MN>
impl<const N: usize, const MN: usize> UnwindSafe for VisionHasherMultiDigest<N, MN>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more