diff options
Diffstat (limited to 'Types/Crypto.hs')
-rw-r--r-- | Types/Crypto.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Types/Crypto.hs b/Types/Crypto.hs index ee61d0863..8a15ead16 100644 --- a/Types/Crypto.hs +++ b/Types/Crypto.hs @@ -8,6 +8,7 @@ module Types.Crypto ( Cipher(..), StorableCipher(..), + EncryptedCipherVariant(..), KeyIds(..), Mac(..), readMac, @@ -24,16 +25,11 @@ import Utility.Gpg (KeyIds(..)) -- XXX ideally, this would be a locked memory region newtype Cipher = Cipher String -data StorableCipher = EncryptedCipher String Bool KeyIds - -- ^ The Boolean indicates whether the cipher is used - -- both for symmetric encryption of file content and - -- MAC'ing of file names (True), or only for MAC'ing, - -- while file content is encrypted using public-key - -- crypto (False). In the latter case the cipher is - -- twice as short, but we don't want to rely on that - -- only. +data StorableCipher = EncryptedCipher String EncryptedCipherVariant KeyIds | SharedCipher String deriving (Ord, Eq) +data EncryptedCipherVariant = HybridCipher | PubKeyCipher + deriving (Ord, Eq) {- File names are (client-side) MAC'ed on special remotes. - The chosen MAC algorithm needs to be same for all files stored on the |