diff options
author | Benjamin Barenblat <bbaren@google.com> | 2018-03-24 21:21:20 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2018-03-24 21:21:20 -0400 |
commit | 7aeeadd0647bfa649b9af859fe5dd7b5cc52afe9 (patch) | |
tree | 82802ca134fccaff7a6824dd7d516aeae1b749a2 /src/Data/Digest/Internal.hsc | |
parent | 0ed87caa3481cbb6f8c2e809e5ec7df6f6245406 (diff) |
Implement HMAC
Diffstat (limited to 'src/Data/Digest/Internal.hsc')
-rw-r--r-- | src/Data/Digest/Internal.hsc | 4 |
1 files changed, 3 insertions, 1 deletions
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. |