From 7890e78cc6e98fed07bc2ad471b527a2f1b1494f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 7 Aug 2016 00:29:18 -0400 Subject: improve types --- Encryption.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Encryption.hs') diff --git a/Encryption.hs b/Encryption.hs index 98afdfd..23da288 100644 --- a/Encryption.hs +++ b/Encryption.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings, MultiParamTypeClasses #-} module Encryption where @@ -19,6 +19,9 @@ data KeyEncryptionKey = KeyEncryptionKey (Cost DecryptionOp) (CostCalc BruteForceOp UnknownPassword) +instance Bruteforceable KeyEncryptionKey UnknownPassword where + getBruteCostCalc (KeyEncryptionKey _ _ c) = c + -- | The ExpensiveHash of the Password is combined with a -- RandomObstacle to form the AES key. Combination method is logical OR. genKeyEncryptionKey :: Tunables -> KeyIdent -> Password -> KeyEncryptionKey -- cgit v1.2.3