Function sodiumoxide::crypto::secretbox::xsalsa20poly1305::open [−][src]
pub fn open(c: &[u8], n: &Nonce, k: &Key) -> Result<Vec<u8>, ()>
Expand description
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(())
.