-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | collection of crypto hashes, fast, pure and practical -- -- DEPRECATED: this library is still fully functional, but please use -- cryptonite for new projects and convert old one to use cryptonite. -- This is where things are at nowadays. -- -- 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: -- --
-- import Crypto.Hash -- -- sha1 :: ByteString -> Digest SHA1 -- sha1 = hash -- -- hexSha3_512 :: ByteString -> String -- hexSha3_512 bs = show (hash bs :: Digest SHA3_512) ---- -- Simple examples using the module API: -- --
-- import qualified Crypto.Hash.SHA1 as SHA1 -- -- main = putStrLn $ show $ SHA1.hash (Data.ByteString.pack [0..255]) ---- --
-- 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 --@package cryptohash @version 0.11.9 -- | A module containing Whirlpool bindings module Crypto.Hash.Whirlpool -- | Whirlpool Context newtype Ctx Ctx :: (Context Whirlpool) -> 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 :: (Context Tiger) -> 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 :: (Context RIPEMD160) -> 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 -- -- WARNING: this implementation is not SHA3 as standardize, but SHA3 as -- submitted before standardisation. also known at the Keccak. -- -- A matching implementation is available as Keccak in cryptonite for -- people that are using the pre-standard SHA3. -- -- do not use. -- | Warning: this implementation is not SHA3 as standardized, but SHA3 -- as submitted before standardisation (Keccak) 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 :: (Context SHA384) -> 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 :: (Context SHA256) -> 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 :: (Context SHA224) -> 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 :: (Context SHA1) -> 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 :: (Context MD5) -> 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 :: (Context MD4) -> 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 :: (Context MD2) -> 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 -- | Represent a context for a given hash algorithm. newtype Context a Context :: (Context a) -> Context a -- | Represent a digest for a given hash algorithm. newtype Digest a Digest :: (Digest a) -> Digest a contextToByteString :: Context a -> ByteString -- | return the binary bytestring. deprecated use toBytes. -- | Deprecated: use toBytes from byteable:Data.Byteable digestToByteString :: Digest a -> ByteString instance GHC.Classes.Ord (Crypto.Hash.Types.Digest a) instance GHC.Classes.Eq (Crypto.Hash.Types.Digest a) instance Data.Byteable.Byteable (Crypto.Hash.Types.Context a) instance Data.Byteable.Byteable (Crypto.Hash.Types.Digest a) instance GHC.Show.Show (Crypto.Hash.Types.Digest a) -- | provide the HMAC (Hash based Message Authentification Code) base -- algorithm. http://en.wikipedia.org/wiki/HMAC module Crypto.MAC.HMAC -- | compute a MAC using the supplied hashing function -- -- An incremental API can be found in the module Crypto.Hash. hmac :: (ByteString -> ByteString) -> Int -> ByteString -> ByteString -> ByteString -- | Generalized cryptographic hash interface, that you can use with -- cryptographic hash algorithm that belong to the HashAlgorithm type -- class. -- --
-- import Crypto.Hash -- -- sha1 :: ByteString -> Digest SHA1 -- sha1 = hash -- -- hexSha3_512 :: ByteString -> String -- hexSha3_512 bs = show (hash bs :: Digest SHA3_512) --module Crypto.Hash -- | Class representing hashing algorithms. -- -- The hash algorithm is built over 3 primitives: -- --
-- mac = hash(key|message) --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 Data.Byteable.Byteable Crypto.MAC.SHA3.MAC512 instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC512 instance Data.Byteable.Byteable Crypto.MAC.SHA3.MAC384 instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC384 instance Data.Byteable.Byteable Crypto.MAC.SHA3.MAC256 instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC256 instance Data.Byteable.Byteable Crypto.MAC.SHA3.MAC224 instance GHC.Classes.Eq Crypto.MAC.SHA3.MAC224