pub struct CoreWrapper<T>where
    T: BufferKindUser,
    T::BlockSize: IsLess<U256>,
    Le<T::BlockSize, U256>: NonZero,{
    core: T,
    buffer: BlockBuffer<T::BlockSize, T::BufferKind>,
}
Expand description

Wrapper around BufferKindUser.

It handles data buffering and implements the slice-based traits.

Fields§

§core: T§buffer: BlockBuffer<T::BlockSize, T::BufferKind>

Implementations§

source§

impl<T> CoreWrapper<T>where T: BufferKindUser, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source

pub fn from_core(core: T) -> Self

Create new wrapper from core.

source

pub fn decompose(self) -> (T, Buffer<T>)

Decompose wrapper into inner parts.

Trait Implementations§

source§

impl<T> BlockSizeUser for CoreWrapper<T>where T: BufferKindUser + HashMarker, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

§

type BlockSize = <T as BlockSizeUser>::BlockSize

Size of the block in bytes.
source§

fn block_size() -> usize

Return block size in bytes.
source§

impl<T> Clone for CoreWrapper<T>where T: BufferKindUser + Clone, T::BlockSize: IsLess<U256> + Clone, Le<T::BlockSize, U256>: NonZero, T::BufferKind: Clone,

source§

fn clone(&self) -> CoreWrapper<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> CoreProxy for CoreWrapper<T>where T: BufferKindUser, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

§

type Core = T

Type wrapped by CoreWrapper.
source§

impl<T> Debug for CoreWrapper<T>where T: BufferKindUser + AlgorithmName, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T> Default for CoreWrapper<T>where T: BufferKindUser + Default, T::BlockSize: IsLess<U256> + Default, Le<T::BlockSize, U256>: NonZero, T::BufferKind: Default,

source§

fn default() -> CoreWrapper<T>

Returns the “default value” for a type. Read more
source§

impl<T> ExtendableOutput for CoreWrapper<T>where T: ExtendableOutputCore, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero, <T::ReaderCore as BlockSizeUser>::BlockSize: IsLess<U256>, Le<<T::ReaderCore as BlockSizeUser>::BlockSize, U256>: NonZero,

§

type Reader = XofReaderCoreWrapper<<T as ExtendableOutputCore>::ReaderCore>

Reader
source§

fn finalize_xof(self) -> Self::Reader

Retrieve XOF reader and consume hasher instance.
source§

fn finalize_xof_into(self, out: &mut [u8])

Finalize XOF and write result into out.
source§

fn finalize_boxed(self, output_size: usize) -> Box<[u8]>

Retrieve result into a boxed slice of the specified size and consume the hasher. Read more
source§

impl<T> ExtendableOutputReset for CoreWrapper<T>where T: ExtendableOutputCore + Reset, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero, <T::ReaderCore as BlockSizeUser>::BlockSize: IsLess<U256>, Le<<T::ReaderCore as BlockSizeUser>::BlockSize, U256>: NonZero,

source§

fn finalize_xof_reset(&mut self) -> Self::Reader

Retrieve XOF reader and reset hasher instance state.
source§

fn finalize_xof_reset_into(&mut self, out: &mut [u8])

Finalize XOF, write result into out, and reset the hasher state.
source§

fn finalize_boxed_reset(&mut self, output_size: usize) -> Box<[u8]>

Retrieve result into a boxed slice of the specified size and reset the hasher state. Read more
source§

impl<T> FixedOutput for CoreWrapper<T>where T: FixedOutputCore, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

fn finalize_into(self, out: &mut Output<Self>)

Consume value and write result into provided array.
source§

fn finalize_fixed(self) -> Output<Self>

Retrieve result and consume the hasher instance.
source§

impl<T> FixedOutputReset for CoreWrapper<T>where T: FixedOutputCore + Reset, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

fn finalize_into_reset(&mut self, out: &mut Output<Self>)

Write result into provided array and reset the hasher state.
source§

fn finalize_fixed_reset(&mut self) -> Output<Self>

Retrieve result and reset the hasher state.
source§

impl<T> KeyInit for CoreWrapper<T>where T: BufferKindUser + KeyInit, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

