-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | collection of crypto hashes, fast, pure and practical
--   
--   A collection of crypto hashes, with a practical incremental and
--   one-pass, pure APIs, with performance close to the fastest
--   implementations available in others languages.
--   
--   The implementations are made in C with a haskell FFI wrapper that hide
--   the C implementation.
--   
--   Simple examples using the unified API:
--   
--   <pre>
--   import Crypto.Hash
--   
--   sha1 :: ByteString -&gt; Digest SHA1
--   sha1 = hash
--   
--   hexSha3_512 :: ByteString -&gt; String
--   hexSha3_512 bs = show (hash bs :: Digest SHA3_512)
--   </pre>
--   
--   Simple examples using the module API:
--   
--   <pre>
--   import qualified Crypto.Hash.SHA1 as SHA1
--   
--   main = putStrLn $ show $ SHA1.hash (Data.ByteString.pack [1..256])
--   </pre>
--   
--   <pre>
--   import qualified Crypto.Hash.SHA3 as SHA3
--   
--   main = putStrLn $ show $ digest
--     where digest = SHA3.finalize ctx
--           ctx    = foldl' SHA3.update iCtx (map Data.ByteString.pack [ [1,2,3], [4,5,6] ]
--           iCtx   = SHA3.init 224
--   </pre>
@package cryptohash
@version 0.9.0


-- | provide the HMAC (Hash based Message Authentification Code) base
--   algorithm. http:/<i>en.wikipedia.org</i>wiki/HMAC
module Crypto.MAC.HMAC

-- | compute a MAC using the supplied hashing function
hmac :: (ByteString -> ByteString) -> Int -> ByteString -> ByteString -> ByteString


-- | A module containing Whirlpool bindings
module Crypto.Hash.Whirlpool
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.Whirlpool. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data Whirlpool

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq Whirlpool
instance Ord Whirlpool
instance Show Whirlpool
instance Serialize Whirlpool
instance Hash Ctx Whirlpool


-- | A module containing Skein512 bindings
module Crypto.Hash.Skein512
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.Skein512. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data Skein512

-- | init a context
init :: Int -> Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: Int -> ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: Int -> ByteString -> ByteString
instance Eq Skein512
instance Ord Skein512
instance Show Skein512
instance Serialize Skein512
instance Hash Ctx Skein512


-- | A module containing Skein256 bindings
module Crypto.Hash.Skein256
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.Skein256. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data Skein256

-- | init a context
init :: Int -> Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: Int -> ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: Int -> ByteString -> ByteString
instance Eq Skein256
instance Ord Skein256
instance Show Skein256
instance Serialize Skein256
instance Hash Ctx Skein256


-- | A module containing Tiger bindings
module Crypto.Hash.Tiger
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.Tiger. - use cryptohash's
--   centralized API by importing Crypto.Hash</i>
data Tiger

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq Tiger
instance Ord Tiger
instance Show Tiger
instance Serialize Tiger
instance Hash Ctx Tiger


-- | A module containing RIPEMD160 bindings
module Crypto.Hash.RIPEMD160
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.RIPEMD160. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data RIPEMD160

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq RIPEMD160
instance Ord RIPEMD160
instance Show RIPEMD160
instance Serialize RIPEMD160
instance Hash Ctx RIPEMD160


-- | A module containing SHA3 bindings
module Crypto.Hash.SHA3
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.SHA3. - use cryptohash's
--   centralized API by importing Crypto.Hash</i>
data SHA3

-- | init a context
init :: Int -> Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: Int -> ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: Int -> ByteString -> ByteString
instance Eq SHA3
instance Ord SHA3
instance Show SHA3
instance Serialize SHA3
instance Hash Ctx SHA3


-- | A module containing SHA512 bindings
module Crypto.Hash.SHA512
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.SHA512. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data SHA512

-- | init a context
init :: Ctx

-- | init a context using FIPS 180-4 for truncated SHA512
init_t :: Int -> Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq SHA512
instance Ord SHA512
instance Show SHA512
instance Serialize SHA512
instance Hash Ctx SHA512


-- | A module containing SHA512/t
module Crypto.Hash.SHA512t
data Ctx
Ctx :: !Int -> !Ctx -> Ctx

-- | init a context
init :: Int -> Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: Int -> ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: Int -> ByteString -> ByteString


-- | A module containing SHA384 bindings
module Crypto.Hash.SHA384
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.SHA384. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data SHA384

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq SHA384
instance Ord SHA384
instance Show SHA384
instance Serialize SHA384
instance Hash Ctx SHA384


-- | A module containing SHA256 bindings
module Crypto.Hash.SHA256
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.SHA256. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data SHA256

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq SHA256
instance Ord SHA256
instance Show SHA256
instance Serialize SHA256
instance Hash Ctx SHA256


-- | A module containing SHA224 bindings
module Crypto.Hash.SHA224
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.SHA224. - use
--   cryptohash's centralized API by importing Crypto.Hash</i>
data SHA224

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq SHA224
instance Ord SHA224
instance Show SHA224
instance Serialize SHA224
instance Hash Ctx SHA224


-- | A module containing SHA1 bindings
module Crypto.Hash.SHA1
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.SHA1. - use cryptohash's
--   centralized API by importing Crypto.Hash</i>
data SHA1

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq SHA1
instance Ord SHA1
instance Show SHA1
instance Serialize SHA1
instance Hash Ctx SHA1


-- | A module containing MD5 bindings
module Crypto.Hash.MD5
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.MD5. - use cryptohash's
--   centralized API by importing Crypto.Hash</i>
data MD5

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq MD5
instance Ord MD5
instance Show MD5
instance Serialize MD5
instance Hash Ctx MD5


