From 2106de31f7a8e37bb2ea8b8e9650a26dbef0d893 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 30 Aug 2016 13:23:11 -0400 Subject: show estimate for all rounds --- ExpensiveHash.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ExpensiveHash.hs') 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) -- cgit v1.2.3