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

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

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.