Salsa.start

Initialize the cipher.

struct Salsa(uint rounds = 20, bool xsalsa = false)
@nogc nothrow
void
start
nothrow @nogc
(
,
in ubyte[] key
,
in ubyte[] iv
)
in { static if (xsalsa) { assert (key.length == 32, "XSalsa requires a 256 bit key."); assert (iv.length == 24, "XSalsa needs a 192 bit nonce."); } else { assert (key.length == 16 || key.length == 32, "Salsa20 needs 128 or 256 bit keys."); assert (iv.length == 8, "Salsa20 needs a 8 byte IV."); } }
if (
rounds == 12 ||
rounds == 20
)

Parameters

forEncryption
Type: bool

Not used because encryption and decryption is actually the same.

key
Type: ubyte[]

secret key

iv
Type: ubyte[]

Use a unique nonce per key.

Meta