ChaCha20

Implementation of the ChaCha stream cipher as first described by D. J. Bernstein (http://cr.yp.to/chacha.html), following RFC 7539.

Standard: RFC 7539

Note: This might not be compatible with BouncyCastle's implementation because that one uses a 64-bit counter.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

processBytes
ubyte[] processBytes(ubyte[] input, ubyte[] output)
reset
deprecated void reset()

Reset the cipher to its initial state. Same as calling start() with same parameters again. Warning: Don't encrypt different data with the same initial state.

returnByte
ubyte returnByte(ubyte input)

Process a single byte.

start
void start(bool forEncryption, ubyte[] key, ubyte[] iv)

Initialize the ChaCha20 stream cipher.

Manifest constants

name
enum name;
Undocumented in source.

Static functions

block
void block(uint[16] inState, uint[16] outState)

Performs the ChaCha block function on inState, result in outState

block
void block(uint[16] inState, ubyte[16 * 4] outState)

Performs the ChaCha block function on inState, result in outState

initState
void initState(uint[16] state, ubyte[] key, uint counter, ubyte[] nonce)

Set the state as follows: state = constants ~ key ~ counter ~ nonce

Meta