[][src]Struct miscreant::stream::Decryptor

pub struct Decryptor<A: Aead> { /* fields omitted */ }

A STREAM decryptor with a 32-bit counter, generalized for any AEAD algorithm

This corresponds to the 𝒟 stream decryptor object as defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance

Implementations

impl<A: Aead> Decryptor<A>[src]

pub fn new(key: &[u8], nonce: &[u8]) -> Self[src]

Create a new STREAM decryptor, initialized with a given key and nonce.

Panics if the key or nonce is the wrong size.

pub fn decrypt_next_in_place<'a>(
    &mut self,
    ad: &[u8],
    buffer: &'a mut [u8]
) -> Result<&'a [u8], Error>
[src]

Decrypt the next message in the stream in-place

pub fn decrypt_last_in_place<'a>(
    self,
    ad: &[u8],
    buffer: &'a mut [u8]
) -> Result<&'a [u8], Error>
[src]

Decrypt the final message in-place, consuming the stream decryptor

pub fn decrypt_next(
    &mut self,
    ad: &[u8],
    ciphertext: &[u8]
) -> Result<Vec<u8>, Error>
[src]

Decrypt the next message in the stream, allocating and returning a Vec<u8> for the plaintext

pub fn decrypt_last(
    self,
    ad: &[u8],
    ciphertext: &[u8]
) -> Result<Vec<u8>, Error>
[src]

Decrypt the next message in the stream, allocating and returning a Vec<u8> for the plaintext

Auto Trait Implementations

impl<A> RefUnwindSafe for Decryptor<A> where
    A: RefUnwindSafe

impl<A> Send for Decryptor<A> where
    A: Send

impl<A> Sync for Decryptor<A> where
    A: Sync

impl<A> Unpin for Decryptor<A> where
    A: Unpin

impl<A> UnwindSafe for Decryptor<A> where
    A: UnwindSafe

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.