Function sodiumoxide::crypto::stream::xsalsa20::stream_xor[][src]

pub fn stream_xor(m: &[u8], n: &Nonce, k: &Key) -> Vec<u8>
Expand description

stream_xor() encrypts a message m using a secret key k and a nonce n. The stream_xor() function returns the ciphertext c.

stream_xor() guarantees that the ciphertext has the same length as the plaintext, and is the plaintext xor the output of stream(). Consequently stream_xor() can also be used to decrypt.