Struct aead::stream::Decryptor [−][src]
pub struct Decryptor<A, S> where
A: AeadInPlace,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArrayLength<u8>, { /* fields omitted */ }
stream
only.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
impl<A, S> Decryptor<A, S> where
A: AeadInPlace,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArrayLength<u8>,
[src]
impl<A, S> Decryptor<A, S> where
A: AeadInPlace,
S: StreamPrimitive<A>,
A::NonceSize: Sub<<S as StreamPrimitive<A>>::NonceOverhead>,
NonceSize<A, S>: ArrayLength<u8>,
[src]pub fn new(key: &Key<A>, nonce: &Nonce<A, S>) -> Self where
A: NewAead,
S: NewStream<A>,
[src]
A: NewAead,
S: NewStream<A>,
Create a 𝒟 STREAM decryptor object from the given AEAD key and nonce.
pub fn from_aead(aead: A, nonce: &Nonce<A, S>) -> Self where
A: NewAead,
S: NewStream<A>,
[src]
A: NewAead,
S: NewStream<A>,
Create a 𝒟 STREAM decryptor object from the given AEAD primitive.
pub fn from_stream_primitive(stream: S) -> Self
[src]
Create a 𝒟 STREAM decryptor object from the given STREAM primitive.
pub fn decrypt_next<'msg, 'aad>(
&mut self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
alloc
only.Use the underlying AEAD to
decrypt
the next AEAD message in this STREAM, returning the
result as a Vec
.
pub fn decrypt_next_in_place(
&mut self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&mut self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
Use the underlying AEAD to decrypt the next AEAD message in this STREAM in-place.
pub fn decrypt_last<'msg, 'aad>(
self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
self,
payload: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
alloc
only.Use the underlying AEAD to decrypt the last AEAD message in this STREAM, consuming the 𝒟 STREAM decryptor object in order to prevent further use.
pub fn decrypt_last_in_place(
self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
self,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
Use the underlying AEAD to decrypt the last AEAD message in this STREAM in-place, consuming the 𝒟 STREAM decryptor object in order to prevent further use.
Auto Trait Implementations
impl<A, S> RefUnwindSafe for Decryptor<A, S> where
S: RefUnwindSafe,
<S as StreamPrimitive<A>>::Counter: RefUnwindSafe,
impl<A, S> RefUnwindSafe for Decryptor<A, S> where
S: RefUnwindSafe,
<S as StreamPrimitive<A>>::Counter: RefUnwindSafe,
impl<A, S> UnwindSafe for Decryptor<A, S> where
S: UnwindSafe,
<S as StreamPrimitive<A>>::Counter: UnwindSafe,
impl<A, S> UnwindSafe for Decryptor<A, S> where
S: UnwindSafe,
<S as StreamPrimitive<A>>::Counter: UnwindSafe,