diff options
author | lloyd <[email protected]> | 2010-02-25 02:06:53 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-02-25 02:06:53 +0000 |
commit | 923c0f1be6c1c95b72b415e2624b539ff8485637 (patch) | |
tree | 7ab078343516d109bc13909097d5d5a3eb7b9416 /src | |
parent | 2d1dd244a6714687c97736a809e9dd31f506306c (diff) |
Convert PointGFp::get_jac_proj_{x,y,z} to return just the BigInt value,
not a GFpElement
Diffstat (limited to 'src')
-rw-r--r-- | src/math/gfpmath/point_gfp.cpp | 13 | ||||
-rw-r--r-- | src/math/gfpmath/point_gfp.h | 6 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/math/gfpmath/point_gfp.cpp b/src/math/gfpmath/point_gfp.cpp index f76853085..baefac438 100644 --- a/src/math/gfpmath/point_gfp.cpp +++ b/src/math/gfpmath/point_gfp.cpp @@ -61,24 +61,23 @@ PointGFp::PointGFp(const CurveGFp& curve, const BigInt& x, const BigInt& y) : mC(curve), - mX(curve.get_p(),x), - mY(curve.get_p(),y), - mZ(curve.get_p(),1) + mX(curve.get_p(), x), + mY(curve.get_p(), y), + mZ(curve.get_p(), 1) { } // arithmetic operators PointGFp& PointGFp::operator+=(const PointGFp& rhs) { + if(rhs.is_zero()) + return *this; + if(is_zero()) { *this = rhs; return *this; } - if(rhs.is_zero()) - { - return *this; - } GFpElement U1 = mX; GFpElement S1 = mY; diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h index 9f29896cb..4e0b9a76b 100644 --- a/src/math/gfpmath/point_gfp.h +++ b/src/math/gfpmath/point_gfp.h @@ -133,19 +133,19 @@ class BOTAN_DLL PointGFp * get the jacobian projective x coordinate * @result jacobian projective x coordinate */ - const GFpElement& get_jac_proj_x() const { return mX; } + const BigInt& get_jac_proj_x() const { return mX.get_value(); } /** * get the jacobian projective y coordinate * @result jacobian projective y coordinate */ - const GFpElement& get_jac_proj_y() const { return mY; } + const BigInt& get_jac_proj_y() const { return mY.get_value(); } /** * get the jacobian projective z coordinate * @result jacobian projective z coordinate */ - const GFpElement& get_jac_proj_z() const { return mZ; } + const BigInt& get_jac_proj_z() const { return mZ.get_value(); } /** * Is this the point at infinity? |