pub struct SerializingHasher<Inner> { /* private fields */ }Expand description
Converts a hasher which can hash bytes, u32’s or u64’s into a hasher which can hash field elements.
Supports two types of hashing.
- Hashing a sequence of field elements.
- Hashing a sequence of arrays of
Nfield elements as if we are hashingNsequences of field elements in parallel. This is useful when the inner hash is able to use vectorized instructions to compute multiple hashes at once.
Implementations§
Source§impl<Inner> SerializingHasher<Inner>
impl<Inner> SerializingHasher<Inner>
Trait Implementations§
Source§impl<Inner: Clone> Clone for SerializingHasher<Inner>
impl<Inner: Clone> Clone for SerializingHasher<Inner>
Source§fn clone(&self) -> SerializingHasher<Inner>
fn clone(&self) -> SerializingHasher<Inner>
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<F, Inner, const N: usize, const M: usize> CryptographicHasher<[F; M], [[u32; M]; N]> for SerializingHasher<Inner>
impl<F, Inner, const N: usize, const M: usize> CryptographicHasher<[F; M], [[u32; M]; N]> for SerializingHasher<Inner>
Source§fn hash_iter<I>(&self, input: I) -> [[u32; M]; N]where
I: IntoIterator<Item = [F; M]>,
fn hash_iter<I>(&self, input: I) -> [[u32; M]; N]where
I: IntoIterator<Item = [F; M]>,
Hash an iterator of input items. Read more
Source§fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
Hash an iterator of slices, by flattening it into a single stream of items. Read more
Source§fn hash_slice(&self, input: &[Item]) -> Out
fn hash_slice(&self, input: &[Item]) -> Out
Hash a single slice of items. Read more
Source§impl<F, Inner, const N: usize, const M: usize> CryptographicHasher<[F; M], [[u64; M]; N]> for SerializingHasher<Inner>
impl<F, Inner, const N: usize, const M: usize> CryptographicHasher<[F; M], [[u64; M]; N]> for SerializingHasher<Inner>
Source§fn hash_iter<I>(&self, input: I) -> [[u64; M]; N]where
I: IntoIterator<Item = [F; M]>,
fn hash_iter<I>(&self, input: I) -> [[u64; M]; N]where
I: IntoIterator<Item = [F; M]>,
Hash an iterator of input items. Read more
Source§fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
Hash an iterator of slices, by flattening it into a single stream of items. Read more
Source§fn hash_slice(&self, input: &[Item]) -> Out
fn hash_slice(&self, input: &[Item]) -> Out
Hash a single slice of items. Read more
Source§impl<F, Inner, const N: usize, const M: usize> CryptographicHasher<[F; M], [[u8; M]; N]> for SerializingHasher<Inner>
impl<F, Inner, const N: usize, const M: usize> CryptographicHasher<[F; M], [[u8; M]; N]> for SerializingHasher<Inner>
Source§fn hash_iter<I>(&self, input: I) -> [[u8; M]; N]where
I: IntoIterator<Item = [F; M]>,
fn hash_iter<I>(&self, input: I) -> [[u8; M]; N]where
I: IntoIterator<Item = [F; M]>,
Hash an iterator of input items. Read more
Source§fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
Hash an iterator of slices, by flattening it into a single stream of items. Read more
Source§fn hash_slice(&self, input: &[Item]) -> Out
fn hash_slice(&self, input: &[Item]) -> Out
Hash a single slice of items. Read more
Source§impl<F, Inner, const N: usize> CryptographicHasher<F, [u32; N]> for SerializingHasher<Inner>
impl<F, Inner, const N: usize> CryptographicHasher<F, [u32; N]> for SerializingHasher<Inner>
Source§fn hash_iter<I>(&self, input: I) -> [u32; N]where
I: IntoIterator<Item = F>,
fn hash_iter<I>(&self, input: I) -> [u32; N]where
I: IntoIterator<Item = F>,
Hash an iterator of input items. Read more
Source§fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
Hash an iterator of slices, by flattening it into a single stream of items. Read more
Source§fn hash_slice(&self, input: &[Item]) -> Out
fn hash_slice(&self, input: &[Item]) -> Out
Hash a single slice of items. Read more
Source§impl<F, Inner, const N: usize> CryptographicHasher<F, [u64; N]> for SerializingHasher<Inner>
impl<F, Inner, const N: usize> CryptographicHasher<F, [u64; N]> for SerializingHasher<Inner>
Source§fn hash_iter<I>(&self, input: I) -> [u64; N]where
I: IntoIterator<Item = F>,
fn hash_iter<I>(&self, input: I) -> [u64; N]where
I: IntoIterator<Item = F>,
Hash an iterator of input items. Read more
Source§fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
Hash an iterator of slices, by flattening it into a single stream of items. Read more
Source§fn hash_slice(&self, input: &[Item]) -> Out
fn hash_slice(&self, input: &[Item]) -> Out
Hash a single slice of items. Read more
Source§impl<F, Inner, const N: usize> CryptographicHasher<F, [u8; N]> for SerializingHasher<Inner>
impl<F, Inner, const N: usize> CryptographicHasher<F, [u8; N]> for SerializingHasher<Inner>
Source§fn hash_iter<I>(&self, input: I) -> [u8; N]where
I: IntoIterator<Item = F>,
fn hash_iter<I>(&self, input: I) -> [u8; N]where
I: IntoIterator<Item = F>,
Hash an iterator of input items. Read more
Source§fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
fn hash_iter_slices<'a, I>(&self, input: I) -> Outwhere
I: IntoIterator<Item = &'a [Item]>,
Item: 'a,
Hash an iterator of slices, by flattening it into a single stream of items. Read more
Source§fn hash_slice(&self, input: &[Item]) -> Out
fn hash_slice(&self, input: &[Item]) -> Out
Hash a single slice of items. Read more
Source§impl<Inner: Debug> Debug for SerializingHasher<Inner>
impl<Inner: Debug> Debug for SerializingHasher<Inner>
impl<Inner: Copy> Copy for SerializingHasher<Inner>
Auto Trait Implementations§
impl<Inner> Freeze for SerializingHasher<Inner>where
Inner: Freeze,
impl<Inner> RefUnwindSafe for SerializingHasher<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for SerializingHasher<Inner>where
Inner: Send,
impl<Inner> Sync for SerializingHasher<Inner>where
Inner: Sync,
impl<Inner> Unpin for SerializingHasher<Inner>where
Inner: Unpin,
impl<Inner> UnwindSafe for SerializingHasher<Inner>where
Inner: UnwindSafe,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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