Trait aead::stream::StreamPrimitive [−][src]
stream
only.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.
Associated Types
type NonceOverhead: ArrayLength<u8>
[src]
Number of bytes this STREAM primitive requires from the nonce.
type Counter: AddAssign + Copy + Default + Eq
[src]
Type used as the STREAM counter.
Associated Constants
const COUNTER_INCR: Self::Counter
[src]
Value to use when incrementing the STREAM counter (i.e. one)
const COUNTER_MAX: Self::Counter
[src]
Maximum value of the STREAM counter.
Required methods
fn encrypt_in_place(
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
Encrypt an AEAD message in-place at the given position in the STREAM.
fn decrypt_in_place(
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
Decrypt an AEAD message in-place at the given position in the STREAM.
Provided methods
fn encrypt<'msg, 'aad>(
&self,
position: Self::Counter,
last_block: bool,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&self,
position: Self::Counter,
last_block: bool,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
alloc
only.Encrypt the given plaintext payload, and return the resulting ciphertext as a vector of bytes.
fn decrypt<'msg, 'aad>(
&self,
position: Self::Counter,
last_block: bool,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&self,
position: Self::Counter,
last_block: bool,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
alloc
only.Decrypt the given ciphertext slice, and return the resulting plaintext as a vector of bytes.
fn encryptor(self) -> Encryptor<A, Self> where
Self: Sized,
[src]
Self: Sized,
Obtain Encryptor
for this StreamPrimitive
.
fn decryptor(self) -> Decryptor<A, Self> where
Self: Sized,
[src]
Self: Sized,
Obtain Decryptor
for this StreamPrimitive
.
Implementors
impl<A> StreamPrimitive<A> for StreamBE32<A> where
A: AeadInPlace,
A::NonceSize: Sub<U5>,
<<A as AeadCore>::NonceSize as Sub<U5>>::Output: ArrayLength<u8>,
[src]
A: AeadInPlace,
A::NonceSize: Sub<U5>,
<<A as AeadCore>::NonceSize as Sub<U5>>::Output: ArrayLength<u8>,
type NonceOverhead = U5
type Counter = u32
const COUNTER_INCR: u32
[src]
const COUNTER_MAX: u32
[src]
fn encrypt_in_place(
&self,
position: u32,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
position: u32,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
fn decrypt_in_place(
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
impl<A> StreamPrimitive<A> for StreamLE31<A> where
A: AeadInPlace,
A::NonceSize: Sub<U4>,
<<A as AeadCore>::NonceSize as Sub<U4>>::Output: ArrayLength<u8>,
[src]
A: AeadInPlace,
A::NonceSize: Sub<U4>,
<<A as AeadCore>::NonceSize as Sub<U4>>::Output: ArrayLength<u8>,
type NonceOverhead = U4
type Counter = u32
const COUNTER_INCR: u32
[src]
const COUNTER_MAX: u32
[src]
fn encrypt_in_place(
&self,
position: u32,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
position: u32,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
fn decrypt_in_place(
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
position: Self::Counter,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>