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 */ }
This is supported on crate feature 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]

pub fn new(key: &Key<A>, nonce: &Nonce<A, S>) -> Self where
    A: NewAead,
    S: NewStream<A>, 
[src]

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]

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]

This is supported on crate feature 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]

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]

This is supported on crate feature 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]

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
[src]

impl<A, S> Send for Decryptor<A, S> where
    S: Send,
    <S as StreamPrimitive<A>>::Counter: Send
[src]

impl<A, S> Sync for Decryptor<A, S> where
    S: Sync,
    <S as StreamPrimitive<A>>::Counter: Sync
[src]

impl<A, S> Unpin for Decryptor<A, S> where
    S: Unpin,
    <S as StreamPrimitive<A>>::Counter: Unpin
[src]

impl<A, S> UnwindSafe for Decryptor<A, S> where
    S: UnwindSafe,
    <S as StreamPrimitive<A>>::Counter: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.