diff options
author | Joe Crayne <joe@jerkface.net> | 2020-05-16 08:32:17 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-05-19 11:58:22 -0400 |
commit | ff5c89ee76c707228afc66afac573c6fd0efffa3 (patch) | |
tree | 93b3ab9bcfe674582895eea8c0ce6b9eff88f558 /Data/OpenPGP/Util/Decrypt.hs | |
parent | 8fdfd0fc119519041683bc74e9d7a35231728ae3 (diff) |
Refactor toward draft-ietf-openpgp-rfc4880bis-09.
Diffstat (limited to 'Data/OpenPGP/Util/Decrypt.hs')
-rw-r--r-- | Data/OpenPGP/Util/Decrypt.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Data/OpenPGP/Util/Decrypt.hs b/Data/OpenPGP/Util/Decrypt.hs index 84bead5..637d754 100644 --- a/Data/OpenPGP/Util/Decrypt.hs +++ b/Data/OpenPGP/Util/Decrypt.hs | |||
@@ -14,7 +14,7 @@ import Data.OpenPGP.Util.Base | |||
14 | 14 | ||
15 | -- decryption codec for withS2K | 15 | -- decryption codec for withS2K |
16 | simpleUnCFB :: (Vincent.BlockCipher k) => k -> Vincent.IV k -> LZ.ByteString -> LZ.ByteString | 16 | simpleUnCFB :: (Vincent.BlockCipher k) => k -> Vincent.IV k -> LZ.ByteString -> LZ.ByteString |
17 | simpleUnCFB k iv = padThenUnpad k (toLazyBS . Vincent.cfbDecrypt k iv . toStrictBS) | 17 | simpleUnCFB k iv = padThenUnpad k (toLazyBS . Vincent.cfbDecrypt k iv . LZ.toStrict) |
18 | 18 | ||
19 | withS2K' :: OpenPGP.SymmetricAlgorithm -> Maybe OpenPGP.S2K -> LZ.ByteString | 19 | withS2K' :: OpenPGP.SymmetricAlgorithm -> Maybe OpenPGP.S2K -> LZ.ByteString |
20 | -> (forall b. Vincent.BlockCipher b => b -> x) -> x | 20 | -> (forall b. Vincent.BlockCipher b => b -> x) -> x |
@@ -29,7 +29,7 @@ string2key ms2k s = cipher | |||
29 | where | 29 | where |
30 | #if defined(VERSION_cryptonite) | 30 | #if defined(VERSION_cryptonite) |
31 | CryptoPassed cipher = Vincent.cipherInit k | 31 | CryptoPassed cipher = Vincent.cipherInit k |
32 | k = toStrictBS $ LZ.take ksize $ maybe s (\s2k -> OpenPGP.string2key hashBySymbol s2k s) ms2k | 32 | k = LZ.toStrict $ LZ.take ksize $ maybe s (\s2k -> OpenPGP.string2key hashBySymbol s2k s) ms2k |
33 | #else | 33 | #else |
34 | cipher = Vincent.cipherInit k | 34 | cipher = Vincent.cipherInit k |
35 | Right k = Vincent.makeKey $ toStrictBS $ | 35 | Right k = Vincent.makeKey $ toStrictBS $ |