diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-30 13:23:11 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-30 13:23:39 -0400 |
commit | 2106de31f7a8e37bb2ea8b8e9650a26dbef0d893 (patch) | |
tree | 93f85b3a302dbcb234752e19f1b209a7f812cbac /ExpensiveHash.hs | |
parent | b02bfe47d0a07b813dfd5bc3a78ad02c3673b493 (diff) | |
download | keysafe-2106de31f7a8e37bb2ea8b8e9650a26dbef0d893.tar.gz |
show estimate for all rounds
Diffstat (limited to 'ExpensiveHash.hs')
-rw-r--r-- | ExpensiveHash.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ExpensiveHash.hs b/ExpensiveHash.hs index abe89ca..fed6d18 100644 --- a/ExpensiveHash.hs +++ b/ExpensiveHash.hs @@ -80,10 +80,16 @@ benchmarkTunables tunables = do let normalrounds = fromIntegral $ 256 * randomSaltBytes (keyEncryptionKeyTunable tunables) putStrLn $ "Benchmarking 16/" ++ show normalrounds ++ " rounds of key encryption key hash..." - print =<< benchmarkExpensiveHash 16 + r <- benchmarkExpensiveHash 16 (keyEncryptionKeyHash $ keyEncryptionKeyTunable tunables) (mapCost (`div` (normalrounds `div` 16)) $ randomSaltBytesBruteForceCost $ keyEncryptionKeyTunable tunables) - + print r + putStrLn $ "Estimated time for " ++ show normalrounds ++ " rounds of key encryption key hash..." + print $ BenchmarkResult + { expectedBenchmark = mapCost (* 16) (expectedBenchmark r) + , actualBenchmark = mapCost (* 16) (actualBenchmark r) + } + putStrLn "Benchmarking 1 round of name generation hash..." print =<< benchmarkExpensiveHash 1 (nameGenerationHash $ nameGenerationTunable tunables) |