diff options
author | lloyd <[email protected]> | 2010-02-25 02:15:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-02-25 02:15:27 +0000 |
commit | 082a61a238c4e149b68a0972d34bf9024ec6d0f1 (patch) | |
tree | 0a8abdad828523cd9a371f652108cc2f545c5aff /src | |
parent | 923c0f1be6c1c95b72b415e2624b539ff8485637 (diff) |
Convert the PointGFp constructor taking three coordinates (Jacobian scheme)
to take BigInts instead of GFpElements
Diffstat (limited to 'src')
-rw-r--r-- | src/math/gfpmath/point_gfp.cpp | 12 | ||||
-rw-r--r-- | src/math/gfpmath/point_gfp.h | 11 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/math/gfpmath/point_gfp.cpp b/src/math/gfpmath/point_gfp.cpp index baefac438..86bf82f61 100644 --- a/src/math/gfpmath/point_gfp.cpp +++ b/src/math/gfpmath/point_gfp.cpp @@ -48,12 +48,14 @@ PointGFp::PointGFp(const CurveGFp& curve) : } // construct a point given its jacobian projective coordinates -PointGFp::PointGFp(const CurveGFp& curve, const GFpElement& x, - const GFpElement& y, const GFpElement& z) : +PointGFp::PointGFp(const CurveGFp& curve, + const BigInt& x, + const BigInt& y, + const BigInt& z) : mC(curve), - mX(x), - mY(y), - mZ(z) + mX(curve.get_p(), x), + mY(curve.get_p(), y), + mZ(curve.get_p(), z) { } diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h index 4e0b9a76b..e9645d5db 100644 --- a/src/math/gfpmath/point_gfp.h +++ b/src/math/gfpmath/point_gfp.h @@ -17,7 +17,8 @@ namespace Botan { struct BOTAN_DLL Illegal_Point : public Exception { - Illegal_Point(const std::string& err = "") : Exception(err) {} + Illegal_Point(const std::string& err = "Malformed ECP point detected") : + Exception(err) {} }; /** @@ -51,12 +52,12 @@ class BOTAN_DLL PointGFp * @param curve the base curve * @param x jacobian projective x coordinate * @param y jacobian projective y coordinate - * @param z jacobian projective y coordinate + * @param z jacobian projective z coordinate */ PointGFp(const CurveGFp& curve, - const GFpElement& x, - const GFpElement& y, - const GFpElement& z); + const BigInt& x, + const BigInt& y, + const BigInt& z); //PointGFp(const PointGFp& other) = default; //PointGFp& operator=(const PointGFp& other) = default; |