[number] further remove gcde_binary

This commit is contained in:
Vincent Hanquez 2015-05-11 07:10:38 +01:00
parent 47afc1720d
commit 4bcf193a12
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ module Crypto.Number.Prime
import Crypto.Internal.Imports
import Crypto.Number.Generate
import Crypto.Number.Basic (sqrti, gcde_binary)
import Crypto.Number.Basic (sqrti, gcde)
import Crypto.Number.ModArithmetic (exponantiation)
import Crypto.Random.Types
@ -175,7 +175,7 @@ primalityTestNaive n
-- | Test is two integer are coprime to each other
isCoprime :: Integer -> Integer -> Bool
isCoprime m n = case gcde_binary m n of (_,_,d) -> d == 1
isCoprime m n = case gcde m n of (_,_,d) -> d == 1
-- | list of the first primes till 2903..
firstPrimes :: [Integer]

View File

@ -38,7 +38,7 @@ import Crypto.Internal.Imports
import Crypto.Number.ModArithmetic (expSafe, expFast, inverse)
import Crypto.Number.Generate (generateMax)
import Crypto.Number.Serialize (os2ip)
import Crypto.Number.Basic (gcde_binary)
import Crypto.Number.Basic (gcde)
import Crypto.Random.Types
import Crypto.PubKey.HashDescr (HashFunction)
import Crypto.PubKey.DH (PrivateNumber(..), PublicNumber(..), Params(..), SharedKey(..))
@ -108,7 +108,7 @@ signWith k (Params p g) (PrivateNumber x) hashF msg
where r = expSafe g k p
h = os2ip $ hashF msg
s = ((h - x*r) * kInv) `mod` (p-1)
(kInv,_,d) = gcde_binary k (p-1)
(kInv,_,d) = gcde k (p-1)
-- | sign message
--