[][src]Function monocypher::aead::lock::aead

pub fn aead(
    plain_text: &[u8],
    key: [u8; 32],
    nonce: [u8; 24],
    ad: &[u8]
) -> (Vec<u8>, [u8; 16])

Encrypt and authenticate plaintext with additional data.

Example

use monocypher::aead::lock::aead;

let plaintext = "plaintext";
let key = [137u8; 32];
let nonce = [120u8; 24];
let ad = "data";

let cymac = aead(plaintext.as_bytes(), key, nonce, ad.as_bytes());