Struct block_buffer::BlockBuffer
source · [−]pub struct BlockBuffer<BlockSize: ArrayLength<u8>> { /* private fields */ }
Expand description
Buffer for block processing of data
Implementations
sourceimpl<BlockSize: ArrayLength<u8>> BlockBuffer<BlockSize>
impl<BlockSize: ArrayLength<u8>> BlockBuffer<BlockSize>
sourcepub fn input_block(
&mut self,
input: &[u8],
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn input_block(
&mut self,
input: &[u8],
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
Process data in input
in blocks of size BlockSize
using function f
.
sourcepub fn input_blocks(
&mut self,
input: &[u8],
f: impl FnMut(&[GenericArray<u8, BlockSize>])
)
pub fn input_blocks(
&mut self,
input: &[u8],
f: impl FnMut(&[GenericArray<u8, BlockSize>])
)
Process data in input
in blocks of size BlockSize
using function f
, which accepts
slice of blocks.
sourcepub fn input_lazy(
&mut self,
input: &[u8],
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn input_lazy(
&mut self,
input: &[u8],
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
Variant that doesn’t flush the buffer until there’s additional data to be processed. Suitable for tweakable block ciphers like Threefish that need to know whether a block is the last data block before processing it.
sourcepub fn len64_padding_be(
&mut self,
data_len: u64,
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn len64_padding_be(
&mut self,
data_len: u64,
f: 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,
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn len64_padding_le(
&mut self,
data_len: u64,
f: 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,
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn len128_padding_be(
&mut self,
data_len: u128,
f: impl FnMut(&GenericArray<u8, BlockSize>)
)
Pad message with 0x80, zeros and 128-bit message length using big-endian byte order
Trait Implementations
sourceimpl<BlockSize: Clone + ArrayLength<u8>> Clone for BlockBuffer<BlockSize>
impl<BlockSize: Clone + ArrayLength<u8>> Clone for BlockBuffer<BlockSize>
sourcefn clone(&self) -> BlockBuffer<BlockSize>
fn clone(&self) -> BlockBuffer<BlockSize>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<BlockSize: Default + ArrayLength<u8>> Default for BlockBuffer<BlockSize>
impl<BlockSize: Default + ArrayLength<u8>> Default for BlockBuffer<BlockSize>
sourcefn default() -> BlockBuffer<BlockSize>
fn default() -> BlockBuffer<BlockSize>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<BlockSize> RefUnwindSafe for BlockBuffer<BlockSize> where
<BlockSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<BlockSize> Send for BlockBuffer<BlockSize>
impl<BlockSize> Sync for BlockBuffer<BlockSize>
impl<BlockSize> Unpin for BlockBuffer<BlockSize> where
<BlockSize as ArrayLength<u8>>::ArrayType: Unpin,
impl<BlockSize> UnwindSafe for BlockBuffer<BlockSize> where
<BlockSize as ArrayLength<u8>>::ArrayType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more