summaryrefslogtreecommitdiff
path: root/lib/Transforms.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms.hs')
-rw-r--r--lib/Transforms.hs19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/Transforms.hs b/lib/Transforms.hs
index 7a676b0..3e13b1a 100644
--- a/lib/Transforms.hs
+++ b/lib/Transforms.hs
@@ -1,4 +1,3 @@
1{-# LANGUAGE CPP #-}
2{-# LANGUAGE DoAndIfThenElse #-} 1{-# LANGUAGE DoAndIfThenElse #-}
3{-# LANGUAGE OverloadedStrings #-} 2{-# LANGUAGE OverloadedStrings #-}
4{-# LANGUAGE PatternGuards #-} 3{-# LANGUAGE PatternGuards #-}
@@ -26,20 +25,10 @@ import qualified Data.ByteString as S
26import qualified Data.ByteString.Lazy as L 25import qualified Data.ByteString.Lazy as L
27import qualified Data.ByteString.Lazy.Char8 as Char8 26import qualified Data.ByteString.Lazy.Char8 as Char8
28import qualified Data.Map.Strict as Map 27import qualified Data.Map.Strict as Map
29#if defined(VERSION_memory)
30import qualified Data.ByteString.Char8 as S8 28import qualified Data.ByteString.Char8 as S8
31import Data.ByteArray.Encoding 29import Data.ByteArray.Encoding
32#elif defined(VERSION_dataenc)
33import qualified Codec.Binary.Base32 as Base32
34import qualified Codec.Binary.Base64 as Base64
35#endif
36#if !defined(VERSION_cryptonite)
37import qualified Crypto.Hash.SHA1 as SHA1
38import qualified Crypto.Types.PubKey.ECC as ECC
39#else
40import qualified Crypto.Hash as Vincent 30import qualified Crypto.Hash as Vincent
41import Data.ByteArray (convert) 31import Data.ByteArray (convert)
42#endif
43import Data.ASN1.BinaryEncoding ( DER(..) ) 32import Data.ASN1.BinaryEncoding ( DER(..) )
44import Data.ASN1.Types (toASN1, ASN1Object, fromASN1, ASN1(Start, End, IntVal), ASN1ConstructionType(Sequence) ) 33import Data.ASN1.Types (toASN1, ASN1Object, fromASN1, ASN1(Start, End, IntVal), ASN1ConstructionType(Sequence) )
45 34
@@ -665,16 +654,8 @@ derToBase32 :: L.ByteString -> String
665derToBase32 = map toLower . base32 . sha1 654derToBase32 = map toLower . base32 . sha1
666 where 655 where
667 sha1 :: L.ByteString -> S.ByteString 656 sha1 :: L.ByteString -> S.ByteString
668#if !defined(VERSION_cryptonite)
669 sha1 = SHA1.hashlazy
670#else
671 sha1 x = convert (Vincent.hashlazy x :: Vincent.Digest Vincent.SHA1) 657 sha1 x = convert (Vincent.hashlazy x :: Vincent.Digest Vincent.SHA1)
672#endif
673#if defined(VERSION_memory)
674 base32 = S8.unpack . convertToBase Base32 658 base32 = S8.unpack . convertToBase Base32
675#elif defined(VERSION_dataenc)
676 base32 = Base32.encode . S.unpack
677#endif
678 659
679derRSA :: Packet -> Maybe L.ByteString 660derRSA :: Packet -> Maybe L.ByteString
680derRSA rsa = do 661derRSA rsa = do