summaryrefslogtreecommitdiff
path: root/Data/OpenPGP.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2020-05-16 08:32:17 -0400
committerJoe Crayne <joe@jerkface.net>2020-05-19 11:58:22 -0400
commitff5c89ee76c707228afc66afac573c6fd0efffa3 (patch)
tree93b3ab9bcfe674582895eea8c0ce6b9eff88f558 /Data/OpenPGP.hs
parent8fdfd0fc119519041683bc74e9d7a35231728ae3 (diff)
Refactor toward draft-ietf-openpgp-rfc4880bis-09.
Diffstat (limited to 'Data/OpenPGP.hs')
-rw-r--r--Data/OpenPGP.hs7
1 files changed, 0 insertions, 7 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs
index 4133f38..f05f83e 100644
--- a/Data/OpenPGP.hs
+++ b/Data/OpenPGP.hs
@@ -129,9 +129,6 @@ compress algo = toStrictBS . lazyCompress algo . toLazyBS
129decompress :: CompressionAlgorithm -> B.ByteString -> B.ByteString 129decompress :: CompressionAlgorithm -> B.ByteString -> B.ByteString
130decompress algo = toStrictBS . lazyDecompress algo . toLazyBS 130decompress algo = toStrictBS . lazyDecompress algo . toLazyBS
131 131
132toStrictBS :: LZ.ByteString -> B.ByteString
133toStrictBS = B.concat . LZ.toChunks
134
135toLazyBS :: B.ByteString -> LZ.ByteString 132toLazyBS :: B.ByteString -> LZ.ByteString
136toLazyBS = LZ.fromChunks . (:[]) 133toLazyBS = LZ.fromChunks . (:[])
137 134
@@ -194,10 +191,6 @@ pad l s = replicate (l - length s) '0' ++ s
194padBS :: Int -> B.ByteString -> B.ByteString 191padBS :: Int -> B.ByteString -> B.ByteString
195padBS l s = B.replicate (fromIntegral l - B.length s) 0 `B.append` s 192padBS l s = B.replicate (fromIntegral l - B.length s) 0 `B.append` s
196 193
197checksum :: B.ByteString -> Word16
198checksum = fromIntegral .
199 B.foldl (\c i -> (c + fromIntegral i) `mod` 65536) (0::Integer)
200
201data Packet = 194data Packet =
202 AsymmetricSessionKeyPacket { 195 AsymmetricSessionKeyPacket {
203 version :: Word8, 196 version :: Word8,