|
Botan 1.10.17
|
#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 multi_exponentiate, negate(), operator*, operator*=(), operator+=(), Botan::operator-(), operator-=(), operator==(), Botan::OS2ECP(), and swap().
| Botan::PointGFp::PointGFp | ( | const CurveGFp & | curve | ) |
Construct the zero point
| curve | The base curve |
Definition at line 18 of file point_gfp.cpp.
Construct a point from its affine coordinates
| curve | the base curve |
| x | affine x coordinate |
| y | affine y coordinate |
Definition at line 26 of file point_gfp.cpp.
| BigInt Botan::PointGFp::get_affine_x | ( | ) | const |
get affine x coordinate
Definition at line 400 of file point_gfp.cpp.
References Botan::Illegal_Transformation::Illegal_Transformation(), Botan::inverse_mod(), and is_zero().
Referenced by Botan::ECDH_KA_Operation::agree(), Botan::EC2OSP(), operator==(), Botan::ECDSA_Signature_Operation::sign(), and Botan::ECDSA_Verification_Operation::verify().
| BigInt Botan::PointGFp::get_affine_y | ( | ) | const |
get affine y coordinate
Definition at line 414 of file point_gfp.cpp.
References Botan::Illegal_Transformation::Illegal_Transformation(), Botan::inverse_mod(), and is_zero().
Referenced by Botan::EC2OSP(), and operator==().
|
inline |
Return base curve of this point
Definition at line 128 of file point_gfp.h.
Referenced by Botan::EC2OSP(), 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(), negate(), on_the_curve(), operator-=(), operator==(), and Botan::ECDSA_Verification_Operation::verify().
|
inline |
Negate this point
Definition at line 117 of file point_gfp.h.
References is_zero(), and PointGFp().
Referenced by multi_exponentiate, and 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 427 of file point_gfp.cpp.
References is_zero().
Referenced by Botan::ECDH_KA_Operation::agree(), Botan::EC_PublicKey::check_key(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::EC_PrivateKey::EC_PrivateKey(), and Botan::OS2ECP().
*= Operator
| scalar | the PointGFp to multiply with *this |
Definition at line 259 of file point_gfp.cpp.
References PointGFp().
+= Operator
| rhs | the PointGFp to add to the local value |
Definition at line 240 of file point_gfp.cpp.
References PointGFp().
-= Operator
| rhs | the PointGFp to subtract from the local value |
Definition at line 247 of file point_gfp.cpp.
References is_zero(), and PointGFp().
| bool Botan::PointGFp::operator== | ( | const PointGFp & | other | ) | const |
Equality operator
Definition at line 476 of file point_gfp.cpp.
References get_affine_x(), get_affine_y(), get_curve(), is_zero(), and PointGFp().
| 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 467 of file point_gfp.cpp.
References PointGFp().
Referenced by std::swap< Botan::PointGFp >().
|
friend |
Multiexponentiation
| p1 | a point |
| z1 | a scalar |
| p2 | a point |
| z2 | a scalar |
Definition at line 265 of file point_gfp.cpp.
References Botan::BigInt::bits(), Botan::BigInt::get_bit(), Botan::BigInt::is_negative(), multi_exponentiate, negate(), and PointGFp().
Referenced by multi_exponentiate.
Multiplication Operator
| scalar | the scalar value |
| point | the point value |
Definition at line 298 of file point_gfp.cpp.
References Botan::BigInt::abs(), Botan::BigInt::bits(), Botan::BigInt::byte_at(), Botan::BigInt::get_bit(), get_curve(), Botan::BigInt::get_substring(), Botan::BigInt::is_negative(), Botan::BigInt::is_zero(), negate(), operator*, and PointGFp().
Referenced by operator*.