Crypto.MAC.Poly1305

cryptonite-0.20: Cryptography Primitives sink

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Crypto.MAC.Poly1305

Contents

- Incremental MAC Functions
- One-pass MAC function

Description

Poly1305 implementation

Synopsis

- type Ctx = State
- data State
- newtype Auth = Auth Bytes
- authTag :: ByteArrayAccess b => b -> CryptoFailable Auth
- initialize :: ByteArrayAccess key => key -> CryptoFailable State
- update :: ByteArrayAccess ba => State -> ba -> State
- updates :: ByteArrayAccess ba => State -> [ba] -> State
- finalize :: State -> Auth
- auth :: (ByteArrayAccess key, ByteArrayAccess ba) => key -> ba -> Auth

# Documentation

type Ctx = State #

Deprecated: use Poly1305 State instead

Poly1305 State. use State instead of Ctx

data State #

Poly1305 State

Instances

ByteArrayAccess State # |
Methods length :: State -> Int # withByteArray :: State -> (Ptr p -> IO a) -> IO a #

newtype Auth #

Poly1305 Auth

Constructors

Auth Bytes |

Instances

Eq Auth # |
Methods (==) :: Auth -> Auth -> Bool # (/=) :: Auth -> Auth -> Bool #
NFData Auth # |
Methods rnf :: Auth -> () #
ByteArrayAccess Auth # |
Methods length :: Auth -> Int # withByteArray :: Auth -> (Ptr p -> IO a) -> IO a #

authTag :: ByteArrayAccess b => b -> CryptoFailable Auth #

# Incremental MAC Functions

initialize :: ByteArrayAccess key => key -> CryptoFailable State #

initialize a Poly1305 context

update :: ByteArrayAccess ba => State -> ba -> State #

update a context with a bytestring

updates :: ByteArrayAccess ba => State -> [ba] -> State #

updates a context with multiples bytestring

finalize :: State -> Auth #

finalize the context into a digest bytestring

# One-pass MAC function

auth :: (ByteArrayAccess key, ByteArrayAccess ba) => key -> ba -> Auth #

One-pass authorization creation