ppad-hkdf 0.3.1 → 0.3.2
raw patch · 4 files changed
+23/−10 lines, 4 filesdep ~ppad-sha256dep ~ppad-sha512PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ppad-sha256, ppad-sha512
API changes (from Hackage documentation)
Files
- CHANGELOG +4/−0
- bench/Main.hs +11/−2
- ppad-hkdf.cabal +5/−5
- test/Main.hs +3/−3
CHANGELOG view
@@ -1,5 +1,9 @@ # Changelog +- 0.3.2 (2026-01-11)+ * Bumps the ppad-sha{256,512} dependencies used in the test and benchmark+ suites.+ - 0.3.1 (2025-12-28) * Adds an 'llvm' build flag and tests with GHC 9.10.3.
bench/Main.hs view
@@ -6,22 +6,31 @@ import qualified Crypto.KDF.HMAC as KDF import qualified Crypto.Hash.SHA256 as SHA256 import qualified Crypto.Hash.SHA512 as SHA512+import qualified Data.ByteString as BS main :: IO () main = defaultMain [ suite ] +hmac_sha256 :: BS.ByteString -> BS.ByteString -> BS.ByteString+hmac_sha256 k b = case SHA256.hmac k b of+ SHA256.MAC mac -> mac++hmac_sha512 :: BS.ByteString -> BS.ByteString -> BS.ByteString+hmac_sha512 k b = case SHA512.hmac k b of+ SHA512.MAC mac -> mac+ suite :: Benchmark suite = bgroup "ppad-hkdf" [ bgroup "HKDF-SHA256" [ bench "derive (outlen 32)" $- nf (KDF.derive SHA256.hmac "muh salt" "muh info" 32) "muh secret"+ nf (KDF.derive hmac_sha256 "muh salt" "muh info" 32) "muh secret" ] , bgroup "HKDF-SHA512" [ bench "derive (outlen 32)" $- nf (KDF.derive SHA512.hmac "muh salt" "muh info" 32) "muh secret"+ nf (KDF.derive hmac_sha512 "muh salt" "muh info" 32) "muh secret" ] ]
ppad-hkdf.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: ppad-hkdf-version: 0.3.1+version: 0.3.2 synopsis: A HMAC-based key derivation function license: MIT license-file: LICENSE@@ -53,8 +53,8 @@ , bytestring , ppad-base16 , ppad-hkdf- , ppad-sha256- , ppad-sha512+ , ppad-sha256 >= 0.3 && < 0.4+ , ppad-sha512 >= 0.2 && < 0.3 , tasty , tasty-hunit , text@@ -73,6 +73,6 @@ , bytestring , criterion , ppad-hkdf- , ppad-sha256- , ppad-sha512+ , ppad-sha256 >= 0.3 && < 0.4+ , ppad-sha512 >= 0.2 && < 0.3
test/Main.hs view
@@ -56,8 +56,8 @@ | ht_result == "invalid" -> assertBool "invalid" (pec /= out) | otherwise -> assertEqual mempty pec out where- hmac = case h of- SHA256 -> SHA256.hmac- SHA512 -> SHA512.hmac+ hmac k b = case h of+ SHA256 -> let SHA256.MAC mac = SHA256.hmac k b in mac+ SHA512 -> let SHA512.MAC mac = SHA512.hmac k b in mac t_msg = "test " <> show ht_tcId -- XX embellish