License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell98 |
Crypto.Hash.CryptoAPI
Contents
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.
- data MD2
- data MD4
- data MD5
- data SHA1
- data SHA224
- data SHA256
- data SHA384
- data SHA512
- data Skein256_256
- data Skein512_512
- data RIPEMD160
- data Tiger
- data Whirlpool
- class (Serialize d, Eq d, Ord d) => Hash ctx d | d -> ctx, ctx -> d where
- outputLength :: Tagged * d BitLength
- blockLength :: Tagged * d BitLength
- initialCtx :: ctx
- updateCtx :: ctx -> ByteString -> ctx
- finalize :: ctx -> ByteString -> d
- hash :: ByteString -> d
- hash' :: ByteString -> d
- data CTXMD2
- data CTXMD4
- data CTXMD5
- data CTXRIPEMD160
- data CTXSHA1
- data CTXSHA224
- data CTXSHA256
- data CTXSHA384
- data CTXSHA512
- data CTXSkein256_256
- data CTXSkein512_512
- data CTXTiger
- data CTXWhirlpool
Documentation
data Skein256_256 Source
data Skein512_512 Source
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
.
Minimal complete definition
Methods
Arguments
:: Tagged * d BitLength | The amount of data operated on in each round of the digest computation |
Arguments
:: ctx | An initial context, provided with the first call to |
Arguments
:: ctx | |
-> ByteString | |
-> ctx | Used to update a context, repeatedly called until all data is exhausted
must operate correctly for imputs of |
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
Instances
Contexts
data CTXRIPEMD160 Source
Instances
data CTXSkein256_256 Source
Instances
data CTXSkein512_512 Source
Instances
data CTXWhirlpool Source
Instances