#include <point.h>
Public Types | |
typedef Polynomial | polynomial_type |
The type of the field over which the elliptic curve is defined. | |
Public Member Functions | |
point (void) | |
Construct the point at infinity (zero). | |
point (std::string x, std::string y) | |
Construct a point (x, y) from the strings x and y. | |
point (polynomial_type const &x, polynomial_type const &y) | |
Construct a point (x, y) from the polynomials x and y. | |
point & | operator= (point const &p1) |
Copy constructor. | |
point & | operator+= (point const &p1) |
Add point p1 to this point. | |
void | MULTIPLY_and_assign (point const &pnt, mpz_class const &scalar) |
Multiply the point pnt with scalar and assign the result to this object. | |
mpz_class | order (order_algorithm algorithm=order_default) const |
Calculate the order of this point. | |
bool | operator== (point const &p1) const |
Compare for equality. | |
bool | operator!= (point const &p1) const |
Compare for inequality. | |
bool | check (void) const |
Check if the current point is a solution of the elliptic curve. | |
polynomial_type const & | get_x (void) const |
Retrieve the value of the x coordinate. | |
polynomial_type const & | get_y (void) const |
Retrieve the value of the y coordinate. | |
bool | is_zero (void) const |
Return if this is the point at infinity or not. | |
void | print_on (std::ostream &os) const |
Print the coordinates of this point to an ostream. | |
void | randomize (rds &random_source) |
Generate a random point on the curve. |
This class represents a point (x,y) on the elliptic curve x3 + ax2 + b = y2 + xy where x, y, a and b are of the type Polynomial, elements of F2m.
typedef Polynomial libecc::point< Polynomial, a, b >::polynomial_type |
The type of the field over which the elliptic curve is defined.
libecc::point< Polynomial, a, b >::point | ( | void | ) | [inline] |
Construct the point at infinity (zero).
libecc::point< Polynomial, a, b >::point | ( | std::string | x, | |
std::string | y | |||
) | [inline] |
Construct a point (x, y) from the strings x and y.
The strings are passed directly to two variables of type polynomial_type.
libecc::point< Polynomial, a, b >::point | ( | polynomial_type const & | x, | |
polynomial_type const & | y | |||
) | [inline] |
Construct a point (x, y) from the polynomials x and y.
point< Polynomial, a, b > & libecc::point< Polynomial, a, b >::operator= | ( | point< Polynomial, a, b > const & | p1 | ) | [inline] |
Copy constructor.
References libecc::point< Polynomial, a, b >::M_x, libecc::point< Polynomial, a, b >::M_y, and libecc::point< Polynomial, a, b >::M_zero.
point< Polynomial, a, b > & libecc::point< Polynomial, a, b >::operator+= | ( | point< Polynomial, a, b > const & | p1 | ) | [inline] |
void libecc::point< Polynomial, a, b >::MULTIPLY_and_assign | ( | point< Polynomial, a, b > const & | pnt, | |
mpz_class const & | scalar | |||
) | [inline] |
mpz_class libecc::point< Polynomial, a, b >::order | ( | order_algorithm | algorithm = order_default |
) | const [inline] |
Calculate the order of this point.
References libecc::point< Polynomial, a, b >::M_x, and libecc::point< Polynomial, a, b >::M_zero.
bool libecc::point< Polynomial, a, b >::operator== | ( | point< Polynomial, a, b > const & | p1 | ) | const [inline] |
Compare for equality.
References libecc::point< Polynomial, a, b >::operator!=().
bool libecc::point< Polynomial, a, b >::operator!= | ( | point< Polynomial, a, b > const & | p1 | ) | const [inline] |
Compare for inequality.
References libecc::point< Polynomial, a, b >::M_x, libecc::point< Polynomial, a, b >::M_y, and libecc::point< Polynomial, a, b >::M_zero.
Referenced by libecc::point< Polynomial, a, b >::operator==().
bool libecc::point< Polynomial, a, b >::check | ( | void | ) | const [inline] |
polynomial_type const& libecc::point< Polynomial, a, b >::get_x | ( | void | ) | const [inline] |
Retrieve the value of the x coordinate.
This value is only valid when is_zero returns false.
polynomial_type const& libecc::point< Polynomial, a, b >::get_y | ( | void | ) | const [inline] |
Retrieve the value of the y coordinate.
This value is only valid when is_zero returns false.
bool libecc::point< Polynomial, a, b >::is_zero | ( | void | ) | const [inline] |
Return if this is the point at infinity or not.
void libecc::point< Polynomial, a, b >::print_on | ( | std::ostream & | os | ) | const [inline] |
Print the coordinates of this point to an ostream.
void libecc::point< Polynomial, a, b >::randomize | ( | rds & | random_source | ) | [inline] |
Generate a random point on the curve.