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


-- | A pure haskell library implements several hash algorithms.
--   
--   hashing is a pure haskell hash library, supported hash algorithm:
--   SHA1/SHA224/SHA256/SHA384/SHA512 MD5 and Whirlpool.
--   
--   It provides a simple interface <a>hash</a> and <a>hashLazy</a> to
--   compute a hash value Based on the type signature.
--   
--   Performance wise it only has 1/5 - 1/15 of native C implementations,
--   or <a>cryptonite</a>.
--   
--   Compare to other pure hash libraries such as PureMD5/SHA, it provides
--   a simpler interface, implements more algorithms, and has less
--   dependencies.
@package hashing
@version 0.1.0.1

module Crypto.Hash.ADT
data Context a
Context :: {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !ByteString -> !a -> Context a
[ctxTotalBytesRead] :: Context a -> {-# UNPACK #-} !Int64
[ctxBufferRead] :: Context a -> {-# UNPACK #-} !Int
[ctxBuffer] :: Context a -> {-# UNPACK #-} !ByteString
[ctxHashValueAcc] :: Context a -> !a

-- | Hash algorithm interface
--   
--   provides classic init/update/final API. however, user should call
--   higher level API such as hash or hashLazy.
class HashAlgorithm a
hashBlockSize :: HashAlgorithm a => a -> Int
hashDigestSize :: HashAlgorithm a => a -> Int
hashInit :: HashAlgorithm a => Context a
hashUpdate :: HashAlgorithm a => Context a -> ByteString -> Context a
hashFinal :: HashAlgorithm a => Context a -> a
newtype Digest a
Digest :: String -> Digest a
instance GHC.Show.Show (Crypto.Hash.ADT.Digest a)
instance GHC.Show.Show a => GHC.Show.Show (Crypto.Hash.ADT.Context a)
instance GHC.Base.Functor Crypto.Hash.ADT.Context

module Crypto.Hash.MD5
data MD5
instance GHC.Classes.Eq Crypto.Hash.MD5.MD5
instance GHC.Show.Show Crypto.Hash.MD5.MD5
instance Crypto.Hash.ADT.HashAlgorithm Crypto.Hash.MD5.MD5

module Crypto.Hash.SHA1
data SHA1
instance GHC.Classes.Eq Crypto.Hash.SHA1.SHA1
instance GHC.Show.Show Crypto.Hash.SHA1.SHA1
instance Crypto.Hash.ADT.HashAlgorithm Crypto.Hash.SHA1.SHA1

module Crypto.Hash.SHA256
data SHA256
data SHA224
instance GHC.Classes.Eq Crypto.Hash.SHA256.SHA256
instance GHC.Show.Show Crypto.Hash.SHA256.SHA224
instance GHC.Classes.Eq Crypto.Hash.SHA256.SHA224
instance Crypto.Hash.ADT.HashAlgorithm Crypto.Hash.SHA256.SHA224
instance GHC.Show.Show Crypto.Hash.SHA256.SHA256
instance Crypto.Hash.ADT.HashAlgorithm Crypto.Hash.SHA256.SHA256

module Crypto.Hash.SHA512
data SHA512
data SHA384
instance GHC.Classes.Eq Crypto.Hash.SHA512.SHA512
instance GHC.Show.Show Crypto.Hash.SHA512.SHA384
instance GHC.Classes.Eq Crypto.Hash.SHA512.SHA384
instance Crypto.Hash.ADT.HashAlgorithm Crypto.Hash.SHA512.SHA384
instance GHC.Show.Show Crypto.Hash.SHA512.SHA512
instance Crypto.Hash.ADT.HashAlgorithm Crypto.Hash.SHA512.SHA512

module Crypto.Hash.Whirlpool
data Whirlpool
instance GHC.Classes.Eq Crypto.Hash.Whirlpool.Whirlpool
instance GHC.Show.Show Crypto.Hash.Whirlpool.Whirlpool
instance Crypto.Hash.ADT.HashAlgorithm Crypto.Hash.Whirlpool.Whirlpool


-- | pure hash interface, supported hash algorithms:
--   
--   <ul>
--   <li>SHA1</li>
--   <li>SHA224/SHA256</li>
--   <li>SHA384/SHA512</li>
--   <li>MD5</li>
--   <li>Whirlpool</li>
--   </ul>
--   
--   NOTE: performance is just about 1 / 5 - 1 / 15 of C/ASM
--   implementations.
module Crypto.Hash

-- | Hash algorithm interface
--   
--   provides classic init/update/final API. however, user should call
--   higher level API such as hash or hashLazy.
class HashAlgorithm a
hashBlockSize :: HashAlgorithm a => a -> Int
hashDigestSize :: HashAlgorithm a => a -> Int
hashInit :: HashAlgorithm a => Context a
hashUpdate :: HashAlgorithm a => Context a -> ByteString -> Context a
hashFinal :: HashAlgorithm a => Context a -> a
data SHA1
data SHA224
data SHA256
data SHA384
data SHA512
data MD5
data Whirlpool

-- | Hash strict byte string
hash :: (HashAlgorithm a) => ByteString -> a

-- | Hash lazy byte string
hashLazy :: (HashAlgorithm a) => ByteString -> a
