[][src]Struct aes_ccm::AesCcm

pub struct AesCcm<Aes, TagSize> where
    Aes: BlockCipher<BlockSize = U16>,
    Aes::ParBlocks: ArrayLength<Block<Aes>>,
    TagSize: CcmTagSize
{ /* fields omitted */ }

The AES-CCM instance.

This is currently fixed to 13-byte nonces (and thus limited to 64KiB messages), and generic over a block cipher type (i.e. for different key sizes or potentially providing a hardware AES implementation) as well as tag sizes.

Trait Implementations

impl<Aes, TagSize> AeadInPlace for AesCcm<Aes, TagSize> where
    Aes: BlockCipher<BlockSize = U16>,
    Aes::ParBlocks: ArrayLength<Block<Aes>>,
    TagSize: CcmTagSize
[src]

type NonceSize = U13

The length of a nonce.

type TagSize = TagSize

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

fn encrypt_in_place_detached(
    &self,
    nonce: &Nonce<U13>,
    associated_data: &[u8],
    payload: &mut [u8]
) -> Result<Tag<Self::TagSize>, Error>
[src]

In-place CCM encryption and generation of detached authentication tag.

fn decrypt_in_place_detached(
    &self,
    nonce: &GenericArray<u8, Self::NonceSize>,
    associated_data: &[u8],
    payload: &mut [u8],
    tag: &GenericArray<u8, TagSize>
) -> Result<(), Error>
[src]

In-place CCM decryption and verification of detached authentication tag.

impl<Aes, TagSize> NewAead for AesCcm<Aes, TagSize> where
    Aes: BlockCipher<BlockSize = U16> + NewBlockCipher,
    Aes::ParBlocks: ArrayLength<Block<Aes>>,
    TagSize: CcmTagSize
[src]

type KeySize = Aes::KeySize

The size of the key array required by this algorithm.

fn new(key: &Key<Self>) -> Self[src]

Creates a new AesCcm.

Auto Trait Implementations

impl<Aes, TagSize> Send for AesCcm<Aes, TagSize> where
    Aes: Send,
    TagSize: Send

impl<Aes, TagSize> Sync for AesCcm<Aes, TagSize> where
    Aes: Sync,
    TagSize: Sync

impl<Aes, TagSize> Unpin for AesCcm<Aes, TagSize> where
    Aes: Unpin,
    TagSize: Unpin

Blanket Implementations

impl<Alg> Aead for Alg where
    Alg: AeadInPlace
[src]

type NonceSize = <Alg as AeadInPlace>::NonceSize

The length of a nonce.

type TagSize = <Alg as AeadInPlace>::TagSize

The maximum length of the nonce.

type CiphertextOverhead = <Alg as AeadInPlace>::CiphertextOverhead

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

impl<Alg> AeadMut for Alg where
    Alg: AeadMutInPlace
[src]

type NonceSize = <Alg as AeadMutInPlace>::NonceSize

The length of a nonce.

type TagSize = <Alg as AeadMutInPlace>::TagSize

The maximum length of the nonce.

type CiphertextOverhead = <Alg as AeadMutInPlace>::CiphertextOverhead

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

impl<Alg> AeadMutInPlace for Alg where
    Alg: AeadInPlace
[src]

type NonceSize = <Alg as AeadInPlace>::NonceSize

The length of a nonce.

type TagSize = <Alg as AeadInPlace>::TagSize

The maximum length of the nonce.

type CiphertextOverhead = <Alg as AeadInPlace>::CiphertextOverhead

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

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.