diff options
Diffstat (limited to 'Data/OpenPGP.hs')
-rw-r--r-- | Data/OpenPGP.hs | 7 |
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 | |||
129 | decompress :: CompressionAlgorithm -> B.ByteString -> B.ByteString | 129 | decompress :: CompressionAlgorithm -> B.ByteString -> B.ByteString |
130 | decompress algo = toStrictBS . lazyDecompress algo . toLazyBS | 130 | decompress algo = toStrictBS . lazyDecompress algo . toLazyBS |
131 | 131 | ||
132 | toStrictBS :: LZ.ByteString -> B.ByteString | ||
133 | toStrictBS = B.concat . LZ.toChunks | ||
134 | |||
135 | toLazyBS :: B.ByteString -> LZ.ByteString | 132 | toLazyBS :: B.ByteString -> LZ.ByteString |
136 | toLazyBS = LZ.fromChunks . (:[]) | 133 | toLazyBS = LZ.fromChunks . (:[]) |
137 | 134 | ||
@@ -194,10 +191,6 @@ pad l s = replicate (l - length s) '0' ++ s | |||
194 | padBS :: Int -> B.ByteString -> B.ByteString | 191 | padBS :: Int -> B.ByteString -> B.ByteString |
195 | padBS l s = B.replicate (fromIntegral l - B.length s) 0 `B.append` s | 192 | padBS l s = B.replicate (fromIntegral l - B.length s) 0 `B.append` s |
196 | 193 | ||
197 | checksum :: B.ByteString -> Word16 | ||
198 | checksum = fromIntegral . | ||
199 | B.foldl (\c i -> (c + fromIntegral i) `mod` 65536) (0::Integer) | ||
200 | |||
201 | data Packet = | 194 | data Packet = |
202 | AsymmetricSessionKeyPacket { | 195 | AsymmetricSessionKeyPacket { |
203 | version :: Word8, | 196 | version :: Word8, |