From f997c04eb1dcdcdf9b4cccccaa38f816d9c5c449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Tue, 6 Jul 2021 20:50:35 +0200 Subject: remove fromRational implementation as not really defined --- ecc.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ecc.hs') diff --git a/ecc.hs b/ecc.hs index 83a9fb1..17029b6 100644 --- a/ecc.hs +++ b/ecc.hs @@ -6,7 +6,7 @@ import Data.Bits import Data.Proxy -import Data.Ratio (denominator, numerator) +--import Data.Ratio (denominator, numerator) import GHC.TypeLits import Text.Printf (PrintfArg, printf) @@ -24,7 +24,7 @@ instance KnownNat n => Num (FieldElement n) where instance KnownNat n => Fractional (FieldElement n) where recip a = a ^ (n - 2) where n = natVal (Proxy :: Proxy n) - fromRational r = fromInteger (numerator r) / fromInteger (denominator r) + fromRational r = error "cant transform" -- fromInteger (numerator r) / fromInteger (denominator r) instance KnownNat n => Show (FieldElement n) where show (FieldElement a) | n == (2 ^ 256 - 2 ^ 32 - 977) = printf "0x%064x" a -- cgit v1.2.3