Trait cryptraits::aead::Aead

source ·
pub trait Aead: Zeroize {
    type E: Error;

    const NONCE_LEN: usize;

    fn new(key: &[u8]) -> Self;
    fn encrypt(
        &self,
        nonce: &[u8],
        data: &[u8],
        aad: Option<&[u8]>
    ) -> Result<Vec<u8>, Self::E>; fn decrypt(
        &self,
        nonce: &[u8],
        data: &[u8],
        aad: Option<&[u8]>
    ) -> Result<Vec<u8>, Self::E>; }
Expand description

Trait represents AEAD cipher.

Required Associated Types§

AEAD Error type.

Required Associated Constants§

Nonce length in bytes.

Required Methods§

Creates a new cipher instance.

Encrypts data with nonce.

Decrypts data with nonce.

Implementors§