summaryrefslogtreecommitdiffhomepage
path: root/Tunables.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-07 17:24:56 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-07 17:24:56 -0400
commit6f2d6120533070ce48bbc1e12465d1f7d603aec8 (patch)
tree29ce41b0999dc9dca388de3304e801d66b547daf /Tunables.hs
parentd2a6fc83a8657329fc2d3d97308801dcc1c9aa48 (diff)
downloadkeysafe-6f2d6120533070ce48bbc1e12465d1f7d603aec8.tar.gz
sharding
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)