From 6f2d6120533070ce48bbc1e12465d1f7d603aec8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 7 Aug 2016 17:24:56 -0400 Subject: sharding --- Tunables.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Tunables.hs') diff --git a/Tunables.hs b/Tunables.hs index 79fb2a8..1806703 100644 --- a/Tunables.hs +++ b/Tunables.hs @@ -1,11 +1,13 @@ module Tunables where import Types +import Shard import Cost import qualified Crypto.Argon2 as Argon2 data Tunables = Tunables { objectSize :: Int + , shardParams :: shardParams -- ^ size of objects stored in keysafe, in bytes , argonOptions :: Argon2.HashOptions , argonCost :: Cost CreationOp @@ -16,7 +18,8 @@ data Tunables = Tunables defaultTunables :: Tunables defaultTunables = Tunables - { objectSize = 1024*64 -- 64 kb + { shardParams = ShardParams { totalObjects = 3, neededObjects = 2 } + , objectSize = 1024*64 -- 64 kb , argonOptions = Argon2.HashOptions { Argon2.hashIterations = 10000 , Argon2.hashMemory = 131072 -- 128 mebibtyes per thread @@ -39,7 +42,8 @@ defaultTunables = Tunables -- | Dials back cryptographic difficulty, not for production use. testModeTunables :: Tunables testModeTunables = Tunables - { objectSize = 1024*64 + { shardParams = shardParams { totalObjects = 3, neededObjects = 2 } + , objectSize = 1024*64 , argonOptions = Argon2.defaultHashOptions , argonCost = CPUCost (Seconds (2*600)) , decryptionPuzzleCost = GPUCost (Seconds 60) -- cgit v1.2.3