[−][src]Struct block_buffer::BlockBuffer
Buffer for block processing of data.
Implementations
impl<BlockSize: ArrayLength<u8>> BlockBuffer<BlockSize>
[src]
pub fn digest_block(
&mut self,
mut input: &[u8],
mut compress: impl FnMut(&Block<BlockSize>)
)
[src]
&mut self,
mut input: &[u8],
mut compress: impl FnMut(&Block<BlockSize>)
)
Digest data in input
in blocks of size BlockSize
using
the compress
function, which accepts a block reference.
pub fn digest_blocks(
&mut self,
mut input: &[u8],
mut compress: impl FnMut(&[Block<BlockSize>])
)
[src]
&mut self,
mut input: &[u8],
mut compress: impl FnMut(&[Block<BlockSize>])
)
Digest data in input
in blocks of size BlockSize
using
the compress
function, which accepts slice of blocks.
pub fn par_xor_data<S, N: ArrayLength<Block<BlockSize>>>(
&mut self,
data: &mut [u8],
state: &mut S,
gen_block: impl FnMut(&mut S) -> Block<BlockSize>,
gen_blocks: impl FnMut(&mut S) -> ParBlock<BlockSize, N>
)
[src]
&mut self,
data: &mut [u8],
state: &mut S,
gen_block: impl FnMut(&mut S) -> Block<BlockSize>,
gen_blocks: impl FnMut(&mut S) -> ParBlock<BlockSize, N>
)
XORs data
using the provided state and block generation functions.
This method is intended for stream cipher implementations. If N
is
equal to 1, the gen_blocks
function is not used.
pub fn xor_data(
&mut self,
data: &mut [u8],
mut gen_block: impl FnMut() -> Block<BlockSize>
)
[src]
&mut self,
data: &mut [u8],
mut gen_block: impl FnMut() -> Block<BlockSize>
)
Simplified version of the [par_xor_data
] method, with N = 1
.
pub fn set_data(
&mut self,
data: &mut [u8],
mut gen_block: impl FnMut() -> Block<BlockSize>
)
[src]
&mut self,
data: &mut [u8],
mut gen_block: impl FnMut() -> Block<BlockSize>
)
Set data
to generated blocks.
pub fn len64_padding_be(
&mut self,
data_len: u64,
compress: impl FnMut(&Block<BlockSize>)
)
[src]
&mut self,
data_len: u64,
compress: impl FnMut(&Block<BlockSize>)
)
Pad message with 0x80, zeros and 64-bit message length using big-endian byte order.
pub fn len64_padding_le(
&mut self,
data_len: u64,
compress: impl FnMut(&Block<BlockSize>)
)
[src]
&mut self,
data_len: u64,
compress: impl FnMut(&Block<BlockSize>)
)
Pad message with 0x80, zeros and 64-bit message length using little-endian byte order.
pub fn len128_padding_be(
&mut self,
data_len: u128,
compress: impl FnMut(&Block<BlockSize>)
)
[src]
&mut self,
data_len: u128,
compress: impl FnMut(&Block<BlockSize>)
)
Pad message with 0x80, zeros and 128-bit message length using big-endian byte order.
pub fn size(&self) -> usize
[src]
Return size of the internall buffer in bytes.
pub fn remaining(&self) -> usize
[src]
Return number of remaining bytes in the internall buffer.
pub fn reset(&mut self)
[src]
Reset buffer by setting cursor position to zero.
pub fn get_pos(&self) -> usize
[src]
Return current cursor position.
pub fn set(&mut self, buf: Block<BlockSize>, pos: usize)
[src]
Trait Implementations
impl<BlockSize: Clone + ArrayLength<u8>> Clone for BlockBuffer<BlockSize>
[src]
pub fn clone(&self) -> BlockBuffer<BlockSize>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<BlockSize: Default + ArrayLength<u8>> Default for BlockBuffer<BlockSize>
[src]
pub fn default() -> BlockBuffer<BlockSize>
[src]
Auto Trait Implementations
impl<BlockSize> Send for BlockBuffer<BlockSize>
[src]
impl<BlockSize> Sync for BlockBuffer<BlockSize>
[src]
impl<BlockSize> Unpin for BlockBuffer<BlockSize> where
<BlockSize as ArrayLength<u8>>::ArrayType: Unpin,
[src]
<BlockSize as ArrayLength<u8>>::ArrayType: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,