[number] further remove gcde_binary
This commit is contained in:
parent
4bcf193a12
commit
03fe63b05a
@ -32,7 +32,7 @@ import Data.Typeable
|
|||||||
#if MIN_VERSION_integer_gmp(0,5,1)
|
#if MIN_VERSION_integer_gmp(0,5,1)
|
||||||
import GHC.Integer.GMP.Internals
|
import GHC.Integer.GMP.Internals
|
||||||
#else
|
#else
|
||||||
import Crypto.Number.Basic (gcde_binary)
|
import Crypto.Number.Basic (gcde)
|
||||||
import Data.Bits
|
import Data.Bits
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ inverse g m
|
|||||||
inverse g m
|
inverse g m
|
||||||
| d > 1 = Nothing
|
| d > 1 = Nothing
|
||||||
| otherwise = Just (x `mod` m)
|
| otherwise = Just (x `mod` m)
|
||||||
where (x,_,d) = gcde_binary g m
|
where (x,_,d) = gcde g m
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
-- | Compute the modular inverse of 2 coprime numbers.
|
-- | Compute the modular inverse of 2 coprime numbers.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user