diff options
Diffstat (limited to 'Types/Crypto.hs')
-rw-r--r-- | Types/Crypto.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Types/Crypto.hs b/Types/Crypto.hs index e97d02ba8..1a9a7774a 100644 --- a/Types/Crypto.hs +++ b/Types/Crypto.hs @@ -8,6 +8,7 @@ module Types.Crypto ( Cipher(..), StorableCipher(..), + EncryptedCipherVariant(..), KeyIds(..), Mac(..), readMac, @@ -22,9 +23,12 @@ import Data.Digest.Pure.SHA import Utility.Gpg (KeyIds(..)) -- XXX ideally, this would be a locked memory region -newtype Cipher = Cipher String +data Cipher = Cipher String | MacOnlyCipher String -data StorableCipher = EncryptedCipher String KeyIds | SharedCipher String +data StorableCipher = EncryptedCipher String EncryptedCipherVariant KeyIds + | SharedCipher String + deriving (Ord, Eq) +data EncryptedCipherVariant = Hybrid | PubKey deriving (Ord, Eq) {- File names are (client-side) MAC'ed on special remotes. @@ -66,4 +70,4 @@ calcMac mac = case mac of HmacSha384 -> showDigest $* hmacSha384 HmacSha512 -> showDigest $* hmacSha512 where - ($*) g f x y = g $ f x y + ($*) g f x y = g $ f x y |