Botan
1.10.9
|
#include <point_gfp.h>
Public Types | |
enum | Compression_Type { UNCOMPRESSED = 0, COMPRESSED = 1, HYBRID = 2 } |
Public Member Functions | |
BigInt | get_affine_x () const |
BigInt | get_affine_y () const |
const CurveGFp & | get_curve () const |
bool | is_zero () const |
PointGFp & | negate () |
bool | on_the_curve () const |
PointGFp & | operator*= (const BigInt &scalar) |
PointGFp & | operator+= (const PointGFp &rhs) |
PointGFp & | operator-= (const PointGFp &rhs) |
bool | operator== (const PointGFp &other) const |
PointGFp () | |
PointGFp (const CurveGFp &curve) | |
PointGFp (const CurveGFp &curve, const BigInt &x, const BigInt &y) | |
void | swap (PointGFp &other) |
Friends | |
BOTAN_DLL PointGFp | multi_exponentiate (const PointGFp &p1, const BigInt &z1, const PointGFp &p2, const BigInt &z2) |
BOTAN_DLL PointGFp | operator* (const BigInt &scalar, const PointGFp &point) |
This class represents one point on a curve of GF(p)
Definition at line 41 of file point_gfp.h.
Enumerator | |
---|---|
UNCOMPRESSED | |
COMPRESSED | |
HYBRID |
Definition at line 44 of file point_gfp.h.
|
inline |
Construct an uninitialized PointGFp
Definition at line 53 of file point_gfp.h.
Referenced by operator-=().
Botan::PointGFp::PointGFp | ( | const CurveGFp & | curve | ) |
Construct the zero point
curve | The base curve |
Definition at line 17 of file point_gfp.cpp.
References Botan::CurveGFp::get_r2().
Construct a point from its affine coordinates
curve | the base curve |
x | affine x coordinate |
y | affine y coordinate |
Definition at line 25 of file point_gfp.cpp.
References Botan::CurveGFp::get_r2().
BigInt Botan::PointGFp::get_affine_x | ( | ) | const |
get affine x coordinate
Definition at line 392 of file point_gfp.cpp.
References Botan::CurveGFp::get_p(), Botan::CurveGFp::get_r2(), Botan::inverse_mod(), and is_zero().
Referenced by Botan::ECDH_KA_Operation::agree(), Botan::EC2OSP(), operator==(), Botan::ECDSA_Signature_Operation::sign(), Botan::GOST_3410_Signature_Operation::sign(), Botan::ECDSA_Verification_Operation::verify(), Botan::GOST_3410_Verification_Operation::verify(), and Botan::GOST_3410_PublicKey::x509_subject_public_key().
BigInt Botan::PointGFp::get_affine_y | ( | ) | const |
get affine y coordinate
Definition at line 406 of file point_gfp.cpp.
References Botan::CurveGFp::get_p(), Botan::CurveGFp::get_r2(), Botan::inverse_mod(), and is_zero().
Referenced by Botan::EC2OSP(), operator==(), and Botan::GOST_3410_PublicKey::x509_subject_public_key().
|
inline |
Return base curve of this point
Definition at line 128 of file point_gfp.h.
Referenced by Botan::EC2OSP(), Botan::operator*(), and operator==().
|
inline |
Is this the point at infinity?
Definition at line 146 of file point_gfp.h.
Referenced by Botan::EC2OSP(), get_affine_x(), get_affine_y(), on_the_curve(), operator-=(), operator==(), Botan::ECDSA_Verification_Operation::verify(), and Botan::GOST_3410_Verification_Operation::verify().
|
inline |
Negate this point
Definition at line 117 of file point_gfp.h.
Referenced by Botan::multi_exponentiate(), Botan::operator*(), and Botan::operator-().
bool Botan::PointGFp::on_the_curve | ( | ) | const |
Checks whether the point is to be found on the underlying curve; used to prevent fault attacks.
Definition at line 419 of file point_gfp.cpp.
References Botan::CurveGFp::get_a_r(), Botan::CurveGFp::get_b_r(), and is_zero().
Referenced by Botan::ECDH_KA_Operation::agree(), Botan::EC_PublicKey::check_key(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::OS2ECP(), and Botan::GOST_3410_Signature_Operation::sign().
*= Operator
scalar | the PointGFp to multiply with *this |
Definition at line 251 of file point_gfp.cpp.
+= Operator
rhs | the PointGFp to add to the local value |
Definition at line 232 of file point_gfp.cpp.
-= Operator
rhs | the PointGFp to subtract from the local value |
Definition at line 239 of file point_gfp.cpp.
References is_zero(), and PointGFp().
bool Botan::PointGFp::operator== | ( | const PointGFp & | other | ) | const |
Equality operator
Definition at line 468 of file point_gfp.cpp.
References get_affine_x(), get_affine_y(), get_curve(), and is_zero().
void Botan::PointGFp::swap | ( | PointGFp & | other | ) |
swaps the states of *this and other, does not throw!
other | the object to swap values with |
Definition at line 459 of file point_gfp.cpp.
References Botan::CurveGFp::swap(), Botan::MemoryRegion< T >::swap(), and Botan::BigInt::swap().
|
friend |
Multiexponentiation
p1 | a point |
z1 | a scalar |
p2 | a point |
z2 | a scalar |
Definition at line 257 of file point_gfp.cpp.
Multiplication Operator
scalar | the scalar value |
point | the point value |
Definition at line 290 of file point_gfp.cpp.