wire / wire-format / poly1305

Poly1305 one-time MAC

Poly1305 is a one-time MAC (RFC 8439) that authenticates a message using a 256-bit one-time key. The key is split into r (128 bits, clamped) and s (128 bits). The message is processed in 16-byte blocks, each interpreted as a little-endian integer and multiplied by r modulo 2^130-5. The final tag is (accumulator + s) mod 2^128.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: Poly1305 one-time MAC

wire format

spec: RFC 8439

Poly1305 is a one-time MAC (RFC 8439) that authenticates a message using a 256-bit one-time key. The key is split into r (128 bits, clamped) and s (128 bits). The message is processed in 16-byte blocks, each interpreted as a little-endian integer and multiplied by r modulo 2^130-5. The final tag is (accumulator + s) mod 2^128.

fieldsizemeaning
One-time key32 bytesr (16 bytes, clamped: r &= 0x0ffffffc0ffffffc0ffffffc0fffffff) + s (16 bytes).
Message block16 bytesEach 16-byte chunk interpreted as a little-endian integer, with a 0x01 byte appended (for the final partial block, pad with zeros then 0x01).
Accumulator17 bytes (136 bits)Running sum mod 2^130-5. Initialized to 0.
Tag16 bytesFinal tag = (accumulator + s) mod 2^128 (low 128 bits).

example:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Poly1305 one-time key (all zeros, for illustration)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/poly1305 or /wire-format/poly1305.json