Type Alias block_buffer::LazyBuffer
source · pub type LazyBuffer<B> = BlockBuffer<B, Lazy>;
Expand description
Lazy block buffer.
Aliased Type§
struct LazyBuffer<B> { /* private fields */ }
Implementations§
source§impl<BlockSize, Kind> BlockBuffer<BlockSize, Kind>where
BlockSize: ArrayLength<u8> + IsLess<U256>,
Le<BlockSize, U256>: NonZero,
Kind: BufferKind,
impl<BlockSize, Kind> BlockBuffer<BlockSize, Kind>where BlockSize: ArrayLength<u8> + IsLess<U256>, Le<BlockSize, U256>: NonZero, Kind: BufferKind,
sourcepub fn try_new(buf: &[u8]) -> Result<Self, Error>
pub fn try_new(buf: &[u8]) -> Result<Self, Error>
Create new buffer from slice.
Returns an error if slice length is not valid for used buffer kind.
sourcepub fn digest_blocks(
&mut self,
input: &[u8],
compress: impl FnMut(&[Block<BlockSize>])
)
pub fn digest_blocks( &mut self, input: &[u8], compress: impl FnMut(&[Block<BlockSize>]) )
Digest data in input
in blocks of size BlockSize
using
the compress
function, which accepts slice of blocks.
sourcepub fn pad_with_zeros(&mut self) -> &mut Block<BlockSize>
pub fn pad_with_zeros(&mut self) -> &mut Block<BlockSize>
Pad remaining data with zeros and return resulting block.