diff options
author | Jack Lloyd <[email protected]> | 2018-03-08 10:28:09 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-08 10:28:09 -0500 |
commit | eb5d581724bc17dbdfdeb8e9b49326b00b1af8c6 (patch) | |
tree | a5eb62bc118a93356b993d21b5da62c012d0ea65 | |
parent | a1654b5b4780bc74e4e86ea8076918b4378e47d2 (diff) |
Require explicit calls to add_affine
Skipping the checks saves 3-7% for ECDSA
-rw-r--r-- | src/lib/pubkey/ec_group/point_gfp.cpp | 5 | ||||
-rw-r--r-- | src/lib/pubkey/ec_group/point_mul.cpp | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/pubkey/ec_group/point_gfp.cpp b/src/lib/pubkey/ec_group/point_gfp.cpp index 7968d2dcd..6c7925367 100644 --- a/src/lib/pubkey/ec_group/point_gfp.cpp +++ b/src/lib/pubkey/ec_group/point_gfp.cpp @@ -76,7 +76,7 @@ void PointGFp::add_affine(const PointGFp& rhs, std::vector<BigInt>& ws_bn) return; } - BOTAN_ASSERT(rhs.is_affine(), "PointGFp::add_affine requires arg be affine point"); + //BOTAN_ASSERT(rhs.is_affine(), "PointGFp::add_affine requires arg be affine point"); /* https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-1998-cmo-2 @@ -167,9 +167,6 @@ void PointGFp::add(const PointGFp& rhs, std::vector<BigInt>& ws_bn) if(rhs.is_zero()) return; - if(rhs.is_affine()) - return this->add_affine(rhs, ws_bn); - if(is_zero()) { m_coord_x = rhs.m_coord_x; diff --git a/src/lib/pubkey/ec_group/point_mul.cpp b/src/lib/pubkey/ec_group/point_mul.cpp index 2a63a8221..132057643 100644 --- a/src/lib/pubkey/ec_group/point_mul.cpp +++ b/src/lib/pubkey/ec_group/point_mul.cpp @@ -88,7 +88,7 @@ PointGFp PointGFp_Base_Point_Precompute::mul(const BigInt& k, } if(scalar.get_bit(i)) - R.add(m_T[i], ws); + R.add_affine(m_T[i], ws); } return R; |