Struct block_buffer::BlockBuffer [−][src]
pub struct BlockBuffer<BlockSize: ArrayLength<u8>> { /* fields omitted */ }
Buffer for block processing of data.
Implementations
impl<BlockSize: ArrayLength<u8>> BlockBuffer<BlockSize>
[src]
impl<BlockSize: ArrayLength<u8>> BlockBuffer<BlockSize>
[src]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],
gen_block: impl FnMut() -> Block<BlockSize>
)
[src]
&mut self,
data: &mut [u8],
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],
gen_block: impl FnMut() -> Block<BlockSize>
)
[src]
&mut self,
data: &mut [u8],
gen_block: impl FnMut() -> Block<BlockSize>
)
Set data
to generated blocks.
pub fn block_mode_processing<'a>(
&mut self,
data: &[u8],
buf: &'a mut [u8],
process: impl FnMut(&mut [Block<BlockSize>])
) -> Result<&'a [u8], InvalidLength>
[src]
&mut self,
data: &[u8],
buf: &'a mut [u8],
process: impl FnMut(&mut [Block<BlockSize>])
) -> Result<&'a [u8], InvalidLength>
Process data
in blocks and write result to out_buf
, storing
leftovers for future use.
pub fn digest_pad(
&mut self,
delim: u8,
suffix: &[u8],
compress: impl FnMut(&Block<BlockSize>)
)
[src]
&mut self,
delim: u8,
suffix: &[u8],
compress: impl FnMut(&Block<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.
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]
impl<BlockSize: Clone + ArrayLength<u8>> Clone for BlockBuffer<BlockSize>
[src]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]
impl<BlockSize: Default + ArrayLength<u8>> Default for BlockBuffer<BlockSize>
[src]fn default() -> BlockBuffer<BlockSize>
[src]
impl<B: ArrayLength<u8>> DigestBuffer<B> for BlockBuffer<B>
[src]
impl<B: ArrayLength<u8>> DigestBuffer<B> for BlockBuffer<B>
[src]Auto Trait Implementations
impl<BlockSize> Send for BlockBuffer<BlockSize>
impl<BlockSize> Send for BlockBuffer<BlockSize>
impl<BlockSize> Sync for BlockBuffer<BlockSize>
impl<BlockSize> Sync for BlockBuffer<BlockSize>
impl<BlockSize> Unpin for BlockBuffer<BlockSize> where
<BlockSize as ArrayLength<u8>>::ArrayType: Unpin,
impl<BlockSize> Unpin for BlockBuffer<BlockSize> where
<BlockSize as ArrayLength<u8>>::ArrayType: Unpin,