diff options
author | lloyd <[email protected]> | 2014-04-13 19:20:36 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-04-13 19:20:36 +0000 |
commit | 340cc7f520ef95aeb7a4692357b870003dd7f0f8 (patch) | |
tree | 28c9c1dfb02e99b2c378aae142b8e1e9a83ec276 /src/lib/math/ec_gfp | |
parent | c30ff3c1b1308346de33397ab282d1f2831d0936 (diff) |
Use 20 Miller-Rabin iterations regardless of the size of the integer. This
provides a much better worst-case error bound. Also take the nonce from anywhere
in the usable range rather than limiting the bit size.
Diffstat (limited to 'src/lib/math/ec_gfp')
-rw-r--r-- | src/lib/math/ec_gfp/point_gfp.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/math/ec_gfp/point_gfp.cpp b/src/lib/math/ec_gfp/point_gfp.cpp index 9cd5a2aaf..cf3a204d6 100644 --- a/src/lib/math/ec_gfp/point_gfp.cpp +++ b/src/lib/math/ec_gfp/point_gfp.cpp @@ -196,7 +196,8 @@ void PointGFp::mult2(std::vector<BigInt>& ws_bn) monty_sqr(z4, monty_sqr(coord_z)); monty_mult(a_z4, curve.get_a_r(), z4); - M = 3 * monty_sqr(coord_x); + M = monty_sqr(coord_x); + M *= 3; M += a_z4; while(M >= p) M -= p; |