pub struct StreamBE32<A>where
A: AeadInPlace,
A::NonceSize: Sub<U5>,
<<A as AeadCore>::NonceSize as Sub<U5>>::Output: ArrayLength<u8>,{ /* private fields */ }Available on crate feature
stream only.Expand description
The original “Rogaway-flavored” STREAM as described in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance.
Uses a 32-bit big endian counter and 1-byte “last block” flag stored as the last 5-bytes of the AEAD nonce.
Trait Implementations§
Source§impl<A> NewStream<A> for StreamBE32<A>
impl<A> NewStream<A> for StreamBE32<A>
Source§impl<A> StreamPrimitive<A> for StreamBE32<A>
impl<A> StreamPrimitive<A> for StreamBE32<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 = 4_294_967_295u32
const COUNTER_MAX: u32 = 4_294_967_295u32
Maximum value of the STREAM counter.
Source§type NonceOverhead = UInt<UInt<UInt<UTerm, B1>, B0>, B1>
type NonceOverhead = UInt<UInt<UInt<UTerm, B1>, B0>, B1>
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 StreamBE32<A>
impl<A> RefUnwindSafe for StreamBE32<A>
impl<A> Send for StreamBE32<A>
impl<A> Sync for StreamBE32<A>
impl<A> Unpin for StreamBE32<A>
impl<A> UnwindSafe for StreamBE32<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