From 7aeeadd0647bfa649b9af859fe5dd7b5cc52afe9 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 24 Mar 2018 21:21:20 -0400 Subject: Implement HMAC --- src/Data/Digest/Internal.hsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Data/Digest/Internal.hsc') diff --git a/src/Data/Digest/Internal.hsc b/src/Data/Digest/Internal.hsc index a7f19d7..8906797 100644 --- a/src/Data/Digest/Internal.hsc +++ b/src/Data/Digest/Internal.hsc @@ -28,6 +28,9 @@ type LazyByteString = ByteString.Lazy.ByteString -- | The BoringSSL @ENGINE@ type. data Engine +noEngine :: Ptr Engine +noEngine = nullPtr + -- | The BoringSSL @EVP_MD@ type, representing a hash algorithm. data EvpMd @@ -137,7 +140,6 @@ hash (Algorithm md) bytes = ByteString.packCStringLen (unsafeCoerce mdOut, outSize) return (Digest d) where - noEngine = nullPtr :: Ptr Engine updateBytes ctx chunk = -- 'mdUpdate' treats its @buf@ argument as @const@, so the sharing -- inherent in 'ByteString.unsafeUseAsCStringLen' is fine. -- cgit v1.2.3