[][src]Function monocypher::aead::unlock::easy

pub fn easy(
    cipher_text: &[u8],
    key: [u8; 32],
    nonce: [u8; 24],
    mac: [u8; 16]
) -> Result<Vec<u8>, String>

Decrypt encrypted data.

Example

use monocypher::aead::{lock, unlock};

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

let cymac = lock::easy(plaintext.as_bytes(), key, nonce);
unlock::easy(&cymac.0, key, nonce, cymac.1).unwrap();