diff options
Diffstat (limited to 'Types.hs')
-rw-r--r-- | Types.hs | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -15,28 +15,29 @@ import Control.DeepSeq -- | keysafe stores secret keys. newtype SecretKey = SecretKey B.ByteString --- | The secret key, encrypted with a password. -data EncryptedSecretKey = EncryptedSecretKey B.ByteString (CostCalc BruteForceOp UnknownPassword) +-- | The secret key, encrypted with a password, in fixed size chunks. +data EncryptedSecretKey = EncryptedSecretKey [B.ByteString] (CostCalc BruteForceOp UnknownPassword) instance NFData EncryptedSecretKey where - rnf (EncryptedSecretKey bs _) = rnf bs + rnf (EncryptedSecretKey cs _) = rnf cs instance Show EncryptedSecretKey where - show (EncryptedSecretKey bs _) = show bs + show (EncryptedSecretKey cs _) = show cs instance Bruteforceable EncryptedSecretKey UnknownPassword where getBruteCostCalc (EncryptedSecretKey _ cc) = cc -- | An object in a form suitable to be stored on a keysafe server. newtype StorableObject = StorableObject { fromStorableObject :: B.ByteString } - deriving (Show) + deriving (Show, Eq, Ord) -- | An identifier for a StorableObject newtype StorableObjectIdent = StorableObjectIdent B.ByteString - deriving (Show, NFData) + deriving (Show, Eq, Ord, NFData) -- | A Shamir secret share, with a known number (N of M). data Share = Share ShareNum StorableObject + deriving (Eq, Ord) type ShareNum = Int |