crypto_stream_salsa20()
function stores clen
pseudo random bytes into c
using a nonce n
(crypto_stream_salsa20_NONCEBYTES
bytes) and a secret key k
(crypto_stream_salsa20_KEYBYTES
bytes).crypto_stream_salsa20_xor()
function encrypts a message m
of length mlen
using a nonce n
(crypto_stream_salsa20_NONCEBYTES
bytes) and a secret key k
(crypto_stream_salsa20_KEYBYTES
bytes).c
. The ciphertext is the message combined with the output of the stream cipher using the XOR operation, and doesn't include any authentication tag.m
and c
can point to the same address (in-place encryption/decryption). If they don't, the regions should not overlap.crypto_stream_salsa20_xor_ic()
function is similar to crypto_stream_salsa20_xor()
but adds the ability to set the initial value of the block counter to a non-zero value, ic
.m
and c
can point to the same address (in-place encryption/decryption). If they don't, the regions should not overlap.k
.randombytes_buf()
but improves code clarity and can prevent misuse by ensuring that the provided key length is always be correct.crypto_stream_salsa20_KEYBYTES
crypto_stream_salsa20_NONCEBYTES