aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/numbertheory/point_gfp.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-02 05:03:45 +0000
committerlloyd <[email protected]>2010-03-02 05:03:45 +0000
commit54a3c5ae67f8b987d05ffd18e2d49a2da1d5988e (patch)
tree99753277eabf7e0d28b2af1c5e32446d984ac31a /src/math/numbertheory/point_gfp.cpp
parentb684176c5967c55f318c517f10900d64d29f9b92 (diff)
Inline some simple PointGFp functions
Diffstat (limited to 'src/math/numbertheory/point_gfp.cpp')
-rw-r--r--src/math/numbertheory/point_gfp.cpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/math/numbertheory/point_gfp.cpp b/src/math/numbertheory/point_gfp.cpp
index 53e1d2ac7..bed08eb39 100644
--- a/src/math/numbertheory/point_gfp.cpp
+++ b/src/math/numbertheory/point_gfp.cpp
@@ -164,14 +164,6 @@ PointGFp& PointGFp::operator*=(const BigInt& scalar)
return *this;
}
-PointGFp& PointGFp::negate()
- {
- if(!is_zero())
- coord_y = curve.get_p() - coord_y;
-
- return *this;
- }
-
// *this *= 2
void PointGFp::mult2()
{
@@ -229,12 +221,6 @@ BigInt PointGFp::get_affine_y() const
return mod_p.multiply(coord_y, inverse_mod(z3, curve.get_p()));
}
-// Is this the point at infinity?
-bool PointGFp::is_zero() const
- {
- return(coord_x.is_zero() && coord_z.is_zero());
- }
-
void PointGFp::check_invariants() const
{
/*
@@ -288,36 +274,6 @@ bool PointGFp::operator==(const PointGFp& other) const
get_curve() == other.get_curve());
}
-// arithmetic operators
-PointGFp operator+(const PointGFp& lhs, PointGFp const& rhs)
- {
- PointGFp tmp(lhs);
- return tmp += rhs;
- }
-
-PointGFp operator-(const PointGFp& lhs, PointGFp const& rhs)
- {
- PointGFp tmp(lhs);
- return tmp -= rhs;
- }
-
-PointGFp operator-(const PointGFp& lhs)
- {
- return PointGFp(lhs).negate();
- }
-
-PointGFp operator*(const BigInt& scalar, const PointGFp& point)
- {
- PointGFp result(point);
- return result *= scalar;
- }
-
-PointGFp operator*(const PointGFp& point, const BigInt& scalar)
- {
- PointGFp result(point);
- return result *= scalar;
- }
-
// encoding and decoding
SecureVector<byte> EC2OSP(const PointGFp& point, byte format)
{