From 07bd29a80ed36c63296214af34689d0cce14751f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 7 Aug 2016 18:49:15 -0400 Subject: reorg, and working on serialization --- ExpensiveHash.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ExpensiveHash.hs') diff --git a/ExpensiveHash.hs b/ExpensiveHash.hs index ca357bc..c27f703 100644 --- a/ExpensiveHash.hs +++ b/ExpensiveHash.hs @@ -3,8 +3,8 @@ module ExpensiveHash where import Types +import Serialization import Cost -import Tunables import qualified Data.ByteString as B import Raaz.Core.Encode import qualified Crypto.Argon2 as Argon2 @@ -23,8 +23,9 @@ data Salt t = Salt t expensiveHash :: Encodable t => Tunables -> Salt t -> Password -> ExpensiveHash expensiveHash tunables (Salt s) (Password password) = - ExpensiveHash (argonCost tunables) $ - Argon2.hash (argonOptions tunables) password (toByteString s) + case expensiveHashTunable tunables of + UseArgon2 opts cost -> ExpensiveHash cost $ + Argon2.hash opts password (toByteString s) benchmarkExpensiveHash :: Tunables -> IO (Benchmark (Cost CreationOp)) benchmarkExpensiveHash tunables = do -- cgit v1.2.3