summaryrefslogtreecommitdiffhomepage
path: root/Tunables.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Tunables.hs')
-rw-r--r--Tunables.hs10
1 files changed, 3 insertions, 7 deletions
diff --git a/Tunables.hs b/Tunables.hs
index 3fa700a..07b4c61 100644
--- a/Tunables.hs
+++ b/Tunables.hs
@@ -7,10 +7,8 @@
module Tunables where
-import Types
import Cost
import qualified Crypto.Argon2 as Argon2
-import qualified Data.ByteString as B
-- | To determine the tunables used for a key name the expensive hash of the
-- name is calculated, using a particular configuration, and if the
@@ -134,9 +132,7 @@ testModeTunables = Tunables
where
weakargon2 c = UseArgon2 c Argon2.defaultHashOptions
-validObjectsize :: StorableObject -> Bool
-validObjectsize o = any (sz ==) knownsizes
+knownObjectSizes :: [Int]
+knownObjectSizes = map (calc . snd) knownTunings
where
- sz = B.length (fromStorableObject o)
- knownsizes = map (\t -> objectSize t * shareOverhead t)
- (map snd knownTunings)
+ calc t = objectSize t * shareOverhead t