Trait noise_protocol::Cipher [] [src]

pub trait Cipher {
    type Key: U8Array;
    fn name() -> &'static str;
    fn encrypt(
        k: &Self::Key,
        nonce: u64,
        ad: &[u8],
        plaintext: &[u8],
        out: &mut [u8]
    ); fn decrypt(
        k: &Self::Key,
        nonce: u64,
        ad: &[u8],
        ciphertext: &[u8],
        out: &mut [u8]
    ) -> Result<(), ()>; fn key_len() -> usize { ... } fn tag_len() -> usize { ... } }

An AEAD.

Associated Types

Type of key.

Required Methods

Name of this cipher function.

AEAD encryption.

out.len() == plaintext.len() + Self::tag_len()

AEAD decryption.

out.len() == ciphertext.len() - Self::tag_len()

Provided Methods

Length of key.

Length of auth tag.

All ciphers specified in the spec has tag length 16.

Implementors