diff options
-rw-r--r-- | ecc.hs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |