crypton-0.33: Cryptography Primitives sink

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
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 Source #

Deprecated: use Poly1305 State instead

Poly1305 State. use State instead of Ctx

data State Source #

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

Instances details

ByteArrayAccess State Source # |
Instance details Defined in Crypto.MAC.Poly1305 Methods length :: State -> Int Source # withByteArray :: State -> (Ptr p -> IO a) -> IO a Source # copyByteArrayToPtr :: State -> Ptr p -> IO () Source #

newtype Auth Source #

Poly1305 Auth

Constructors

Auth Bytes |

#### Instances

Instances details

NFData Auth Source # |
Instance details Defined in Crypto.MAC.Poly1305 Methods rnf :: Auth -> () Source #
Eq Auth Source # |
Instance details Defined in Crypto.MAC.Poly1305 Methods (==) :: Auth -> Auth -> Bool Source # (/=) :: Auth -> Auth -> Bool Source #
ByteArrayAccess Auth Source # |
Instance details Defined in Crypto.MAC.Poly1305 Methods length :: Auth -> Int Source # withByteArray :: Auth -> (Ptr p -> IO a) -> IO a Source # copyByteArrayToPtr :: Auth -> Ptr p -> IO () Source #

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

# Incremental MAC Functions

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

initialize a Poly1305 context

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

update a context with a bytestring

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

updates a context with multiples bytestring

finalize :: State -> Auth Source #

finalize the context into a digest bytestring

# One-pass MAC function

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

One-pass authorization creation