diff options
author | Jack Lloyd <[email protected]> | 2018-03-12 06:41:08 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-12 06:41:08 -0400 |
commit | 86b497e821569ce2eb061720524d982c83b90b97 (patch) | |
tree | 4910a3de927468b13f61df12c2f31f29e60d03cd /src | |
parent | 88b65c609f1db6e6df2efca9143a6d03b4eeb291 (diff) |
Tweaks to force_all_affine
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/pubkey/ec_group/point_gfp.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/pubkey/ec_group/point_gfp.cpp b/src/lib/pubkey/ec_group/point_gfp.cpp index 47ca0527d..587b2a842 100644 --- a/src/lib/pubkey/ec_group/point_gfp.cpp +++ b/src/lib/pubkey/ec_group/point_gfp.cpp @@ -463,18 +463,16 @@ void PointGFp::force_all_affine(std::vector<PointGFp>& points) secure_vector<word> ws; - std::vector<BigInt> c; - - c.push_back(points[0].m_coord_z); - - BigInt rep_1 = 1; - const CurveGFp& curve = points[0].m_curve; + BigInt rep_1 = 1; curve.to_rep(rep_1, ws); + std::vector<BigInt> c(points.size()); + c[0] = points[0].m_coord_z; + for(size_t i = 1; i != points.size(); ++i) { - c.push_back(curve.mul_to_tmp(c[i-1], points[i].m_coord_z, ws)); + curve.mul(c[i], c[i-1], points[i].m_coord_z, ws); } BigInt s_inv = curve.invert_element(c[c.size()-1], ws); |