Type Definition crypto::ciphers::chacha::XChaCha20Poly1305[][src]

type XChaCha20Poly1305 = XChaCha20Poly1305;
This is supported on crate feature chacha only.

Trait Implementations

impl Aead for XChaCha20Poly1305[src]

type KeyLength = U32

The size of the key required by this algorithm.

type NonceLength = U24

The size of the nonce required by this algorithm.

type TagLength = U16

The size of the tag produced by this algorithm.

fn encrypt(
    key: &Key<Self>,
    nonce: &Nonce<Self>,
    associated_data: &[u8],
    plaintext: &[u8],
    ciphertext: &mut [u8],
    tag: &mut Tag<Self>
) -> Result<()>
[src]

Warning: type conversions on the tag type can be tricky. instead of &mut tag.try_into().unwrap() use (&mut tag).try_into().unwrap()