summaryrefslogtreecommitdiffhomepage
path: root/Encryption.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-07 16:28:19 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-07 16:28:19 -0400
commit2ae2ac2e415a7607be21485652fe94c6e63ead91 (patch)
tree7c7ea166d50d3b206937c92023de9e812acf6061 /Encryption.hs
parent39707fda6289740729bef8cb214a2bf3f555b86e (diff)
downloadkeysafe-2ae2ac2e415a7607be21485652fe94c6e63ead91.tar.gz
add names
Diffstat (limited to 'Encryption.hs')
-rw-r--r--Encryption.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Encryption.hs b/Encryption.hs
index a31c004..50fa0fb 100644
--- a/Encryption.hs
+++ b/Encryption.hs
@@ -17,12 +17,13 @@ import qualified Raaz.Cipher.AES as AES
-- | An AES key, which is used to encrypt the key that is stored
-- in keysafe.
data KeyEncryptionKey = KeyEncryptionKey
- AES.KEY256
- (Cost DecryptionOp)
- (CostCalc BruteForceOp UnknownPassword)
+ { keyEncryptionKey :: AES.KEY256
+ , keyDecryptionCost :: Cost DecryptionOp
+ , keyBruteForceCalc :: CostCalc BruteForceOp UnknownPassword
+ }
instance Bruteforceable KeyEncryptionKey UnknownPassword where
- getBruteCostCalc (KeyEncryptionKey _ _ c) = c
+ getBruteCostCalc = keyBruteForceCalc
-- | The ExpensiveHash of the Password is combined with a
-- RandomObstacle to form the AES key. Combination method is logical OR.