| License | BSD-style |
|---|---|
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Crypto.MAC.Poly1305
Description
Poly1305 implementation
Synopsis
- type Ctx = State
- data State
- data Key
- key :: ByteArrayAccess ba => ba -> CryptoFailable Key
- newtype Auth = Auth Bytes
- authTag :: ByteArrayAccess b => b -> CryptoFailable Auth
- initialize :: Key -> State
- update :: ByteArrayAccess ba => State -> ba -> State
- updates :: ByteArrayAccess ba => State -> [ba] -> State
- finalize :: State -> Auth
- auth :: ByteArrayAccess ba => Key -> ba -> Auth
Documentation
Deprecated: use Poly1305 State instead
Poly1305 State. use State instead of Ctx
Poly1305 State
This type is an instance of ByteArrayAccess for debugging purpose. Internal
layout is architecture dependent, may contain uninitialized data fragments,
and change in future versions. The bytearray should not be used as input to
cryptographic algorithms.
Instances
A Poly1305 key: thirty-two bytes, and the length is checked here rather
than at every use. initialize and
auth take one of these and cannot fail, so a caller
that holds a key does not carry an error case for a length it already knows
is right.
key :: ByteArrayAccess ba => ba -> CryptoFailable Key Source #
Take thirty-two bytes for a key. A different length is reported as
CryptoError_MacKeyInvalid; nothing else about a key can be wrong.
Poly1305 Auth
authTag :: ByteArrayAccess b => b -> CryptoFailable Auth Source #
Incremental MAC Functions
initialize :: Key -> State Source #
initialize a Poly1305 context
updates :: ByteArrayAccess ba => State -> [ba] -> State Source #
updates a context with multiples bytestring