diff options
author | Óscar Nájera <hi@oscarnajera.com> | 2021-07-06 20:50:35 +0200 |
---|---|---|
committer | Óscar Nájera <hi@oscarnajera.com> | 2021-07-06 20:50:35 +0200 |
commit | f997c04eb1dcdcdf9b4cccccaa38f816d9c5c449 (patch) | |
tree | a15484d99099310dc8f10377db010146f8b60c49 | |
parent | 226740b45a5a94811404f4fabfb09f0100ddf61f (diff) | |
download | programmingbitcoin-f997c04eb1dcdcdf9b4cccccaa38f816d9c5c449.tar.gz programmingbitcoin-f997c04eb1dcdcdf9b4cccccaa38f816d9c5c449.tar.bz2 programmingbitcoin-f997c04eb1dcdcdf9b4cccccaa38f816d9c5c449.zip |
remove fromRational implementation as not really defined
-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 |