-- | A module containing MD4 bindings
module Crypto.Hash.MD4
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.MD4. - use cryptohash's
--   centralized API by importing Crypto.Hash</i>
data MD4

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq MD4
instance Ord MD4
instance Show MD4
instance Serialize MD4
instance Hash Ctx MD4


-- | A module containing MD2 bindings
module Crypto.Hash.MD2
newtype Ctx
Ctx :: ByteString -> Ctx

-- | <i>Deprecated: Future cryptohash versions will not export crypto-api
--   hash instances here.you can either : - carry using cryptoapi types and
--   definitions by using the cryptohash-cryptoapi package and importing
--   Crypto.Hash.CryptoAPI instead of Crypto.Hash.MD2. - use cryptohash's
--   centralized API by importing Crypto.Hash</i>
data MD2

-- | init a context
init :: Ctx

-- | update a context with a bytestring
update :: Ctx -> ByteString -> Ctx

-- | updates a context with multiples bytestring
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring
finalize :: Ctx -> ByteString

-- | hash a strict bytestring into a digest bytestring
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring
hashlazy :: ByteString -> ByteString
instance Eq MD2
instance Ord MD2
instance Show MD2
instance Serialize MD2
instance Hash Ctx MD2


-- | Crypto hash types definitions
module Crypto.Hash.Types

-- | Class representing hashing algorithms.
--   
--   The hash algorithm is built over 3 primitives:
--   
--   init : create a new context updates : update the context with some
--   strict bytestrings finalize : finalize the context into a digest
class HashAlgorithm a
hashInit :: HashAlgorithm a => Context a
hashUpdates :: HashAlgorithm a => Context a -> [ByteString] -> Context a
hashFinalize :: HashAlgorithm a => Context a -> Digest a
digestFromByteString :: HashAlgorithm a => ByteString -> Maybe (Digest a)

-- | Represent a context for a given hash algorithm.
newtype Context a
Context :: ByteString -> Context a
contextToByteString :: Context a -> ByteString

-- | Represent a digest for a given hash algorithm.
newtype Digest a
Digest :: ByteString -> Digest a

-- | Return the binary digest
digestToByteString :: Digest a -> ByteString
instance Eq (Digest a)
instance Ord (Digest a)
instance Show (Digest a)


-- | Crypto hash main module
module Crypto.Hash

-- | Class representing hashing algorithms.
--   
--   The hash algorithm is built over 3 primitives:
--   
--   init : create a new context updates : update the context with some
--   strict bytestrings finalize : finalize the context into a digest
class HashAlgorithm a
hashInit :: HashAlgorithm a => Context a
hashUpdates :: HashAlgorithm a => Context a -> [ByteString] -> Context a
hashFinalize :: HashAlgorithm a => Context a -> Digest a
digestFromByteString :: HashAlgorithm a => ByteString -> Maybe (Digest a)

-- | Alias to a single pass hash function that operate on a strict
--   bytestring
type HashFunctionBS a = ByteString -> Digest a

-- | Alias to a single pass hash function that operate on a lazy bytestring
type HashFunctionLBS a = ByteString -> Digest a

-- | Represent a context for a given hash algorithm.
data Context a

-- | Represent a digest for a given hash algorithm.
data Digest a

-- | Return the binary digest
digestToByteString :: Digest a -> ByteString

-- | Return the hexadecimal (base16) bytestring of the digest
digestToHexByteString :: Digest a -> ByteString

-- | Hash a strict bytestring into a digest.
hash :: HashAlgorithm a => ByteString -> Digest a

-- | Hash a lazy bytestring into a digest.
hashlazy :: HashAlgorithm a => ByteString -> Digest a

-- | run hashUpdates on one single bytestring and return the updated
--   context.
hashUpdate :: HashAlgorithm a => Context a -> ByteString -> Context a
data MD2
data MD4
data MD5
data SHA1
data SHA224
data SHA256
data SHA384
data SHA512
data RIPEMD160
data Tiger
data SHA3_224
data SHA3_256
data SHA3_384
data SHA3_512
data Skein256_224
data Skein256_256
data Skein512_224
data Skein512_256
data Skein512_384
data Skein512_512
data Whirlpool

-- | Represent an HMAC that is phantom types with the hash used to produce
--   the mac.
--   
--   The Eq instance is constant time.
data HMAC a
HMAC :: ByteString -> HMAC a

-- | return the binary HMAC
hmacToByteString :: HMAC a -> ByteString

-- | compute a MAC using the supplied hashing function
hmac :: HashFunctionBS a -> Int -> ByteString -> ByteString -> HMAC a
instance Eq (HMAC a)
instance HashAlgorithm Skein512_512
instance HashAlgorithm Skein512_384
instance HashAlgorithm Skein512_256
instance HashAlgorithm Skein512_224
instance HashAlgorithm Skein256_256
instance HashAlgorithm Skein256_224
instance HashAlgorithm SHA3_512
instance HashAlgorithm SHA3_384
instance HashAlgorithm SHA3_256
instance HashAlgorithm SHA3_224
instance HashAlgorithm Tiger
instance HashAlgorithm Whirlpool
instance HashAlgorithm RIPEMD160
instance HashAlgorithm SHA512
instance HashAlgorithm SHA384
instance HashAlgorithm SHA256
instance HashAlgorithm SHA224
instance HashAlgorithm SHA1
instance HashAlgorithm MD5
instance HashAlgorithm MD4
instance HashAlgorithm MD2
