ChaCha.start

Initialize the ChaCha20 stream cipher.

struct ChaCha(uint rounds)
@safe nothrow @nogc
void
start
(,
in ubyte[] key
,
in ubyte[] iv
,
in uint initial_counter = 1
)
if (
rounds % 2 == 0
)

Parameters

forEncryption bool

Not used, because encryption and decryptioin are the same.

key ubyte[]

A secret key of 32 bytes length (256 bit).

iv ubyte[]

A nonce of 12 bytes length (96 bit).

initial_counter uint

The initial value of the counter. The default is 1. (Set this to 2 to skip the first block.)

Meta