aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Digest/Sha2.hs
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2018-03-23 18:34:42 -0400
committerGravatar Benjamin Barenblat <bbaren@google.com>2018-03-23 18:34:42 -0400
commit0ed87caa3481cbb6f8c2e809e5ec7df6f6245406 (patch)
treee7267e4b7996920577aa556ff7a67a312a271216 /src/Data/Digest/Sha2.hs
parent3e898da300395bc3e63780b8d27a97fd4a9c375c (diff)
Data.Digest: Reify hash algorithms
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.
Diffstat (limited to 'src/Data/Digest/Sha2.hs')
-rw-r--r--src/Data/Digest/Sha2.hs30
1 files changed, 0 insertions, 30 deletions
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