small fixes
This commit is contained in:
parent
00fa1ea7b6
commit
39ac014dfe
|
@ -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
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue