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


-- | cryptonite conduit
--   
--   Conduit bridge for cryptonite
--   
--   For now only provide a conduit version for hash and hmac, but with
--   contribution, this could provide cipher conduits too, and probably
--   other things.
@package cryptonite-conduit
@version 0.2.0


-- | A module containing Conduit facilities for hash based functions.
--   
--   this module is vaguely similar to the crypto-conduit part related to
--   hash on purpose, as to provide an upgrade path. The api documentation
--   is pulled directly from this package and adapted, and thus are
--   originally copyright Felipe Lessa.
module Crypto.Hash.Conduit

-- | A <a>Sink</a> that hashes a stream of <a>ByteString</a><tt>s</tt> and
--   creates a digest <tt>d</tt>.
sinkHash :: (Monad m, HashAlgorithm hash) => Consumer ByteString m (Digest hash)

-- | Hashes the whole contents of the given file in constant memory. This
--   function is just a convenient wrapper around <a>sinkHash</a> defined
--   as:
--   
--   <pre>
--   hashFile fp = <a>liftIO</a> $ <a>runResourceT</a> (<a>sourceFile</a> fp <a>$$</a> <a>sinkHash</a>)
--   </pre>
hashFile :: (MonadIO m, HashAlgorithm hash) => FilePath -> m (Digest hash)


-- | A module containing Conduit facilities for hmac based functions.
module Crypto.MAC.HMAC.Conduit

-- | A <a>Sink</a> that calculates HMAC of a stream of
--   <a>ByteString</a><tt>s</tt> and returns digest <tt>d</tt>.
sinkHMAC :: (Monad m, ByteArrayAccess key, HashAlgorithm hash) => key -> ConduitM ByteString o m (HMAC hash)
