pub struct StreamLE31<A>where
A: AeadInPlace,
A::NonceSize: Sub<U4>,
<<A as AeadCore>::NonceSize as Sub<U4>>::Output: ArrayLength<u8>,{ /* private fields */ }Available on crate feature
stream only.Expand description
STREAM as instantiated with a 31-bit little endian counter and 1-bit “last block” flag stored as the most significant bit of the counter when interpreted as a 32-bit integer.
The 31-bit + 1-bit value is stored as the last 4 bytes of the AEAD nonce.
Trait Implementations§
Source§impl<A> NewStream<A> for StreamLE31<A>
impl<A> NewStream<A> for StreamLE31<A>
Source§impl<A> StreamPrimitive<A> for StreamLE31<A>
impl<A> StreamPrimitive<A> for StreamLE31<A>
Source§const COUNTER_INCR: u32 = 1u32
const COUNTER_INCR: u32 = 1u32
Value to use when incrementing the STREAM counter (i.e. one)
Source§const COUNTER_MAX: u32 = 268_435_455u32
const COUNTER_MAX: u32 = 268_435_455u32
Maximum value of the STREAM counter.
Source§type NonceOverhead = UInt<UInt<UInt<UTerm, B1>, B0>, B0>
type NonceOverhead = UInt<UInt<UInt<UTerm, B1>, B0>, B0>
Number of bytes this STREAM primitive requires from the nonce.
Source§fn encrypt_in_place(
&self,
position: u32,
last_block: bool,
associated_data: &[u8],
buffer: &mut dyn Buffer,
) -> Result<()>
fn encrypt_in_place( &self, position: u32, 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<()>
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.
Source§fn encrypt<'msg, 'aad>(
&self,
position: Self::Counter,
last_block: bool,
plaintext: impl Into<Payload<'msg, 'aad>>,
) -> Result<Vec<u8>>
fn encrypt<'msg, 'aad>( &self, position: Self::Counter, last_block: bool, plaintext: impl Into<Payload<'msg, 'aad>>, ) -> Result<Vec<u8>>
Available on crate feature
alloc only.Encrypt the given plaintext payload, and return the resulting
ciphertext as a vector of bytes.
Source§fn decrypt<'msg, 'aad>(
&self,
position: Self::Counter,
last_block: bool,
ciphertext: impl Into<Payload<'msg, 'aad>>,
) -> Result<Vec<u8>>
fn decrypt<'msg, 'aad>( &self, position: Self::Counter, last_block: bool, ciphertext: impl Into<Payload<'msg, 'aad>>, ) -> Result<Vec<u8>>
Available on crate feature
alloc only.Decrypt the given ciphertext slice, and return the resulting plaintext
as a vector of bytes.
Auto Trait Implementations§
impl<A> Freeze for StreamLE31<A>
impl<A> RefUnwindSafe for StreamLE31<A>
impl<A> Send for StreamLE31<A>
impl<A> Sync for StreamLE31<A>
impl<A> Unpin for StreamLE31<A>
impl<A> UnwindSafe for StreamLE31<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more