-- 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 other 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 [0..255])
--   </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.11.6


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

-- | compute a MAC using the supplied hashing function
--   
--   An incremental API can be found in the module <a>Crypto.Hash</a>.
hmac :: (ByteString -> ByteString) -> Int -> ByteString -> ByteString -> ByteString


-- | A module containing Whirlpool bindings
module Crypto.Hash.Whirlpool

-- | Whirlpool Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing Skein512 bindings
module Crypto.Hash.Skein512

-- | Skein512 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing Skein256 bindings
module Crypto.Hash.Skein256

-- | Skein256 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing Tiger bindings
module Crypto.Hash.Tiger

-- | Tiger Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing RIPEMD160 bindings
module Crypto.Hash.RIPEMD160

-- | RIPEMD160 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing SHA3 bindings
module Crypto.Hash.SHA3

-- | SHA3 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing SHA512 bindings
module Crypto.Hash.SHA512

-- | SHA512 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing SHA512/t
module Crypto.Hash.SHA512t

-- | SHA512 Context with variable size output
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

-- | SHA384 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing SHA256 bindings
module Crypto.Hash.SHA256

-- | SHA256 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing SHA224 bindings
module Crypto.Hash.SHA224

-- | SHA224 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing SHA1 bindings
module Crypto.Hash.SHA1

-- | SHA1 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing MD5 bindings
module Crypto.Hash.MD5

-- | MD5 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing MD4 bindings
module Crypto.Hash.MD4

-- | MD4 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


-- | A module containing MD2 bindings
module Crypto.Hash.MD2

-- | MD2 Context
newtype Ctx
Ctx :: ByteString -> Ctx

-- | 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


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

-- | Class representing hashing algorithms.
--   
--   The hash algorithm is built over 3 primitives:
--   
--   <ul>
--   <li>init : create a new hashing context</li>
--   <li>updates : update the hashing context with some strict bytestrings
--   and return the new context</li>
--   <li>finalize : finalize the context into a digest</li>
--   </ul>
class HashAlgorithm a
hashBlockSize :: HashAlgorithm a => Context a -> Int
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

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

-- | return the binary bytestring. deprecated use toBytes.
contextToByteString :: Context a -> ByteString

-- | return the binary bytestring. deprecated use toBytes.

-- | <i>Deprecated: use toBytes from byteable:Data.Byteable </i>
digestToByteString :: Digest a -> ByteString
instance Eq (Digest a)
instance Ord (Digest a)
instance Show (Digest a)
instance Byteable (Digest a)
instance Byteable (Context a)


-- | Generalized cryptographic hash interface, that you can use with
--   cryptographic hash algorithm that belong to the HashAlgorithm type
--   class.
--   
--   <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>
module Crypto.Hash

-- | Class representing hashing algorithms.
--   
--   The hash algorithm is built over 3 primitives:
--   
--   <ul>
--   <li>init : create a new hashing context</li>
--   <li>updates : update the hashing context with some strict bytestrings
--   and return the new context</li>
--   <li>finalize : finalize the context into a digest</li>
--   </ul>
class HashAlgorithm a
hashBlockSize :: HashAlgorithm a => Context a -> Int
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 bytestring. deprecated use toBytes.

-- | <i>Deprecated: use toBytes from byteable:Data.Byteable </i>
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

-- | Initialize a new context for a specified hash algorithm
hashInitAlg :: HashAlgorithm alg => alg -> Context alg

-- | MD2 cryptographic hash
data MD2
MD2 :: MD2

-- | MD4 cryptographic hash
data MD4
MD4 :: MD4

-- | MD5 cryptographic hash
data MD5
MD5 :: MD5

-- | SHA1 cryptographic hash
data SHA1
SHA1 :: SHA1

-- | SHA224 cryptographic hash
data SHA224
SHA224 :: SHA224

-- | SHA256 cryptographic hash
data SHA256
SHA256 :: SHA256

-- | SHA384 cryptographic hash
data SHA384
SHA384 :: SHA384

-- | SHA512 cryptographic hash
data SHA512
SHA512 :: SHA512

-- | RIPEMD160 cryptographic hash
data RIPEMD160
RIPEMD160 :: RIPEMD160

-- | Tiger cryptographic hash
data Tiger
Tiger :: Tiger

-- | SHA3 (224 bits version) cryptographic hash
data SHA3_224
SHA3_224 :: SHA3_224

-- | SHA3 (256 bits version) cryptographic hash
data SHA3_256
SHA3_256 :: SHA3_256

-- | SHA3 (384 bits version) cryptographic hash
data SHA3_384
SHA3_384 :: SHA3_384

-- | SHA3 (512 bits version) cryptographic hash
data SHA3_512
SHA3_512 :: SHA3_512

