From cf445ea944734e3ace1c496c43971f1dfadb9e02 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 1 Aug 2012 19:42:20 +0000 Subject: Move monty_invert to numthry.h and use it in CurveGFp as well --- src/math/ec_gfp/curve_gfp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/math/ec_gfp') diff --git a/src/math/ec_gfp/curve_gfp.h b/src/math/ec_gfp/curve_gfp.h index 9d10c2028..d6c2f2a8c 100644 --- a/src/math/ec_gfp/curve_gfp.h +++ b/src/math/ec_gfp/curve_gfp.h @@ -37,7 +37,7 @@ class BOTAN_DLL CurveGFp { const BigInt r = BigInt::power_of_2(p_words * BOTAN_MP_WORD_BITS); - p_dash = (((r * inverse_mod(r, p)) - 1) / p).word_at(0); + p_dash = monty_inverse(p.word_at(0)); r2 = (r * r) % p; a_r = (a * r) % p; -- cgit v1.2.3