[][src]Struct aes_siv::SivAead

pub struct SivAead<C, M> where
    C: NewStreamCipher<NonceSize = U16> + SyncStreamCipher,
    M: Mac<OutputSize = U16>, 
{ /* fields omitted */ }

The SivAead type wraps the more powerful Siv interface in a more commonly used Authenticated Encryption with Associated Data (AEAD) API, which accepts a key, nonce, and associated data when encrypting/decrypting.

Methods

impl<C, M> SivAead<C, M> where
    C: NewStreamCipher<NonceSize = U16> + SyncStreamCipher,
    M: Mac<OutputSize = U16>, 
[src]

pub fn encrypt_in_place(
    &mut self,
    nonce: &GenericArray<u8, Self::NonceSize>,
    associated_data: &[u8],
    buffer: &mut [u8]
)
[src]

Encrypt the given message in-place

pub fn decrypt_in_place<'a>(
    &mut self,
    nonce: &GenericArray<u8, Self::NonceSize>,
    associated_data: &[u8],
    buffer: &'a mut [u8]
) -> Result<&'a [u8], Error>
[src]

Decrypt the given message in-place

Trait Implementations

impl<M> NewAead for SivAead<Ctr128<Aes128>, M> where
    M: Mac<OutputSize = U16>, 
[src]

type KeySize = U32

The size of the key array required by this algorithm.

impl<M> NewAead for SivAead<Ctr128<Aes256>, M> where
    M: Mac<OutputSize = U16>, 
[src]

type KeySize = U64

The size of the key array required by this algorithm.

impl<C, M> AeadMut for SivAead<C, M> where
    C: NewStreamCipher<NonceSize = U16> + SyncStreamCipher,
    M: Mac<OutputSize = U16>, 
[src]

type NonceSize = U16

The length of a nonce.

type TagSize = U16

The maximum length of the nonce.

type CiphertextOverhead = U0

The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more

Auto Trait Implementations

impl<C, M> Unpin for SivAead<C, M> where
    M: Unpin,
    <<C as NewStreamCipher>::KeySize as ArrayLength<u8>>::ArrayType: Unpin

impl<C, M> Send for SivAead<C, M> where
    M: Send,
    <C as NewStreamCipher>::KeySize: ArrayLength<u8>, 

impl<C, M> Sync for SivAead<C, M> where
    M: Sync,
    <C as NewStreamCipher>::KeySize: ArrayLength<u8>, 

Blanket Implementations

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

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> Into<U> for T where
    U: From<T>, 
[src]

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.

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

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

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

impl<Algo> AeadMut for Algo where
    Algo: Aead
[src]

type NonceSize = <Algo as Aead>::NonceSize

The length of a nonce.

type TagSize = <Algo as Aead>::TagSize

The maximum length of the nonce.

type CiphertextOverhead = <Algo as Aead>::CiphertextOverhead

The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more

fn encrypt<'msg, 'aad>(
    &mut self,
    nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
    plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]

Encrypt the given plaintext slice, and return the resulting ciphertext as a vector of bytes.

fn decrypt<'msg, 'aad>(
    &mut self,
    nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
    ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]

Decrypt the given ciphertext slice, and return the resulting plaintext as a vector of bytes.

impl<T> Same<T> for T

type Output = T

Should always be Self