-- | Skein256 (224 bits version) cryptographic hash
data Skein256_224
Skein256_224 :: Skein256_224

-- | Skein256 (256 bits version) cryptographic hash
data Skein256_256
Skein256_256 :: Skein256_256

-- | Skein512 (224 bits version) cryptographic hash
data Skein512_224
Skein512_224 :: Skein512_224

-- | Skein512 (256 bits version) cryptographic hash
data Skein512_256
Skein512_256 :: Skein512_256

-- | Skein512 (384 bits version) cryptographic hash
data Skein512_384
Skein512_384 :: Skein512_384

-- | Skein512 (512 bits version) cryptographic hash
data Skein512_512
Skein512_512 :: Skein512_512

-- | Whirlpool cryptographic hash
data Whirlpool
Whirlpool :: Whirlpool

-- | Represent an HMAC that is a phantom type with the hash used to produce
--   the mac.
--   
--   The Eq instance is constant time.
newtype HMAC a
HMAC :: Digest a -> HMAC a
hmacGetDigest :: HMAC a -> Digest a

-- | compute a MAC using the supplied hashing function
hmac :: HashAlgorithm a => ByteString -> ByteString -> HMAC a

-- | compute a HMAC using a specified algorithm
hmacAlg :: HashAlgorithm a => a -> ByteString -> ByteString -> HMAC a
instance Show MD2
instance Show MD4
instance Show MD5
instance Show SHA1
instance Show SHA224
instance Show SHA256
instance Show SHA384
instance Show SHA512
instance Show RIPEMD160
instance Show Whirlpool
instance Show Tiger
instance Show SHA3_224
instance Show SHA3_256
instance Show SHA3_384
instance Show SHA3_512
instance Show Skein256_224
instance Show Skein256_256
instance Show Skein512_224
instance Show Skein512_256
instance Show Skein512_384
instance Show Skein512_512
instance Eq (HMAC a)
instance Byteable (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


-- | Crypto hash generic MAC (Message Authentification Code) module
module Crypto.MAC

-- | Represent an HMAC that is a phantom type with the hash used to produce
--   the mac.
--   
--   The Eq instance is constant time.
newtype HMAC a
HMAC :: Digest a -> HMAC a
hmacGetDigest :: HMAC a -> Digest a

-- | compute a MAC using the supplied hashing function
hmac :: HashAlgorithm a => ByteString -> ByteString -> HMAC a

-- | compute a HMAC using a specified algorithm
hmacAlg :: HashAlgorithm a => a -> ByteString -> ByteString -> HMAC a

-- | Represent an ongoing HMAC state, that can be appended with
--   <a>hmacUpdate</a> and finalize to an HMAC with <a>hmacFinalize</a>
data HMACContext hashalg

-- | Initialize a new incremental HMAC context
hmacInit :: HashAlgorithm a => ByteString -> HMACContext a

-- | Initialize a new incremental HMAC context with a given hash algorithm.
hmacInitAlg :: HashAlgorithm a => a -> ByteString -> HMACContext a

-- | Incrementally update a HMAC context
hmacUpdate :: HashAlgorithm a => HMACContext a -> ByteString -> HMACContext a

-- | Finalize a HMAC context and return the HMAC.
hmacFinalize :: HashAlgorithm a => HMACContext a -> HMAC a


-- | provide a simple SHA3 MAC mechanism with
--   
--   <pre>
--   mac = hash(key|message)
--   </pre>
module Crypto.MAC.SHA3

-- | SHA3_512 MAC
data MAC512
MAC512 :: Digest SHA3_512 -> MAC512
getDigest512 :: MAC512 -> Digest SHA3_512

-- | SHA3_384 MAC
data MAC384
MAC384 :: Digest SHA3_384 -> MAC384
getDigest384 :: MAC384 -> Digest SHA3_384

-- | SHA3_256 MAC
data MAC256
MAC256 :: Digest SHA3_256 -> MAC256
getDigest256 :: MAC256 -> Digest SHA3_256

-- | SHA3_224 MAC
data MAC224
MAC224 :: Digest SHA3_224 -> MAC224
getDigest224 :: MAC224 -> Digest SHA3_224

-- | compute a MAC using a simple SHA3_512 key|msg
mac512 :: ByteString -> ByteString -> MAC512

-- | compute a MAC using a simple SHA3_384 key|msg
mac384 :: ByteString -> ByteString -> MAC384

-- | compute a MAC using a simple SHA3_256 key|msg
mac256 :: ByteString -> ByteString -> MAC256

-- | compute a MAC using a simple SHA3_224 key|msg
mac224 :: ByteString -> ByteString -> MAC224
instance Eq MAC224
instance Byteable MAC224
instance Eq MAC256
instance Byteable MAC256
instance Eq MAC384
instance Byteable MAC384
instance Eq MAC512
instance Byteable MAC512
