aboutsummaryrefslogtreecommitdiff
path: root/src/Data/HMAC.hs
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2018-09-21 14:19:10 -0400
committerGravatar Benjamin Barenblat <bbaren@google.com>2018-09-21 14:19:10 -0400
commit021932a9ee2a81435b0a341030f68730dd9abd3b (patch)
treed8f41a370c3cb46750ec51e7c18a1c44ed3972f0 /src/Data/HMAC.hs
parentad7c615864605c8cc8eea7fc7bd6e917404e5562 (diff)
Start using base16-bytestring in btls
We’re already using it in tests, so eliminate some hand-rolled hexification code.
Diffstat (limited to 'src/Data/HMAC.hs')
-rw-r--r--src/Data/HMAC.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/HMAC.hs b/src/Data/HMAC.hs
index c6edca3..d8c36f1 100644
--- a/src/Data/HMAC.hs
+++ b/src/Data/HMAC.hs
@@ -59,7 +59,7 @@ import BTLS.BoringSSL.HMAC
import BTLS.BoringSSL.Mem (cryptoMemcmp)
import BTLS.Buffer (onBufferOfMaxSize)
import BTLS.Result (Error, check)
-import BTLS.Types (Algorithm(Algorithm), Digest(Digest), SecretKey(SecretKey))
+import BTLS.Types (Algorithm(Algorithm), SecretKey(SecretKey), showHex)
import Data.Digest (md5, sha1, sha224, sha256, sha384, sha512)
-- | A hash-based message authentication code. Equality comparisons on this type
@@ -74,7 +74,7 @@ instance Eq HMAC where
(==0) <$> cryptoMemcmp a' b' size
instance Show HMAC where
- show (HMAC m) = show (Digest m)
+ show (HMAC m) = showHex m
-- | Creates an HMAC according to the given 'Algorithm'.
hmac :: Algorithm -> SecretKey -> Lazy.ByteString -> Either [Error] HMAC