diff options
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/gfpmath/point_gfp.cpp | 62 | ||||
-rw-r--r-- | src/math/gfpmath/point_gfp.h | 20 |
2 files changed, 0 insertions, 82 deletions
diff --git a/src/math/gfpmath/point_gfp.cpp b/src/math/gfpmath/point_gfp.cpp index 4b2de7913..f1d38f5fd 100644 --- a/src/math/gfpmath/point_gfp.cpp +++ b/src/math/gfpmath/point_gfp.cpp @@ -140,60 +140,6 @@ PointGFp& PointGFp::operator-=(const PointGFp& rhs) return *this; } -PointGFp& PointGFp::mult_this_secure(const BigInt& scalar, - const BigInt& /*point_order*/, - const BigInt& /*max_secr*/) - { - // NOTE: FS: so far this is code duplication of op*=. - // we have to see how we deal with this. - // fact is that we will probably modify this function - // while evaluating the countermeasures - // whereas we probably will not start modifying the - // function operator*=. - // however, in the end both should be merged. - - // use montgomery mult. in this operation - this->turn_on_sp_red_mul(); - - PointGFp H(mC); - - PointGFp P(*this); - BigInt m(scalar); - - if(m < BigInt(0)) - { - m = -m; - P.negate(); - } - if(P.is_zero() || (m == BigInt(0))) - { - *this = H; - return *this; - } - if(m == BigInt(1)) - return *this; - - int mul_bits = m.bits(); - - for(int i = mul_bits - 1; i >= 0; i--) - { - H.mult2_in_place(); - - if(m.get_bit(i)) - H += P; - } - - if(!H.is_zero()) // cannot convert if H == O - *this = H.get_z_to_one(); - else - *this = H; - - mX.turn_off_sp_red_mul(); - mY.turn_off_sp_red_mul(); - mZ.turn_off_sp_red_mul(); - return *this; - } - PointGFp& PointGFp::operator*=(const BigInt& scalar) { // use montgomery mult. in this operation @@ -497,14 +443,6 @@ PointGFp operator*(const PointGFp& point, const BigInt& scalar) return result *= scalar; } -PointGFp mult_point_secure(const PointGFp& point, const BigInt& scalar, - const BigInt& point_order, const BigInt& max_secret) - { - PointGFp result(point); - result.mult_this_secure(scalar, point_order, max_secret); - return result; - } - // encoding and decoding SecureVector<byte> EC2OSP(const PointGFp& point, byte format) { diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h index 276635f56..08de259af 100644 --- a/src/math/gfpmath/point_gfp.h +++ b/src/math/gfpmath/point_gfp.h @@ -96,22 +96,6 @@ class BOTAN_DLL PointGFp PointGFp& operator*=(const BigInt& scalar); /** - * the equivalent to operator*= with countermeasures against - * sidechannel attacks, using the randomized exponent - * and add-and-double-always - * countermeasures (suitable for ECDSA and ECKAEG) - * @param scalar the scalar to multiply the point with - * @param point_order a multiple of the order of the point - *(= n * k in the general case; k is the cofactor) - * @param max_secr the maximal size of the scalar - * (will usually be n-1 ) - * @result resulting PointGFp - */ - PointGFp& mult_this_secure(const BigInt& scalar, - const BigInt& point_order, - const BigInt& max_secr); - - /** * Negate internal value(*this *= -1 ) * @return *this */ @@ -225,10 +209,6 @@ PointGFp BOTAN_DLL operator-(const PointGFp& lhs); PointGFp BOTAN_DLL operator*(const BigInt& scalar, const PointGFp& point); PointGFp BOTAN_DLL operator*(const PointGFp& point, const BigInt& scalar); -PointGFp BOTAN_DLL mult_point_secure(const PointGFp& point, - const BigInt& scalar, - const BigInt& point_order, - const BigInt& max_secret); PointGFp BOTAN_DLL mult2(const PointGFp& point); |