summaryrefslogtreecommitdiffhomepage
path: root/ExpensiveHash.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-31 12:48:11 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-31 12:48:11 -0400
commit176dbd5798a7def03ea6c61713a0c216ab1e1674 (patch)
tree4d744dbe75b75a6bda291042a2a655cfcf415c03 /ExpensiveHash.hs
parent298c2922dd59acb9e0894168df4a1f28bf853e1b (diff)
downloadkeysafe-176dbd5798a7def03ea6c61713a0c216ab1e1674.tar.gz
comment
Diffstat (limited to 'ExpensiveHash.hs')
-rw-r--r--ExpensiveHash.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/ExpensiveHash.hs b/ExpensiveHash.hs
index ddb7eaa..b46b23c 100644
--- a/ExpensiveHash.hs
+++ b/ExpensiveHash.hs
@@ -53,6 +53,8 @@ benchmarkExpensiveHash rounds tunables@(UseArgon2 _ hashopts) expected = do
<$> getNumCores
start <- getCurrentTime
forM_ [1..rounds] $ \n -> do
+ -- Must vary the data being hashed to avoid laziness
+ -- caching hash results.
let base = BU8.fromString (show n)
let ExpensiveHash _ t = expensiveHash tunables
(Salt (GpgKey (KeyId (base <> "dummy"))))