From 021932a9ee2a81435b0a341030f68730dd9abd3b Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Fri, 21 Sep 2018 14:19:10 -0400 Subject: Start using base16-bytestring in btls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re already using it in tests, so eliminate some hand-rolled hexification code. --- src/Data/HMAC.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Data/HMAC.hs') 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 -- cgit v1.2.3