Function sodiumoxide::crypto::secretbox::xsalsa20poly1305::open
[−]
[src]
pub fn open(c: &[u8], Nonce: &Nonce, Key: &Key) -> Result<Vec<u8>, ()>
open()
verifies and decrypts a ciphertext c
using a secret key k
and a nonce n
.
It returns a plaintext Ok(m)
.
If the ciphertext fails verification, open()
returns Err(())
.