diff options
Diffstat (limited to 'src/math/numbertheory/point_gfp.cpp')
-rw-r--r-- | src/math/numbertheory/point_gfp.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/math/numbertheory/point_gfp.cpp b/src/math/numbertheory/point_gfp.cpp index db422c8aa..90885bc94 100644 --- a/src/math/numbertheory/point_gfp.cpp +++ b/src/math/numbertheory/point_gfp.cpp @@ -268,10 +268,15 @@ void PointGFp::swap(PointGFp& other) bool PointGFp::operator==(const PointGFp& other) const { - return (coord_x == other.coord_x && - coord_y == other.coord_y && - coord_z == other.coord_z && - get_curve() == other.get_curve()); + if(get_curve() != other.get_curve()) + return false; + + // If this is zero, only equal if other is also zero + if(is_zero()) + return other.is_zero(); + + return (get_affine_x() == other.get_affine_x() && + get_affine_y() == other.get_affine_y()); } // encoding and decoding |