Skip to Content
oxcrypto

Poly1305

Authenticate one message with Poly1305.

from oxcrypto.universal_hash.poly1305 import POLY1305

one_time_key = POLY1305.POLY1305.generate_key()
tag = POLY1305.POLY1305.mac(one_time_key, b"message")

Poly1305 (RFC 8439) takes a 32-byte one-time key and returns a 16-byte tag. Messages of any length are processed as RFC 8439 specifies, without zero padding.