module Raaz.Hash.Sha256
(
SHA256
, sha256, sha256File, sha256Source
, hmacSha256, hmacSha256File, hmacSha256Source
) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import Raaz.Core
import Raaz.Hash.Internal ( hashSource, hash, hashFile )
import Raaz.Hash.Internal.HMAC ( hmacSource, hmac, hmacFile, HMAC )
import Raaz.Hash.Sha256.Internal ( SHA256 )
import Raaz.Hash.Sha256.Recommendation()
sha256 :: PureByteSource src => src -> SHA256
sha256 = hash
{-# SPECIALIZE sha256 :: B.ByteString -> SHA256 #-}
{-# SPECIALIZE sha256 :: L.ByteString -> SHA256 #-}
sha256File :: FilePath -> IO SHA256
sha256File = hashFile
sha256Source :: ByteSource src => src -> IO SHA256
sha256Source = hashSource
hmacSha256 :: PureByteSource src
=> Key (HMAC SHA256)
-> src
-> HMAC SHA256
hmacSha256 = hmac
hmacSha256File :: Key (HMAC SHA256)
-> FilePath
-> IO (HMAC SHA256)
hmacSha256File = hmacFile
hmacSha256Source :: ByteSource src
=> Key (HMAC SHA256)
-> src
-> IO (HMAC SHA256)
hmacSha256Source = hmacSource