ddn.crypto.cipher.chacha
ChaCha20 Stream Cipher (RFC 7539).
class ChaCha20
Types 1
ChaCha20 Implementation.
Supports 32-byte keys. Supports 12-byte nonce (RFC 7539) and 8-byte nonce (Legacy).
Fields
private uint[16] _stateprivate uint[16] _initialStateprivate ubyte[64] _keystreamprivate size_t _keystreamIdxprivate bool _initializedprivate bool _isRFC7539private uint[4] SIGMAMethods
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)private
uint readU32(const(ubyte)[] data, size_t offset)