Skip to main content

StreamPrimitive

Trait StreamPrimitive 

Source
pub trait StreamPrimitive<A>
where A: AeadInOut, A::NonceSize: Sub<Self::NonceOverhead>, NonceSize<A, Self>: ArraySize,
{ type NonceOverhead: ArraySize; type Counter: AddAssign + Copy + Default + Eq; const COUNTER_INCR: Self::Counter; const COUNTER_MAX: Self::Counter; // Required methods fn encrypt_in_place( &self, position: Self::Counter, last_block: bool, associated_data: &[u8], buffer: &mut dyn Buffer, ) -> Result<()>; fn decrypt_in_place( &self, position: Self::Counter, last_block: bool, associated_data: &[u8], buffer: &mut dyn Buffer, ) -> Result<()>; // Provided methods fn encryptor(self) -> Encryptor<A, Self> where Self: Sized { ... } fn decryptor(self) -> Decryptor<A, Self> where Self: Sized { ... } }
Expand description

Low-level STREAM implementation.

This trait provides a particular “flavor” of STREAM, as there are different ways the specifics of the construction can be implemented.

Deliberately immutable and stateless to permit parallel operation.

Required Associated Constants§

Source

const COUNTER_INCR: Self::Counter

Value to use when incrementing the STREAM counter (i.e. one)

Source

const COUNTER_MAX: Self::Counter

Maximum value of the STREAM counter.

Required Associated Types§

Source

type NonceOverhead: ArraySize

Number of bytes this STREAM primitive requires from the nonce.

Source

type Counter: AddAssign + Copy + Default + Eq

Type used as the STREAM counter.

Required Methods§

Source

fn encrypt_in_place( &self, position: Self::Counter, last_block: bool, associated_data: &[u8], buffer: &mut dyn Buffer, ) -> Result<()>

Encrypt an AEAD message in-place at the given position in the STREAM.

Source

fn decrypt_in_place( &self, position: Self::Counter, last_block: bool, associated_data: &[u8], buffer: &mut dyn Buffer, ) -> Result<()>

Decrypt an AEAD message in-place at the given position in the STREAM.

Provided Methods§

Source

fn encryptor(self) -> Encryptor<A, Self>
where Self: Sized,

Obtain Encryptor for this StreamPrimitive.

Source

fn decryptor(self) -> Decryptor<A, Self>
where Self: Sized,

Obtain Decryptor for this StreamPrimitive.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§