ddn.crypto.cipher.chacha
ChaCha20 Stream Cipher (RFC 8439).
class ChaCha20
Types 1
ChaCha20 Implementation.
Supports 32-byte keys. Supports 12-byte nonce (RFC 8439) and 8-byte nonce (Legacy).
Fields
private uint[16] _stateprivate uint[16] _initialStateprivate ubyte[64] _keystreamprivate size_t _keystreamIdxprivate bool _initializedprivate bool _isRFC7539private bool _counterExhaustedprivate uint[4] SIGMAMethods
void wipe() nothrow @nogc @trustedZeroizes the cipher state, the initial (key-bearing) state, and any buffered keystream.void initialize(CipherOperation op, SecretKey key,
const(ubyte)[] iv)void init(CipherOperation op, Key key, const(ubyte)[] iv = null)ubyte[] update(const(ubyte)[] input)ubyte[] finish(const(ubyte)[] input = null)void setCounter(ulong counter)Manually sets the counter. Useful for random access or specific protocols. Params: counter = The counter value.private
void generateBlock()private
void quarterRound(int a, int b, int c, int d)Destructors