small fixes

This commit is contained in:
Mamy André-Ratsimbazafy 2020-09-27 21:24:54 +02:00
parent 00fa1ea7b6
commit 39ac014dfe
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
3 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import
../config/[common, type_bigint], ../config/[common, type_bigint],
../primitives, ../primitives,
./limbs, ./limbs,
./limbs_generic_modular, ./limbs_modular,
./limbs_montgomery ./limbs_montgomery
export BigInt export BigInt

View File

@ -19,13 +19,13 @@ export zoo_inversions
# #
# ############################################################ # ############################################################
func inv_euclid*(r: var Fp, a: Fp) = func inv_euclid*(r: var Fp, a: Fp) {.inline.} =
## Inversion modulo p via ## Inversion modulo p via
## Niels Moller constant-time version of ## Niels Moller constant-time version of
## Stein's GCD derived from extended binary Euclid algorithm ## Stein's GCD derived from extended binary Euclid algorithm
r.mres.steinsGCD(a.mres, Fp.C.getR2modP(), Fp.C.Mod, Fp.C.getPrimePlus1div2()) r.mres.steinsGCD(a.mres, Fp.C.getR2modP(), Fp.C.Mod, Fp.C.getPrimePlus1div2())
func inv*(r: var Fp, a: Fp) = func inv*(r: var Fp, a: Fp) {.inline.} =
## Inversion modulo p ## Inversion modulo p
## ##
## The inverse of 0 is 0. ## The inverse of 0 is 0.
@ -41,7 +41,7 @@ func inv*(r: var Fp, a: Fp) =
else: else:
r.inv_euclid(a) r.inv_euclid(a)
func inv*(a: var Fp) = func inv*(a: var Fp) {.inline.} =
## Inversion modulo p ## Inversion modulo p
## ##
## The inverse of 0 is 0. ## The inverse of 0 is 0.