hmac-drbg

Pure Haskell HMAC-DRBG CSPRNG per NIST-SP 800-90A.
git clone git://git.ppad.tech/hmac-drbg.git
Log | Files | Refs | LICENSE

commit feb28359549ea350b4d550dba9470f0ec5ecc4b3
parent f521d94b1ea8bf737fd9f2b11c75c4169ac6e7ac
Author: Jared Tobin <jared@jtobin.io>
Date:   Mon, 30 Sep 2024 18:14:29 +0400

lib: s/read_key/read_k

Diffstat:
Mlib/Crypto/DRBG/HMAC.hs | 6+++---
Mtest/Main.hs | 6+++---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/Crypto/DRBG/HMAC.hs b/lib/Crypto/DRBG/HMAC.hs @@ -5,7 +5,7 @@ module Crypto.DRBG.HMAC ( DRBG , read_v - , read_key + , read_k , new , gen @@ -48,8 +48,8 @@ read_v :: DRBG -> BS.ByteString read_v (DRBG _ v _) = v -- | Read the 'Key' value from the DRBG state. -read_key :: DRBG -> BS.ByteString -read_key (DRBG _ _ key) = key +read_k :: DRBG -> BS.ByteString +read_k (DRBG _ _ key) = key -- drbg interaction ----------------------------------------------------------- diff --git a/test/Main.hs b/test/Main.hs @@ -34,7 +34,7 @@ test func addl bytes i_ent i_non i_per g_ent0 g_ent1 = do d_per = B16.decodeLenient i_per drbg0 = DRBG.new func d_ent d_non d_per v0 = DRBG.read_v drbg0 - k0 = DRBG.read_key drbg0 + k0 = DRBG.read_k drbg0 putStrLn $ "upon instantiation:" print $ " v: " <> B16.encode v0 @@ -44,7 +44,7 @@ test func addl bytes i_ent i_non i_per g_ent0 g_ent1 = do drbg1 = DRBG.reseed mempty d_ent0 drbg0 (_, drbg2) = DRBG.gen addl bytes drbg1 v1 = DRBG.read_v drbg2 - k1 = DRBG.read_key drbg2 + k1 = DRBG.read_k drbg2 putStrLn $ "after first gen:" print $ " v: " <> B16.encode v1 @@ -54,7 +54,7 @@ test func addl bytes i_ent i_non i_per g_ent0 g_ent1 = do drbg3 = DRBG.reseed mempty d_ent1 drbg2 (res, drbg4) = DRBG.gen addl bytes drbg3 v2 = DRBG.read_v drbg4 - k2 = DRBG.read_key drbg4 + k2 = DRBG.read_k drbg4 putStrLn $ "after second gen:" print $ " v: " <> B16.encode v2