diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-16 12:57:19 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-16 13:04:07 -0400 |
commit | 3b4a775d536b2b2956269a59f886487efe29ed51 (patch) | |
tree | bbd8fd580afad11f822b2929061b034abf376c50 /Cost.hs | |
parent | d7696832e183cc3e98d094b35ee4392d0c8d3df5 (diff) | |
download | keysafe-3b4a775d536b2b2956269a59f886487efe29ed51.tar.gz |
switch to random salt byte to make decryption expensive
Diffstat (limited to 'Cost.hs')
-rw-r--r-- | Cost.hs | 9 |
1 files changed, 0 insertions, 9 deletions
@@ -15,24 +15,15 @@ import Types.Cost -- | Cost in seconds, with the type of hardware needed. totalCost :: Cost op -> (Seconds, [UsingHardware]) totalCost (CPUCost s) = (s, [UsingCPU]) -totalCost (GPUCost s) = (s, [UsingGPU]) -totalCost (CombinedCost a b) = - let (s1, h1) = totalCost a - (s2, h2) = totalCost b - in (s1+s2, h1++h2) raiseCostPower :: Cost c -> Entropy e -> Cost c raiseCostPower c (Entropy e) = adjustCost c (* 2^e) adjustCost :: Cost c -> (Seconds -> Seconds) -> Cost c adjustCost (CPUCost s) f = CPUCost (f s) -adjustCost (GPUCost s) f = GPUCost (f s) -adjustCost (CombinedCost a b) f = CombinedCost (adjustCost a f) (adjustCost b f) castCost :: Cost a -> Cost b castCost (CPUCost s) = CPUCost s -castCost (GPUCost s) = GPUCost s -castCost (CombinedCost a b) = CombinedCost (castCost a) (castCost b) -- | CostCalc for a brute force linear search through an entropy space -- in which each step entails paying a cost. |