summaryrefslogtreecommitdiff
path: root/lib/Compat.hs
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-07-13 15:22:45 -0400
committerAndrew Cady <d@jerkface.net>2019-07-13 15:41:12 -0400
commit006d1f0b7f36c25a91006fce24cbe76416fcee86 (patch)
treebf3e95582edf806677c6aaf56c825ba33c2c2974 /lib/Compat.hs
parent495d9fbac3d633b768d910fced5cf00d00118fa0 (diff)
no cpp needed, since my love is unconditional
Diffstat (limited to 'lib/Compat.hs')
-rw-r--r--lib/Compat.hs5
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/Compat.hs b/lib/Compat.hs
index 3b77851..9c46cb9 100644
--- a/lib/Compat.hs
+++ b/lib/Compat.hs
@@ -1,4 +1,3 @@
1{-# LANGUAGE CPP #-}
2module Compat where 1module Compat where
3 2
4import Data.Bits 3import Data.Bits
@@ -8,8 +7,6 @@ import Data.ASN1.Encoding
8import Data.ASN1.BinaryEncoding 7import Data.ASN1.BinaryEncoding
9import Crypto.PubKey.RSA as RSA 8import Crypto.PubKey.RSA as RSA
10 9
11#if defined(VERSION_cryptonite)
12
13instance ASN1Object PublicKey where 10instance ASN1Object PublicKey where
14 toASN1 pubKey = \xs -> Start Sequence 11 toASN1 pubKey = \xs -> Start Sequence
15 : IntVal (public_n pubKey) 12 : IntVal (public_n pubKey)
@@ -41,8 +38,6 @@ instance ASN1Object PublicKey where
41 fromASN1 _ = 38 fromASN1 _ =
42 Left "fromASN1: RSA.PublicKey: unexpected format" 39 Left "fromASN1: RSA.PublicKey: unexpected format"
43 40
44#endif
45
46toPositive :: Integer -> Integer 41toPositive :: Integer -> Integer
47toPositive int 42toPositive int
48 | int < 0 = uintOfBytes $ bytesOfInt int 43 | int < 0 = uintOfBytes $ bytesOfInt int