fn new(key: &Key<Self>) -> Self

Create new value from fixed size key.
source§

fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>

Create new value from variable size key.
source§

impl<T> KeySizeUser for CoreWrapper<T>where T: BufferKindUser + KeySizeUser, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

§

type KeySize = <T as KeySizeUser>::KeySize

Key size in bytes.
source§

fn key_size() -> usize

Return key size in bytes.
source§

impl<T> OutputSizeUser for CoreWrapper<T>where T: BufferKindUser + OutputSizeUser, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

§

type OutputSize = <T as OutputSizeUser>::OutputSize

Size of the output in bytes.
source§

fn output_size() -> usize

Return output size in bytes.
source§

impl<T> Reset for CoreWrapper<T>where T: BufferKindUser + Reset, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

fn reset(&mut self)

Reset state to its initial value.
source§

impl<T> Update for CoreWrapper<T>where T: BufferKindUser + UpdateCore, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

fn update(&mut self, input: &[u8])

Update state using the provided data.
source§

fn chain(self, data: impl AsRef<[u8]>) -> Selfwhere Self: Sized,

Digest input data in a chained manner.
source§

impl<T> Write for CoreWrapper<T>where T: BufferKindUser + UpdateCore, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

fn write(&mut self, buf: &[u8]) -> Result<usize>

Write a buffer into this writer, returning how many bytes were written. Read more
source§

fn flush(&mut self) -> Result<()>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
1.36.0 · source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
1.0.0 · source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
source§

impl<T> HashMarker for CoreWrapper<T>where T: BufferKindUser + HashMarker, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

source§

impl<T> Sealed for CoreWrapper<T>where T: BufferKindUser, T::BlockSize: IsLess<U256>, Le<T::BlockSize, U256>: NonZero,

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<D> Digest for Dwhere D: FixedOutput + Default + Update + HashMarker,

source§

fn new() -> D

Create new hasher instance.
source§

fn new_with_prefix(data: impl AsRef<[u8]>) -> Dwhere D: Default,

Create new hasher instance which has processed the provided data.
source§

fn update(&mut self, data: impl AsRef<[u8]>)

Process data, updating the internal state.
source§

fn chain_update(self, data: impl AsRef<[u8]>) -> D

Process input data in a chained manner.
source§

fn finalize(self) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>

Retrieve result and consume hasher instance.
source§

fn finalize_into( self, out: &mut GenericArray<u8, <D as OutputSizeUser>::OutputSize> )

Write result into provided array and consume the hasher instance.
source§

fn finalize_reset( &mut self ) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>where D: FixedOutputReset,

Retrieve result and reset hasher instance.
source§

fn finalize_into_reset( &mut self, out: &mut GenericArray<u8, <D as OutputSizeUser>::OutputSize> )where D: FixedOutputReset,

Write result into provided array and reset the hasher instance.
source§

fn reset(&mut self)where D: Reset,

Reset hasher instance to its initial state.
source§

fn output_size() -> usize

Get output size of the hasher
source§

fn digest( data: impl AsRef<[u8]> ) -> GenericArray<u8, <D as OutputSizeUser>::OutputSize>

Compute hash of data.
source§

impl<D> DynDigest for Dwhere D: Update + FixedOutputReset + Reset + Clone + 'static,

source§

fn update(&mut self, data: &[u8])

Digest input data. Read more
source§

fn finalize_reset(&mut self) -> Box<[u8], Global>

Retrieve result and reset hasher instance
source§

fn finalize(self: Box<D, Global>) -> Box<[u8], Global>

Retrieve result and consume boxed hasher instance
source§

fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>

Write result into provided array and consume the hasher instance. Read more
source§

fn finalize_into_reset( &mut self, buf: &mut [u8] ) -> Result<(), InvalidBufferSize>

Write result into provided array and reset the hasher instance. Read more
source§

fn reset(&mut self)

Reset hasher instance to its initial state.
source§

fn output_size(&self) -> usize

Get output size of the hasher
source§

fn box_clone(&self) -> Box<dyn DynDigest, Global>

Clone hasher state into a boxed trait object
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.