summaryrefslogtreecommitdiffhomepage
path: root/Benchmark.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-15 00:26:33 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-15 00:26:41 -0400
commit4fc681f78b2e659d3db3da99fe7c640416fb3b43 (patch)
tree6d20d2864f98d4c3be1814d399bc669524ee6a42 /Benchmark.hs
parentb431fc0fb9d3b4617e4331a549ea02fda236223b (diff)
downloadkeysafe-4fc681f78b2e659d3db3da99fe7c640416fb3b43.tar.gz
Change format of ~/.keysafe/backup.log
Allow deserializing SecretKeySource so we can later know what gpg keys are backed up. Converted KeyId to Text as JSON can't handle ByteString.
Diffstat (limited to 'Benchmark.hs')
-rw-r--r--Benchmark.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Benchmark.hs b/Benchmark.hs
index c121e17..66436fe 100644
--- a/Benchmark.hs
+++ b/Benchmark.hs
@@ -14,6 +14,7 @@ import HTTP.ProofOfWork
import Cost
import Serialization ()
import qualified Data.ByteString.UTF8 as BU8
+import qualified Data.Text as T
import qualified Crypto.Argon2 as Argon2
import Data.Time.Clock
import Control.DeepSeq
@@ -41,10 +42,11 @@ benchmarkExpensiveHash' rounds tunables@(UseArgon2 _ hashopts) expected = do
forM_ [1..rounds] $ \n -> do
-- Must vary the data being hashed to avoid laziness
-- caching hash results.
- let base = BU8.fromString (show n)
+ let base = T.pack (show n)
+ let baseb = BU8.fromString (show n)
let ExpensiveHash _ t = expensiveHash tunables
(Salt (GpgKey (KeyId (base <> "dummy"))))
- (base <> "himom")
+ (baseb <> "himom")
t `deepseq` return ()
end <- getCurrentTime
let diff = floor (end `diffUTCTime` start) :: Integer