| 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.
Synopsis
- 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
Instances
| Eq SHA1 Source # | |
| Ord SHA1 Source # | |
| Show SHA1 Source # | |
| Serialize SHA1 Source # | |
| Hash CTXSHA1 SHA1 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Eq SHA224 Source # | |
| Ord SHA224 Source # | |
| Show SHA224 Source # | |
| Serialize SHA224 Source # | |
| Hash CTXSHA224 SHA224 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Eq SHA256 Source # | |
| Ord SHA256 Source # | |
| Show SHA256 Source # | |
| Serialize SHA256 Source # | |
| Hash CTXSHA256 SHA256 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Eq SHA384 Source # | |
| Ord SHA384 Source # | |
| Show SHA384 Source # | |
| Serialize SHA384 Source # | |
| Hash CTXSHA384 SHA384 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Eq SHA512 Source # | |
| Ord SHA512 Source # | |
| Show SHA512 Source # | |
| Serialize SHA512 Source # | |
| Hash CTXSHA512 SHA512 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
data Skein256_256 Source #
Instances
data Skein512_512 Source #
Instances
Instances
| Eq RIPEMD160 Source # | |
| Ord RIPEMD160 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
| Show RIPEMD160 Source # | |
| Serialize RIPEMD160 Source # | |
| Hash CTXRIPEMD160 RIPEMD160 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged RIPEMD160 BitLength Source # blockLength :: Tagged RIPEMD160 BitLength Source # initialCtx :: CTXRIPEMD160 Source # updateCtx :: CTXRIPEMD160 -> ByteString -> CTXRIPEMD160 Source # finalize :: CTXRIPEMD160 -> ByteString -> RIPEMD160 Source # | |
Instances
| Eq Tiger Source # | |
| Ord Tiger Source # | |
| Show Tiger Source # | |
| Serialize Tiger Source # | |
| Hash CTXTiger Tiger Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Eq Whirlpool Source # | |
| Ord Whirlpool Source # | |
Defined in Crypto.Hash.CryptoAPI | |
| Show Whirlpool Source # | |
| Serialize Whirlpool Source # | |
| Hash CTXWhirlpool Whirlpool Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Whirlpool BitLength Source # blockLength :: Tagged Whirlpool BitLength Source # initialCtx :: CTXWhirlpool Source # updateCtx :: CTXWhirlpool -> ByteString -> CTXWhirlpool Source # finalize :: CTXWhirlpool -> ByteString -> Whirlpool Source # | |
class (Serialize d, Eq d, Ord d) => Hash ctx d | d -> ctx, ctx -> d where Source #
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 Source #
Hash a lazy ByteString, creating a digest
hash' :: ByteString -> d Source #
Hash a strict ByteString, creating a digest
Instances
Contexts
data CTXRIPEMD160 Source #
Instances
| Hash CTXRIPEMD160 RIPEMD160 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged RIPEMD160 BitLength Source # blockLength :: Tagged RIPEMD160 BitLength Source # initialCtx :: CTXRIPEMD160 Source # updateCtx :: CTXRIPEMD160 -> ByteString -> CTXRIPEMD160 Source # finalize :: CTXRIPEMD160 -> ByteString -> RIPEMD160 Source # | |
Instances
| Hash CTXSHA1 SHA1 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Hash CTXSHA224 SHA224 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Hash CTXSHA256 SHA256 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Hash CTXSHA384 SHA384 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
Instances
| Hash CTXSHA512 SHA512 Source # | |
Defined in Crypto.Hash.CryptoAPI | |
data CTXSkein256_256 Source #
Instances
| Hash CTXSkein256_256 Skein256_256 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Skein256_256 BitLength Source # blockLength :: Tagged Skein256_256 BitLength Source # initialCtx :: CTXSkein256_256 Source # updateCtx :: CTXSkein256_256 -> ByteString -> CTXSkein256_256 Source # finalize :: CTXSkein256_256 -> ByteString -> Skein256_256 Source # hash :: ByteString -> Skein256_256 Source # hash' :: ByteString -> Skein256_256 Source # | |
data CTXSkein512_512 Source #
Instances
| Hash CTXSkein512_512 Skein512_512 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Skein512_512 BitLength Source # blockLength :: Tagged Skein512_512 BitLength Source # initialCtx :: CTXSkein512_512 Source # updateCtx :: CTXSkein512_512 -> ByteString -> CTXSkein512_512 Source # finalize :: CTXSkein512_512 -> ByteString -> Skein512_512 Source # hash :: ByteString -> Skein512_512 Source # hash' :: ByteString -> Skein512_512 Source # | |
Instances
| Hash CTXTiger Tiger Source # | |
Defined in Crypto.Hash.CryptoAPI | |
data CTXWhirlpool Source #
Instances
| Hash CTXWhirlpool Whirlpool Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Whirlpool BitLength Source # blockLength :: Tagged Whirlpool BitLength Source # initialCtx :: CTXWhirlpool Source # updateCtx :: CTXWhirlpool -> ByteString -> CTXWhirlpool Source # finalize :: CTXWhirlpool -> ByteString -> Whirlpool Source # | |