[][src]Struct eax::Eax

pub struct Eax<C: BlockCipher<BlockSize = U16> + Clone> where
    C::ParBlocks: ArrayLength<GenericArray<u8, U16>>, 
{ /* fields omitted */ }

Methods

impl<C: BlockCipher<BlockSize = U16> + Clone> Eax<C> where
    C::ParBlocks: ArrayLength<GenericArray<u8, U16>>, 
[src]

pub fn encrypt(
    key: &GenericArray<u8, C::KeySize>,
    nonce: &GenericArray<u8, C::KeySize>,
    header: &[u8],
    data: &mut [u8]
) -> GenericArray<u8, <Cmac<C> as Mac>::OutputSize>
[src]

Encrypt and authenticate data.

Arguments

  • key: The key to use for encryption.
  • nonce: The nonce to use for encryption.
  • header: Associated data, which will also be authenticated.
  • data: The data which will be encrypted in-place.

Return value

tag/mac

pub fn decrypt(
    key: &GenericArray<u8, C::KeySize>,
    nonce: &GenericArray<u8, C::KeySize>,
    header: &[u8],
    data: &mut [u8],
    mac: &[u8]
) -> Result<(), MacError>
[src]

Check authentication and decrypt data.

Auto Trait Implementations

impl<C> Send for Eax<C> where
    C: Send

impl<C> Sync for Eax<C> where
    C: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Same for T

type Output = T

Should always be Self