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<F>(&mut self, input: &[u8], f: F) where
F: FnMut(&GenericArray<u8, BlockSize>),
pub fn input<F>(&mut self, input: &[u8], f: F) where
F: FnMut(&GenericArray<u8, BlockSize>),
Process data in input
in blocks of size BlockSize
using function f
.
sourcepub fn input_lazy<F>(&mut self, input: &[u8], f: F) where
F: FnMut(&GenericArray<u8, BlockSize>),
pub fn input_lazy<F>(&mut self, input: &[u8], f: F) where
F: 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<B, F>(&mut self, data_len: u64, f: F) where
B: ByteOrder,
F: FnMut(&GenericArray<u8, BlockSize>),
pub fn len64_padding<B, F>(&mut self, data_len: u64, f: F) where
B: ByteOrder,
F: FnMut(&GenericArray<u8, BlockSize>),
Pad message with 0x80, zeros and 64-bit message length
in a byte order specified by B
sourcepub fn len128_padding_be<F>(&mut self, hi: u64, lo: u64, f: F) where
F: FnMut(&GenericArray<u8, BlockSize>),
pub fn len128_padding_be<F>(&mut self, hi: u64, lo: u64, f: F) where
F: FnMut(&GenericArray<u8, BlockSize>),
Pad message with 0x80, zeros and 128-bit message length in the 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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more