{-# LANGUAGE CPP #-}
{-# LANGUAGE PackageImports #-}
module Crypto.Hash.Internal
( unsafeDoIO
, digestToByteString
, digestToByteStringWitness
) where
import System.IO.Unsafe
import Data.ByteArray (convert)
import "cryptonite" Crypto.Hash
import Data.ByteString (ByteString)
unsafeDoIO :: IO a -> a
#if __GLASGOW_HASKELL__ > 704
unsafeDoIO :: IO a -> a
unsafeDoIO = IO a -> a
forall a. IO a -> a
unsafeDupablePerformIO
#else
unsafeDoIO = unsafePerformIO
#endif
digestToByteString :: HashAlgorithm h => Digest h -> ByteString
digestToByteString :: Digest h -> ByteString
digestToByteString = Digest h -> ByteString
forall bin bout.
(ByteArrayAccess bin, ByteArray bout) =>
bin -> bout
convert
digestToByteStringWitness :: HashAlgorithm h => h -> Digest h -> ByteString
digestToByteStringWitness :: h -> Digest h -> ByteString
digestToByteStringWitness _ = Digest h -> ByteString
forall bin bout.
(ByteArrayAccess bin, ByteArray bout) =>
bin -> bout
convert