Skip to main content

KeyAeadMeta

Trait KeyAeadMeta 

Source
pub trait KeyAeadMeta {
    type NonceSize: ArrayLength<u8>;
    type TagSize: ArrayLength<u8>;

    // Provided method
    fn random_nonce() -> GenericArray<u8, Self::NonceSize> { ... }
}
Expand description

For concrete key types with fixed nonce and tag sizes

Required Associated Types§

Source

type NonceSize: ArrayLength<u8>

The size of the AEAD nonce

Source

type TagSize: ArrayLength<u8>

The size of the AEAD tag

Provided Methods§

Source

fn random_nonce() -> GenericArray<u8, Self::NonceSize>

Available on crate feature getrandom only.

Generate a new random nonce

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C, D> KeyAeadMeta for AesKey<AesCbcHmac<C, D>>
where AesCbcHmac<C, D>: AesType, C: BlockCipher + KeyInit,

Available on crate feature aes only.
Source§

impl<C> KeyAeadMeta for AesKey<AesKeyWrap<C>>
where AesKeyWrap<C>: AesType,

Available on crate feature aes only.
Source§

impl<T: AeadCore + AesType> KeyAeadMeta for AesKey<T>

Available on crate feature aes only.
Source§

impl<T: Chacha20Type> KeyAeadMeta for Chacha20Key<T>

Available on crate feature chacha only.