| 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
- 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 MD2 Source # | |
| Ord MD2 Source # | |
| Show MD2 Source # | |
| Serialize MD2 Source # | |
| Hash CTXMD2 MD2 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged MD2 BitLength # blockLength :: Tagged MD2 BitLength # initialCtx :: CTXMD2 # updateCtx :: CTXMD2 -> ByteString -> CTXMD2 # finalize :: CTXMD2 -> ByteString -> MD2 # hash :: ByteString -> MD2 # hash' :: ByteString -> MD2 # | |
Instances
| Eq MD4 Source # | |
| Ord MD4 Source # | |
| Show MD4 Source # | |
| Serialize MD4 Source # | |
| Hash CTXMD4 MD4 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged MD4 BitLength # blockLength :: Tagged MD4 BitLength # initialCtx :: CTXMD4 # updateCtx :: CTXMD4 -> ByteString -> CTXMD4 # finalize :: CTXMD4 -> ByteString -> MD4 # hash :: ByteString -> MD4 # hash' :: ByteString -> MD4 # | |
Instances
| Eq MD5 Source # | |
| Ord MD5 Source # | |
| Show MD5 Source # | |
| Serialize MD5 Source # | |
| Hash CTXMD5 MD5 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged MD5 BitLength # blockLength :: Tagged MD5 BitLength # initialCtx :: CTXMD5 # updateCtx :: CTXMD5 -> ByteString -> CTXMD5 # finalize :: CTXMD5 -> ByteString -> MD5 # hash :: ByteString -> MD5 # hash' :: ByteString -> MD5 # | |
Instances
| Eq SHA1 Source # | |
| Ord SHA1 Source # | |
| Show SHA1 Source # | |
| Serialize SHA1 Source # | |
| Hash CTXSHA1 SHA1 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA1 BitLength # blockLength :: Tagged SHA1 BitLength # initialCtx :: CTXSHA1 # updateCtx :: CTXSHA1 -> ByteString -> CTXSHA1 # finalize :: CTXSHA1 -> ByteString -> SHA1 # hash :: ByteString -> SHA1 # hash' :: ByteString -> SHA1 # | |
Instances
| Eq SHA224 Source # | |
| Ord SHA224 Source # | |
| Show SHA224 Source # | |
| Serialize SHA224 Source # | |
| Hash CTXSHA224 SHA224 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA224 BitLength # blockLength :: Tagged SHA224 BitLength # initialCtx :: CTXSHA224 # updateCtx :: CTXSHA224 -> ByteString -> CTXSHA224 # finalize :: CTXSHA224 -> ByteString -> SHA224 # hash :: ByteString -> SHA224 # hash' :: ByteString -> SHA224 # | |
Instances
| Eq SHA256 Source # | |
| Ord SHA256 Source # | |
| Show SHA256 Source # | |
| Serialize SHA256 Source # | |
| Hash CTXSHA256 SHA256 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA256 BitLength # blockLength :: Tagged SHA256 BitLength # initialCtx :: CTXSHA256 # updateCtx :: CTXSHA256 -> ByteString -> CTXSHA256 # finalize :: CTXSHA256 -> ByteString -> SHA256 # hash :: ByteString -> SHA256 # hash' :: ByteString -> SHA256 # | |
Instances
| Eq SHA384 Source # | |
| Ord SHA384 Source # | |
| Show SHA384 Source # | |
| Serialize SHA384 Source # | |
| Hash CTXSHA384 SHA384 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA384 BitLength # blockLength :: Tagged SHA384 BitLength # initialCtx :: CTXSHA384 # updateCtx :: CTXSHA384 -> ByteString -> CTXSHA384 # finalize :: CTXSHA384 -> ByteString -> SHA384 # hash :: ByteString -> SHA384 # hash' :: ByteString -> SHA384 # | |
Instances
| Eq SHA512 Source # | |
| Ord SHA512 Source # | |
| Show SHA512 Source # | |
| Serialize SHA512 Source # | |
| Hash CTXSHA512 SHA512 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA512 BitLength # blockLength :: Tagged SHA512 BitLength # initialCtx :: CTXSHA512 # updateCtx :: CTXSHA512 -> ByteString -> CTXSHA512 # finalize :: CTXSHA512 -> ByteString -> SHA512 # hash :: ByteString -> SHA512 # hash' :: ByteString -> SHA512 # | |
data Skein256_256 Source #
Instances
data Skein512_512 Source #
Instances
Instances
| Eq RIPEMD160 Source # | |
| Ord RIPEMD160 Source # | |
| Show RIPEMD160 Source # | |
| Serialize RIPEMD160 Source # | |
| Hash CTXRIPEMD160 RIPEMD160 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged RIPEMD160 BitLength # blockLength :: Tagged RIPEMD160 BitLength # updateCtx :: CTXRIPEMD160 -> ByteString -> CTXRIPEMD160 # finalize :: CTXRIPEMD160 -> ByteString -> RIPEMD160 # hash :: ByteString -> RIPEMD160 # hash' :: ByteString -> RIPEMD160 # | |
Instances
| Eq Tiger Source # | |
| Ord Tiger Source # | |
| Show Tiger Source # | |
| Serialize Tiger Source # | |
| Hash CTXTiger Tiger Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Tiger BitLength # blockLength :: Tagged Tiger BitLength # initialCtx :: CTXTiger # updateCtx :: CTXTiger -> ByteString -> CTXTiger # finalize :: CTXTiger -> ByteString -> Tiger # hash :: ByteString -> Tiger # hash' :: ByteString -> Tiger # | |
Instances
| Eq Whirlpool Source # | |
| Ord Whirlpool Source # | |
| Show Whirlpool Source # | |
| Serialize Whirlpool Source # | |
| Hash CTXWhirlpool Whirlpool Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Whirlpool BitLength # blockLength :: Tagged Whirlpool BitLength # updateCtx :: CTXWhirlpool -> ByteString -> CTXWhirlpool # finalize :: CTXWhirlpool -> ByteString -> Whirlpool # hash :: ByteString -> Whirlpool # hash' :: ByteString -> Whirlpool # | |
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
Instances
| Hash CTXMD2 MD2 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged MD2 BitLength # blockLength :: Tagged MD2 BitLength # initialCtx :: CTXMD2 # updateCtx :: CTXMD2 -> ByteString -> CTXMD2 # finalize :: CTXMD2 -> ByteString -> MD2 # hash :: ByteString -> MD2 # hash' :: ByteString -> MD2 # | |
Instances
| Hash CTXMD4 MD4 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged MD4 BitLength # blockLength :: Tagged MD4 BitLength # initialCtx :: CTXMD4 # updateCtx :: CTXMD4 -> ByteString -> CTXMD4 # finalize :: CTXMD4 -> ByteString -> MD4 # hash :: ByteString -> MD4 # hash' :: ByteString -> MD4 # | |
Instances
| Hash CTXMD5 MD5 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged MD5 BitLength # blockLength :: Tagged MD5 BitLength # initialCtx :: CTXMD5 # updateCtx :: CTXMD5 -> ByteString -> CTXMD5 # finalize :: CTXMD5 -> ByteString -> MD5 # hash :: ByteString -> MD5 # hash' :: ByteString -> MD5 # | |
data CTXRIPEMD160 Source #
Instances
| Hash CTXRIPEMD160 RIPEMD160 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged RIPEMD160 BitLength # blockLength :: Tagged RIPEMD160 BitLength # updateCtx :: CTXRIPEMD160 -> ByteString -> CTXRIPEMD160 # finalize :: CTXRIPEMD160 -> ByteString -> RIPEMD160 # hash :: ByteString -> RIPEMD160 # hash' :: ByteString -> RIPEMD160 # | |
Instances
| Hash CTXSHA1 SHA1 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA1 BitLength # blockLength :: Tagged SHA1 BitLength # initialCtx :: CTXSHA1 # updateCtx :: CTXSHA1 -> ByteString -> CTXSHA1 # finalize :: CTXSHA1 -> ByteString -> SHA1 # hash :: ByteString -> SHA1 # hash' :: ByteString -> SHA1 # | |
Instances
| Hash CTXSHA224 SHA224 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA224 BitLength # blockLength :: Tagged SHA224 BitLength # initialCtx :: CTXSHA224 # updateCtx :: CTXSHA224 -> ByteString -> CTXSHA224 # finalize :: CTXSHA224 -> ByteString -> SHA224 # hash :: ByteString -> SHA224 # hash' :: ByteString -> SHA224 # | |
Instances
| Hash CTXSHA256 SHA256 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA256 BitLength # blockLength :: Tagged SHA256 BitLength # initialCtx :: CTXSHA256 # updateCtx :: CTXSHA256 -> ByteString -> CTXSHA256 # finalize :: CTXSHA256 -> ByteString -> SHA256 # hash :: ByteString -> SHA256 # hash' :: ByteString -> SHA256 # | |
Instances
| Hash CTXSHA384 SHA384 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA384 BitLength # blockLength :: Tagged SHA384 BitLength # initialCtx :: CTXSHA384 # updateCtx :: CTXSHA384 -> ByteString -> CTXSHA384 # finalize :: CTXSHA384 -> ByteString -> SHA384 # hash :: ByteString -> SHA384 # hash' :: ByteString -> SHA384 # | |
Instances
| Hash CTXSHA512 SHA512 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged SHA512 BitLength # blockLength :: Tagged SHA512 BitLength # initialCtx :: CTXSHA512 # updateCtx :: CTXSHA512 -> ByteString -> CTXSHA512 # finalize :: CTXSHA512 -> ByteString -> SHA512 # hash :: ByteString -> SHA512 # hash' :: ByteString -> SHA512 # | |
data CTXSkein256_256 Source #
Instances
| Hash CTXSkein256_256 Skein256_256 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Skein256_256 BitLength # blockLength :: Tagged Skein256_256 BitLength # initialCtx :: CTXSkein256_256 # updateCtx :: CTXSkein256_256 -> ByteString -> CTXSkein256_256 # finalize :: CTXSkein256_256 -> ByteString -> Skein256_256 # hash :: ByteString -> Skein256_256 # hash' :: ByteString -> Skein256_256 # | |
data CTXSkein512_512 Source #
Instances
| Hash CTXSkein512_512 Skein512_512 Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Skein512_512 BitLength # blockLength :: Tagged Skein512_512 BitLength # initialCtx :: CTXSkein512_512 # updateCtx :: CTXSkein512_512 -> ByteString -> CTXSkein512_512 # finalize :: CTXSkein512_512 -> ByteString -> Skein512_512 # hash :: ByteString -> Skein512_512 # hash' :: ByteString -> Skein512_512 # | |
Instances
| Hash CTXTiger Tiger Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Tiger BitLength # blockLength :: Tagged Tiger BitLength # initialCtx :: CTXTiger # updateCtx :: CTXTiger -> ByteString -> CTXTiger # finalize :: CTXTiger -> ByteString -> Tiger # hash :: ByteString -> Tiger # hash' :: ByteString -> Tiger # | |
data CTXWhirlpool Source #
Instances
| Hash CTXWhirlpool Whirlpool Source # | |
Defined in Crypto.Hash.CryptoAPI Methods outputLength :: Tagged Whirlpool BitLength # blockLength :: Tagged Whirlpool BitLength # updateCtx :: CTXWhirlpool -> ByteString -> CTXWhirlpool # finalize :: CTXWhirlpool -> ByteString -> Whirlpool # hash :: ByteString -> Whirlpool # hash' :: ByteString -> Whirlpool # | |