pub struct Decryptor<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 decrypt AEAD messages one-at-a-time.
This corresponds to the ๐ STREAM decryptor object as defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance.
Implementationsยง
Sourceยงimpl<A, S> Decryptor<A, S>where
A: AeadInOut,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArraySize,
impl<A, S> Decryptor<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 decryptor 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 decryptor 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 decryptor object from the given STREAM primitive.
Trait Implementationsยง
Auto Trait Implementationsยง
impl<A, S> Freeze for Decryptor<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 Decryptor<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 Decryptor<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 Decryptor<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 Decryptor<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 Decryptor<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