cryptonite-0.29: Cryptography Primitives sink
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Crypto.MAC.Poly1305

Description

Poly1305 implementation

Synopsis

Documentation

type Ctx = State #

Deprecated: use Poly1305 State instead

Poly1305 State. use State instead of Ctx

data State #

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 # 
Instance details

Defined in Crypto.MAC.Poly1305

Methods

length :: State -> Int #

withByteArray :: State -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: State -> Ptr p -> IO () #

newtype Auth #

Poly1305 Auth

Constructors

Auth Bytes 

Instances

Instances details
Eq Auth # 
Instance details

Defined in Crypto.MAC.Poly1305

Methods

(==) :: Auth -> Auth -> Bool #

(/=) :: Auth -> Auth -> Bool #

NFData Auth # 
Instance details

Defined in Crypto.MAC.Poly1305

Methods

rnf :: Auth -> () #

ByteArrayAccess Auth # 
Instance details

Defined in Crypto.MAC.Poly1305

Methods

length :: Auth -> Int #

withByteArray :: Auth -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: Auth -> Ptr p -> IO () #

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