Trait ctr::flavors::CtrFlavor

source ·
pub trait CtrFlavor<B>where
    Self: Default + Clone,
    B: ArrayLength<u8>,
{ type Nonce: Clone; type Backend: SeekNum; fn generate_block(&self, nonce: &Self::Nonce) -> GenericArray<u8, B>; fn load(block: &GenericArray<u8, B>) -> Self::Nonce; fn checked_add(&self, rhs: usize) -> Option<Self>; fn increment(&mut self); fn from_backend(v: Self::Backend) -> Self; fn to_backend(&self) -> Self::Backend; }
Expand description

Trait implemented by different counter types used in the CTR mode.

Required Associated Types§

Inner representation of nonce.

Backend numeric type

Required Methods§

Generate block for given nonce value.

Load nonce value from bytes.

Checked addition.

Wrapped increment.

Convert from a backend value

Convert to a backend value

Implementors§