aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/gfpmath/point_gfp.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-02-24 15:46:01 +0000
committerlloyd <[email protected]>2010-02-24 15:46:01 +0000
commitb06a941a98f49172b203914810483589cf86cc76 (patch)
tree60185833656de660a4d31556b98d0170b56a1e5b /src/math/gfpmath/point_gfp.cpp
parent83a0887fb47633522be1512a9b85a22769eba564 (diff)
Remove PointGFp::mult_this_secure
Diffstat (limited to 'src/math/gfpmath/point_gfp.cpp')
-rw-r--r--src/math/gfpmath/point_gfp.cpp62
1 files changed, 0 insertions, 62 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)
{