pub struct Encryptor<A, S>where
A: AeadInOut,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArraySize,{ /* private fields */ }Expand description
Stateful STREAM object which can encrypt AEAD messages one-at-a-time.
This corresponds to the ℰ STREAM encryptor object as defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance.
Implementations§
Source§impl<A, S> Encryptor<A, S>where
A: AeadInOut,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArraySize,
impl<A, S> Encryptor<A, S>where
A: AeadInOut,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArraySize,
Sourcepub fn new(key: &Key<A>, nonce: &Nonce<A, S>) -> Self
pub fn new(key: &Key<A>, nonce: &Nonce<A, S>) -> Self
Create a ℰ STREAM encryptor object from the given AEAD key and nonce.
Sourcepub fn from_aead(aead: A, nonce: &Nonce<A, S>) -> Selfwhere
S: NewStream<A>,
pub fn from_aead(aead: A, nonce: &Nonce<A, S>) -> Selfwhere
S: NewStream<A>,
Create a ℰ STREAM encryptor object from the given AEAD primitive.
Sourcepub fn from_stream_primitive(stream: S) -> Self
pub fn from_stream_primitive(stream: S) -> Self
Create a ℰ STREAM encryptor object from the given STREAM primitive.
Trait Implementations§
Auto Trait Implementations§
impl<A, S> Freeze for Encryptor<A, S>where
<<A as AeadCore>::NonceSize as Sub<<S as StreamPrimitive<A>>::NonceOverhead>>::Output: Sized,
S: Freeze,
<S as StreamPrimitive<A>>::Counter: Freeze,
impl<A, S> RefUnwindSafe for Encryptor<A, S>where
<<A as AeadCore>::NonceSize as Sub<<S as StreamPrimitive<A>>::NonceOverhead>>::Output: Sized,
S: RefUnwindSafe,
<S as StreamPrimitive<A>>::Counter: RefUnwindSafe,
impl<A, S> Send for Encryptor<A, S>where
<<A as AeadCore>::NonceSize as Sub<<S as StreamPrimitive<A>>::NonceOverhead>>::Output: Sized,
S: Send,
<S as StreamPrimitive<A>>::Counter: Send,
impl<A, S> Sync for Encryptor<A, S>where
<<A as AeadCore>::NonceSize as Sub<<S as StreamPrimitive<A>>::NonceOverhead>>::Output: Sized,
S: Sync,
<S as StreamPrimitive<A>>::Counter: Sync,
impl<A, S> Unpin for Encryptor<A, S>where
<<A as AeadCore>::NonceSize as Sub<<S as StreamPrimitive<A>>::NonceOverhead>>::Output: Sized,
S: Unpin,
<S as StreamPrimitive<A>>::Counter: Unpin,
impl<A, S> UnwindSafe for Encryptor<A, S>where
<<A as AeadCore>::NonceSize as Sub<<S as StreamPrimitive<A>>::NonceOverhead>>::Output: Sized,
S: UnwindSafe,
<S as StreamPrimitive<A>>::Counter: UnwindSafe,
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