[][src]Function sodalite::stream_salsa20_xor

pub fn stream_salsa20_xor(
    c_stream: &mut [u8],
    message: Option<&[u8]>,
    nonce: &[u8; 8],
    key: &[u8; 32]
)

Encrypt message into c_text using nonce and key by xoring message with a stream.

As a result, can be used to decrypt by passing encrypted text in message, and reading decrypted text from c_text.

Panics

  • If c_text.len() != message.len()