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. --- tests/Data/Digest/Sha2Tests.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/Data/Digest/Sha2Tests.hs') diff --git a/tests/Data/Digest/Sha2Tests.hs b/tests/Data/Digest/Sha2Tests.hs index b1faf27..1df607b 100644 --- a/tests/Data/Digest/Sha2Tests.hs +++ b/tests/Data/Digest/Sha2Tests.hs @@ -11,12 +11,12 @@ import Test.Tasty.SmallCheck (testProperty) import Data.Digest.HashTests (tableTestCase, testAgainstCoreutils, testAgainstOpenssl) -import Data.Digest.Sha2 +import Data.Digest (hash, sha224, sha256, sha384, sha512) tests :: TestTree tests = testGroup - "Data.Digest.Sha2" + "SHA-2" [ testNistExamples , testGoExamples , testCoreutilsConformance @@ -497,10 +497,10 @@ testOpensslConformance = -- Convenience functions. -sha224sum = show . sha224 . ByteString.Lazy.fromStrict +sha224sum = show . hash sha224 . ByteString.Lazy.fromStrict -sha256sum = show . sha256 . ByteString.Lazy.fromStrict +sha256sum = show . hash sha256 . ByteString.Lazy.fromStrict -sha384sum = show . sha384 . ByteString.Lazy.fromStrict +sha384sum = show . hash sha384 . ByteString.Lazy.fromStrict -sha512sum = show . sha512 . ByteString.Lazy.fromStrict +sha512sum = show . hash sha512 . ByteString.Lazy.fromStrict -- cgit v1.2.3