[][src]Struct block_buffer::BlockBuffer

pub struct BlockBuffer<BlockSize: ArrayLength<u8>> { /* fields omitted */ }

Buffer for block processing of data

Methods

impl<BlockSize: ArrayLength<u8>> BlockBuffer<BlockSize>[src]

pub fn input<F>(&mut self, input: &[u8], f: F) where
    F: FnMut(&GenericArray<u8, BlockSize>), 
[src]

Process data in input in blocks of size BlockSize using function f.

pub fn input_lazy<F>(&mut self, input: &[u8], f: F) where
    F: FnMut(&GenericArray<u8, BlockSize>), 
[src]

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.

pub fn len64_padding<B, F>(&mut self, data_len: u64, f: F) where
    B: ByteOrder,
    F: FnMut(&GenericArray<u8, BlockSize>), 
[src]

Pad message with 0x80, zeros and 64-bit message length in a byte order specified by B

pub fn len128_padding_be<F>(&mut self, hi: u64, lo: u64, f: F) where
    F: FnMut(&GenericArray<u8, BlockSize>), 
[src]

Pad message with 0x80, zeros and 128-bit message length in the big-endian byte order

pub fn pad_with<P: Padding>(
    &mut self
) -> Result<&mut GenericArray<u8, BlockSize>, PadError>
[src]

Pad message with a given padding P

Returns PadError if internall buffer is full, which can only happen if input_lazy was used.

pub fn size(&self) -> usize[src]

Return size of the internall buffer in bytes

pub fn position(&self) -> usize[src]

Return current cursor position

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

Trait Implementations

impl<BlockSize: Clone + ArrayLength<u8>> Clone for BlockBuffer<BlockSize>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<BlockSize: Default + ArrayLength<u8>> Default for BlockBuffer<BlockSize>[src]

Auto Trait Implementations

impl<BlockSize> Send for BlockBuffer<BlockSize>

impl<BlockSize> Sync for BlockBuffer<BlockSize>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self