From 0ed87caa3481cbb6f8c2e809e5ec7df6f6245406 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Fri, 23 Mar 2018 18:34:42 -0400 Subject: Data.Digest: Reify hash algorithms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminate the functional interface for hashing. Hashing now occurs exclusively through the `hash` function, which accepts a `Data.Digest.Algorithm`. This makes btls somewhat less extensible, but it’s the most elegant way to support HMACs. --- src/Data/Digest/Sha2.hs | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 src/Data/Digest/Sha2.hs (limited to 'src/Data/Digest/Sha2.hs') diff --git a/src/Data/Digest/Sha2.hs b/src/Data/Digest/Sha2.hs deleted file mode 100644 index 965686c..0000000 --- a/src/Data/Digest/Sha2.hs +++ /dev/null @@ -1,30 +0,0 @@ -module Data.Digest.Sha2 - ( sha224 - , sha256 - , sha384 - , sha512 - ) where - -import Data.ByteString.Lazy (ByteString) - -import Data.Digest.Internal - -foreign import ccall "openssl/digest.h EVP_sha224" evpSha224 :: Algo - -foreign import ccall "openssl/digest.h EVP_sha256" evpSha256 :: Algo - -foreign import ccall "openssl/digest.h EVP_sha384" evpSha384 :: Algo - -foreign import ccall "openssl/digest.h EVP_sha512" evpSha512 :: Algo - -sha224 :: ByteString -> Digest -sha224 = hash evpSha224 - -sha256 :: ByteString -> Digest -sha256 = hash evpSha256 - -sha384 :: ByteString -> Digest -sha384 = hash evpSha384 - -sha512 :: ByteString -> Digest -sha512 = hash evpSha512 -- cgit v1.2.3