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

-- | Fast, pure and practical SHA-1 implementation
--   
--   A practical incremental and one-pass, pure API to the SHA-1 hash
--   algorithm (including HMAC support) with performance close
--   to the fastest implementations available in other languages.
--   
--   The implementation is made in C with a haskell FFI wrapper that hides
--   the C implementation.
--   
--   NOTE: This package has been forked off cryptohash-0.11.7
--   because the cryptohash package has been deprecated and so
--   this package continues to satisfy the need for a lightweight package
--   providing the SHA1 hash algorithm without any dependencies on packages
--   other than base and bytestring.
--   
--   Consequently, this package can be used as a drop-in replacement for
--   cryptohash's Crypto.Hash.SHA1 module, though with a
--   clearly smaller footprint.
@package cryptohash-sha1
@version 0.11.101.0

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

-- | SHA-1 Context
--   
--   The context data is exactly 92 bytes long, however the data in the
--   context is stored in host-endianness.
--   
--   The context data is made up of
--   
--   
--   
- a Word64 representing the number of bytes already feed to
--   hash algorithm so far,
--   
- a 64-element Word8 buffer holding partial input-chunks, and
--   finally
--   
- a 5-element Word32 array holding the current
--   work-in-progress digest-value.
--   
--   
--   Consequently, a SHA-1 digest as produced by hash,
--   hashlazy, or finalize is 20 bytes long.
newtype Ctx
Ctx :: ByteString -> Ctx

-- | create a new hash context
init :: Ctx

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

-- | updates a context with multiple bytestrings
updates :: Ctx -> [ByteString] -> Ctx

-- | finalize the context into a digest bytestring (20 bytes)
finalize :: Ctx -> ByteString

-- | Variant of finalize also returning length of hashed content
finalizeAndLength :: Ctx -> (ByteString, Word64)

-- | hash a strict bytestring into a Ctx
start :: ByteString -> Ctx

-- | hash a lazy bytestring into a Ctx
startlazy :: ByteString -> Ctx

-- | hash a strict bytestring into a digest bytestring (20 bytes)
hash :: ByteString -> ByteString

-- | hash a lazy bytestring into a digest bytestring (20 bytes)
hashlazy :: ByteString -> ByteString

-- | Variant of hashlazy which simultaneously computes the hash and
--   length of a lazy bytestring.
hashlazyAndLength :: ByteString -> (ByteString, Word64)

-- | Compute 20-byte RFC2104-compatible HMAC-SHA1 digest for a
--   strict bytestring message
hmac :: ByteString -> ByteString -> ByteString

-- | Compute 20-byte RFC2104-compatible HMAC-SHA1 digest for a lazy
--   bytestring messagvoide
hmaclazy :: ByteString -> ByteString -> ByteString

-- | Variant of hmaclazy which also returns length of message
hmaclazyAndLength :: ByteString -> ByteString -> (ByteString, Word64)
