Poly1305
Bernstein's fast one-time authenticator, paired with ChaCha20 in RFC 8439
Overview
Poly1305 is a one-time message authentication code designed by Daniel J. Bernstein. Combined with ChaCha20 in the ChaCha20-Poly1305 AEAD, it is one of the two dominant authenticated-encryption constructions on the internet alongside AES-GCM.
Poly1305 evaluates a polynomial over the prime field modulo 2^130 − 5. The message is split into 16-byte chunks, each extended with a 1 bit, and the polynomial with these chunks as coefficients is evaluated at a secret point r, with certain bits of r clamped to zero for efficient implementation. A second secret s is added to the result modulo 2^128 to produce a 16-byte tag.
The pair (r, s) must be used for only one message. In ChaCha20-Poly1305 a fresh key pair is derived for each message from the first ChaCha20 keystream block. Poly1305 was originally published in 2005 with AES generating s; RFC 8439 standardises it with ChaCha20. It is constant-time when implemented carefully.
History
2005–2018Poly1305-AES published by Daniel J. Bernstein
ChaCha20-Poly1305 specified in RFC 7539
Updated in RFC 8439
Security notes
Poly1305 is secure only if each key is used once. Reusing a key for two messages allows forgeries. Within AEAD constructions with unique nonces this holds automatically.
Typical uses
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| Poly1305 poly1305 |
standard | key 32 · tag 16 | RFC 8439 | safe |
Frequently asked questions
Which Poly1305 variants does NextSSL include?
NextSSL registers 1 Poly1305 variant: poly1305.
Other message authentication codes
All 30Related
ARX stream cipher with a one-time Poly1305 MAC; fast and constant-time in software
AES-GMACThe authentication-only mode of AES-GCM: a nonce-based MAC from GHASH and AES
GHASHThe GF(2^128) polynomial hash at the core of AES-GCM and GMAC
ChaChaBernstein's ARX stream cipher; ChaCha20 secures much of today's TLS, SSH and VPN traffic
Salsa20Bernstein's eSTREAM-portfolio ARX stream cipher and the core of scrypt and NaCl