ddn.crypto.mac.poly1305
Poly1305 Message Authentication Code (RFC 8439).
Side-Channel Status: The accumulator arithmetic runs on fixed 26-bit limbs with a fully unrolled, branch-free block function, so the operation sequence does not depend on the key or the message.
Types 1
Poly1305 Implementation.
One-time authenticator. Requires a 32-byte key (r, s).
The state is kept as five 26-bit limbs (the classic fixed-width representation): the block multiply is an unrolled fixed sequence of multiply-accumulate and carry steps with no data-dependent branches, unlike the previous BigInt-based implementation whose timing followed the values it processed.
Warning: The key (r, s) MUST NOT be reused for different messages. Typically, this key is derived from a master key and a nonce (e.g., in ChaCha20-Poly1305).
private uint[5] _rprivate uint[5] _hprivate uint[4] _sprivate ubyte[16] _bufferprivate size_t _leftoverprivate bool _initializedvoid initialize(SecretKey key)Initializes (or re-initializes) the Poly1305 MAC with the given key.void initialize(const(ubyte)[] key)void reset()ubyte[] finish()void processBlock(const(ubyte)[] block, bool hibit)Processes one 16-byte block into the accumulator.