Copyright | (c) 2025 Jared Tobin |
---|---|
License | MIT |
Maintainer | Jared Tobin <jared@ppad.tech> |
Safe Haskell | None |
Language | Haskell2010 |
Crypto.MAC.Poly1305
Description
A pure Poly1305 MAC implementation, as specified by RFC 8439.
Synopsis
- mac :: ByteString -> ByteString -> Maybe ByteString
Poly1305 message authentication code
Arguments
:: ByteString | 256-bit one-time key |
-> ByteString | arbitrary-length message |
-> Maybe ByteString | 128-bit message authentication code |
Produce a Poly1305 MAC for the provided message, given the provided key.
Per RFC8439: the key, which is essentially a one-time key, should be unique, and MUST be unpredictable for each invocation.
The key must be exactly 256 bits in length.
>>>
mac "i'll never use this key again!!!" "a message needing authentication"
Just "O'\231Z\224\149\148\246\203[}\210\203\b\200\207"