pub struct ParallelSha256Digest;Expand description
A ParallelDigest for SHA-256 that specializes
digest_with_const_len for short, fixed-length
leaves.
When every leaf serializes to at most SINGLE_BLOCK_MAX_LEN bytes, the whole leaf — message,
padding, and length suffix — fits in one 64-byte block, so the digest is a single call to the
raw [compress256] block function starting from the SHA-256 IV. This skips the update/
finalize bookkeeping that the generic ParallelDigestAdapter performs per leaf.
Longer leaves fall back to ParallelDigestAdapter.
Trait Implementations§
Source§impl Clone for ParallelSha256Digest
impl Clone for ParallelSha256Digest
Source§fn clone(&self) -> ParallelSha256Digest
fn clone(&self) -> ParallelSha256Digest
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 Debug for ParallelSha256Digest
impl Debug for ParallelSha256Digest
Source§impl Default for ParallelSha256Digest
impl Default for ParallelSha256Digest
Source§fn default() -> ParallelSha256Digest
fn default() -> ParallelSha256Digest
Returns the “default value” for a type. Read more
Source§impl ParallelDigest for ParallelSha256Digest
impl ParallelDigest for ParallelSha256Digest
Source§fn digest<I: IntoIterator<Item: SerializeBytes>>(
&self,
source: impl IndexedParallelIterator<Item = I>,
out: &mut [MaybeUninit<Output<Sha256>>],
)
fn digest<I: IntoIterator<Item: SerializeBytes>>( &self, source: impl IndexedParallelIterator<Item = I>, out: &mut [MaybeUninit<Output<Sha256>>], )
Calculate the digest of multiple hashes by processing a parallel iterator of iterators. Read more
Source§fn digest_with_const_len<I: IntoIterator<Item: FixedSizeSerializeBytes>>(
&self,
n_items_per_input: usize,
source: impl IndexedParallelIterator<Item = I>,
out: &mut [MaybeUninit<Output<Sha256>>],
)
fn digest_with_const_len<I: IntoIterator<Item: FixedSizeSerializeBytes>>( &self, n_items_per_input: usize, source: impl IndexedParallelIterator<Item = I>, out: &mut [MaybeUninit<Output<Sha256>>], )
Auto Trait Implementations§
impl Freeze for ParallelSha256Digest
impl RefUnwindSafe for ParallelSha256Digest
impl Send for ParallelSha256Digest
impl Sync for ParallelSha256Digest
impl Unpin for ParallelSha256Digest
impl UnsafeUnpin for ParallelSha256Digest
impl UnwindSafe for ParallelSha256Digest
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