diff options
author | lloyd <[email protected]> | 2010-02-24 21:59:30 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-02-24 21:59:30 +0000 |
commit | 694e221bab3dd325425318ca01c929907883ec56 (patch) | |
tree | 56a7548792f8f994da5aa86e06050ca8a84afd95 /src/math/gfpmath/point_gfp.h | |
parent | 896fb20a4c2eb6ca0c1b6ff0bfd35cadf1a48e18 (diff) |
Inline small funcs. Remove mult2
Diffstat (limited to 'src/math/gfpmath/point_gfp.h')
-rw-r--r-- | src/math/gfpmath/point_gfp.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h index e413e2311..ea73b9e0d 100644 --- a/src/math/gfpmath/point_gfp.h +++ b/src/math/gfpmath/point_gfp.h @@ -144,19 +144,19 @@ class BOTAN_DLL PointGFp * get the jacobian projective x coordinate * @result jacobian projective x coordinate */ - GFpElement get_jac_proj_x() const; + const GFpElement& get_jac_proj_x() const { return mX; } /** * get the jacobian projective y coordinate * @result jacobian projective y coordinate */ - GFpElement get_jac_proj_y() const; + const GFpElement& get_jac_proj_y() const { return mY; } /** * get the jacobian projective z coordinate * @result jacobian projective z coordinate */ - GFpElement get_jac_proj_z() const; + const GFpElement& get_jac_proj_z() const { return mZ; } /** * Is this the point at infinity? @@ -180,6 +180,10 @@ class BOTAN_DLL PointGFp static GFpElement decompress(bool yMod2, GFpElement const& x, const CurveGFp& curve); + /** + * Equality operator + */ + bool operator==(const PointGFp& other) const; private: CurveGFp mC; mutable GFpElement mX; // NOTE: these values must be mutable (affine<->proj) @@ -188,10 +192,9 @@ class BOTAN_DLL PointGFp }; // relational operators -bool BOTAN_DLL operator==(const PointGFp& lhs, const PointGFp& rhs); inline bool operator!=(const PointGFp& lhs, const PointGFp& rhs ) { - return !operator==(lhs, rhs); + return !(rhs == lhs); } // arithmetic operators @@ -202,8 +205,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 mult2(const PointGFp& point); - PointGFp BOTAN_DLL create_random_point(RandomNumberGenerator& rng, const CurveGFp& curve); |