From 3b4a775d536b2b2956269a59f886487efe29ed51 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Aug 2016 12:57:19 -0400 Subject: switch to random salt byte to make decryption expensive --- Types/Cost.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Types') diff --git a/Types/Cost.hs b/Types/Cost.hs index a6a1160..290fa25 100644 --- a/Types/Cost.hs +++ b/Types/Cost.hs @@ -12,8 +12,6 @@ import Utility.HumanTime -- | An estimated cost to perform an operation. data Cost op = CPUCost Seconds -- ^ using 1 CPU core - | GPUCost Seconds - | CombinedCost (Cost op) (Cost op) deriving (Show) unknownCost :: Cost op @@ -32,9 +30,9 @@ instance Monoid (Cost t) where mempty = CPUCost (Seconds 0) CPUCost (Seconds a) `mappend` CPUCost (Seconds b) = CPUCost (Seconds (a+b)) - GPUCost (Seconds a) `mappend` GPUCost (Seconds b) = - GPUCost (Seconds (a+b)) - a `mappend` b = CombinedCost a b + +mapCost :: (Integer -> Integer) -> Cost op -> Cost op +mapCost f (CPUCost (Seconds n)) = CPUCost (Seconds (f n)) -- | Operations whose cost can be measured. data DecryptionOp -- cgit v1.2.3