cryptohash-cryptoapi-0.1.1: Crypto-api interfaces for cryptohash

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone

Crypto.Hash.CryptoAPI

Description

Cryptohash API exported through crypto-api.

Note: Current version (0.10) of crypto-api suffers a small performance problem. see http://tab.snarc.org/others/benchmark-cryptohash-0.8.html. Hopefully, future versions will fix this.

Synopsis

Documentation

data MD2 Source

Instances

data MD4 Source

Instances

data MD5 Source

Instances

class (Serialize d, Eq d, Ord d) => Hash ctx d | d -> ctx, ctx -> d where

The Hash class is intended as the generic interface targeted by maintainers of Haskell digest implementations. Using this generic interface, higher level functions such as hash and hash' provide a useful API for comsumers of hash implementations.

Any instantiated implementation must handle unaligned data.

Minimum complete definition: outputLength, blockLength, initialCtx, updateCtx, and finalize.

Methods

outputLength

Arguments

:: Tagged * d BitLength

The size of the digest when encoded

blockLength

Arguments

:: Tagged * d BitLength

The amount of data operated on in each round of the digest computation

initialCtx

Arguments

:: ctx

An initial context, provided with the first call to updateCtx

updateCtx

Arguments

:: ctx 
-> ByteString 
-> ctx

Used to update a context, repeatedly called until all data is exhausted must operate correctly for imputs of n*blockLength bytes for n elem [0..]

finalize

Arguments

:: ctx 
-> ByteString 
-> d

Finializing a context, plus any message data less than the block size, into a digest

hash :: ByteString -> d

Hash a lazy ByteString, creating a digest

hash' :: ByteString -> d

Hash a strict ByteString, creating a digest

hash :: (Hash ctx d, Hash ctx d) => ByteString -> d

Hash a lazy ByteString, creating a digest

hash' :: (Hash ctx d, Hash ctx d) => ByteString -> d

Hash a strict ByteString, creating a digest