pub type Buffer<S> = BlockBuffer<<S as BlockSizeUser>::BlockSize, <S as BufferKindUser>::BufferKind>;Expand description
Buffer type used by type which implements BufferKindUser.
Aliased Type§
pub struct Buffer<S> { /* private fields */ }Implementations
Source§impl<BlockSize> BlockBuffer<BlockSize, Eager>
impl<BlockSize> BlockBuffer<BlockSize, Eager>
Sourcepub fn set_data(
&mut self,
data: &mut [u8],
process_blocks: impl FnMut(&mut [GenericArray<u8, BlockSize>]),
)
pub fn set_data( &mut self, data: &mut [u8], process_blocks: impl FnMut(&mut [GenericArray<u8, BlockSize>]), )
Set data to generated blocks.
Sourcepub fn digest_pad(
&mut self,
delim: u8,
suffix: &[u8],
compress: impl FnMut(&GenericArray<u8, BlockSize>),
)
pub fn digest_pad( &mut self, delim: u8, suffix: &[u8], compress: impl FnMut(&GenericArray<u8, BlockSize>), )
Compress remaining data after padding it with delim, zeros and
the suffix bytes. If there is not enough unused space, compress
will be called twice.
§Panics
If suffix length is bigger than block size.
Sourcepub fn len64_padding_be(
&mut self,
data_len: u64,
compress: impl FnMut(&GenericArray<u8, BlockSize>),
)
pub fn len64_padding_be( &mut self, data_len: u64, compress: impl FnMut(&GenericArray<u8, BlockSize>), )
Pad message with 0x80, zeros and 64-bit message length using big-endian byte order.
Sourcepub fn len64_padding_le(
&mut self,
data_len: u64,
compress: impl FnMut(&GenericArray<u8, BlockSize>),
)
pub fn len64_padding_le( &mut self, data_len: u64, compress: impl FnMut(&GenericArray<u8, BlockSize>), )
Pad message with 0x80, zeros and 64-bit message length using little-endian byte order.
Sourcepub fn len128_padding_be(
&mut self,
data_len: u128,
compress: impl FnMut(&GenericArray<u8, BlockSize>),
)
pub fn len128_padding_be( &mut self, data_len: u128, compress: impl FnMut(&GenericArray<u8, BlockSize>), )
Pad message with 0x80, zeros and 128-bit message length using big-endian byte order.
Source§impl<BlockSize, Kind> BlockBuffer<BlockSize, Kind>
impl<BlockSize, Kind> BlockBuffer<BlockSize, Kind>
Sourcepub fn new(buf: &[u8]) -> BlockBuffer<BlockSize, Kind>
pub fn new(buf: &[u8]) -> BlockBuffer<BlockSize, Kind>
Sourcepub fn try_new(buf: &[u8]) -> Result<BlockBuffer<BlockSize, Kind>, Error>
pub fn try_new(buf: &[u8]) -> Result<BlockBuffer<BlockSize, Kind>, 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(&[GenericArray<u8, BlockSize>]),
)
pub fn digest_blocks( &mut self, input: &[u8], compress: impl FnMut(&[GenericArray<u8, 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 GenericArray<u8, BlockSize>
pub fn pad_with_zeros(&mut self) -> &mut GenericArray<u8, BlockSize>
Pad remaining data with zeros and return resulting block.
Sourcepub fn set(&mut self, buf: GenericArray<u8, BlockSize>, pos: usize)
pub fn set(&mut self, buf: GenericArray<u8, BlockSize>, pos: usize)
Trait Implementations
Source§impl<BlockSize, Kind> Clone for BlockBuffer<BlockSize, Kind>
impl<BlockSize, Kind> Clone for BlockBuffer<BlockSize, Kind>
Source§fn clone(&self) -> BlockBuffer<BlockSize, Kind>
fn clone(&self) -> BlockBuffer<BlockSize, Kind>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more