commit ce317b7fd9a76b7dfda0b06084109c1784a53df6
parent 72c8dd37d41273f4b54ca8be374adc62aff11b2b
Author: Jared Tobin <jared@jtobin.io>
Date: Fri, 4 Oct 2024 20:32:31 +0400
lib: s/toStrictSmall/toStrict
Diffstat:
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/lib/Crypto/DRBG/HMAC.hs b/lib/Crypto/DRBG/HMAC.hs
@@ -27,7 +27,6 @@ module Crypto.DRBG.HMAC (
import Control.Monad.Primitive (PrimMonad, PrimState)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Builder as BSB
-import qualified Data.ByteString.Builder.Extra as BE
import qualified Data.Primitive.MutVar as P
import Data.Word (Word64)
@@ -41,13 +40,6 @@ toStrict :: BSB.Builder -> BS.ByteString
toStrict = BS.toStrict . BSB.toLazyByteString
{-# INLINE toStrict #-}
-toStrictSmall :: BSB.Builder -> BS.ByteString
-toStrictSmall =
- BS.toStrict
- . BE.toLazyByteStringWith
- (BE.safeStrategy 128 BE.smallChunkSize) mempty
-{-# INLINE toStrictSmall #-}
-
-- dumb strict pair
data Pair a b = Pair !a !b
deriving Show
@@ -194,7 +186,7 @@ update_pure provided_data (DRBGState h@(HMACEnv hmac _) r v0 k0) =
!v2 = hmac k2 v1
in DRBGState h r v2 k2
where
- cat bs byte suf = toStrictSmall $
+ cat bs byte suf = toStrict $
BSB.byteString bs <> BSB.word8 byte <> BSB.byteString suf
-- SP 800-90A 10.1.2.3