diff options
Diffstat (limited to 'Compat.hs')
-rw-r--r-- | Compat.hs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1,3 +1,4 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
1 | module Compat where | 2 | module Compat where |
2 | 3 | ||
3 | import Data.Bits | 4 | import Data.Bits |
@@ -7,6 +8,8 @@ import Data.ASN1.Encoding | |||
7 | import Data.ASN1.BinaryEncoding | 8 | import Data.ASN1.BinaryEncoding |
8 | import Crypto.PubKey.RSA as RSA | 9 | import Crypto.PubKey.RSA as RSA |
9 | 10 | ||
11 | #if defined(VERSION_cryptonite) | ||
12 | |||
10 | instance ASN1Object PublicKey where | 13 | instance ASN1Object PublicKey where |
11 | toASN1 pubKey = \xs -> Start Sequence | 14 | toASN1 pubKey = \xs -> Start Sequence |
12 | : IntVal (public_n pubKey) | 15 | : IntVal (public_n pubKey) |
@@ -38,6 +41,7 @@ instance ASN1Object PublicKey where | |||
38 | fromASN1 _ = | 41 | fromASN1 _ = |
39 | Left "fromASN1: RSA.PublicKey: unexpected format" | 42 | Left "fromASN1: RSA.PublicKey: unexpected format" |
40 | 43 | ||
44 | #endif | ||
41 | 45 | ||
42 | toPositive :: Integer -> Integer | 46 | toPositive :: Integer -> Integer |
43 | toPositive int | 47 | toPositive int |