Poly1305 (Poly1305 v1.0.4)
View SourcePoly1305 message authentication
Summary
Functions
authenticated encryption with additional data - decryption
authenticated encryption with additional data - encryption
Compute a Message authentication code
compare two HMACs in constant time
Types
Functions
authenticated encryption with additional data - decryption
- encrypted message
- shared secret key
- one-time use nonce
- additional authenticated data
- MAC
On success, returns the plaintext message. If the message cannot be
authenticated :error
is returned.
authenticated encryption with additional data - encryption
- message to be encrypted
- shared secret key
- one-time use nonce
- additional authenticated data
The return value will be a tuple of {ciphertext, MAC}
The algorithm is applied as described in RFC7539:
- The key and nonce are used to encrypt the message with ChaCha20.
- The one-time MAC key is derived from the cipher key and nonce.
- The ciphertext and additional data are authenticated with the MAC
Compute a Message authentication code
The one-time key should never be reused.
compare two HMACs in constant time