summaryrefslogtreecommitdiffhomepage
path: root/Tunables.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Tunables.hs')
-rw-r--r--Tunables.hs8
1 files changed, 6 insertions, 2 deletions
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)