ddn.crypto.mac.poly1305

Poly1305 Message Authentication Code (RFC 7539).

class Poly1305

Types 1

classPoly1305 : MAC

Poly1305 Implementation.

One-time authenticator. Requires a 32-byte key (r, s).

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).

Fields
private BigInt _r
private BigInt _s
private BigInt _a
private BigInt _p
private ubyte[] _buffer
private bool _initialized
Methods
void initialize(const(ubyte)[] key)Initializes (or re-initializes) the Poly1305 MAC with the given key.
size_t size() @property const
void reset()
MAC update(const(ubyte)[] input)
ubyte[] finish()
private void processBlock(const(ubyte)[] block)
private BigInt bytesToBigIntLE(const(ubyte)[] bytes)
Constructors
this(Key key)Constructs a Poly1305 MAC with the given key.