pub trait CtrFlavor<B>where
Self: Default + Clone,
B: ArrayLength<u8>,{
type Nonce: Clone;
type Backend: SeekNum;
// Required methods
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§
Required Methods§
sourcefn generate_block(&self, nonce: &Self::Nonce) -> GenericArray<u8, B>
fn generate_block(&self, nonce: &Self::Nonce) -> GenericArray<u8, B>
Generate block for given nonce
value.
sourcefn load(block: &GenericArray<u8, B>) -> Self::Nonce
fn load(block: &GenericArray<u8, B>) -> Self::Nonce
Load nonce value from bytes.
sourcefn checked_add(&self, rhs: usize) -> Option<Self>
fn checked_add(&self, rhs: usize) -> Option<Self>
Checked addition.
sourcefn from_backend(v: Self::Backend) -> Self
fn from_backend(v: Self::Backend) -> Self
Convert from a backend value
sourcefn to_backend(&self) -> Self::Backend
fn to_backend(&self) -> Self::Backend
Convert to a backend value