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


-- | crypton conduit
--   
--   Conduit bridge for crypton
--   
--   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 crypton-conduit
@version 0.2.3

module Crypto.Cipher.ChaChaPoly1305.Conduit
encrypt :: MonadThrow m => ByteString -> ByteString -> ConduitM ByteString ByteString m ()
decrypt :: MonadThrow m => ByteString -> ConduitM ByteString ByteString m ()
data ChaChaException
EncryptNonceException :: !CryptoError -> ChaChaException
EncryptKeyException :: !CryptoError -> ChaChaException
DecryptNonceException :: !CryptoError -> ChaChaException
DecryptKeyException :: !CryptoError -> ChaChaException
MismatchedAuth :: ChaChaException
instance GHC.Show.Show Crypto.Cipher.ChaChaPoly1305.Conduit.ChaChaException
instance GHC.Exception.Type.Exception Crypto.Cipher.ChaChaPoly1305.Conduit.ChaChaException


-- | 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) => ConduitT ByteString o 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>runConduitRes</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)

module Crypto.PubKey.ECIES.Conduit
encrypt :: (MonadThrow m, MonadRandom m) => Point Curve -> ConduitM ByteString ByteString m ()
decrypt :: MonadThrow m => Scalar Curve -> ConduitM ByteString ByteString m ()
