#include <pk.h>
Collaboration diagram for Point:

As the class name indicates, operators are defined as if the underlying group operation is written additively, though obviously if the group is more commonly written multiplicatively, the operators should be interpreted that way. For example, operator*() is decribed below as scalar multiplication, but should be thought of as exponentiation in the multiplicative setting.
Public Member Functions | |
Constructors and Destructors | |
| Point () | |
| Constructor used to create an empty Point object. | |
| Point (const Point &a) | |
| Copy constructor. | |
| Point (const GParms *p1) | |
| Constructor used to create an element of the specified Abelian group. | |
| Point (const Point &a, const str &b) | |
| Constructor used to create a Point in the same Abelian group as another Point. | |
| virtual | ~Point () |
| Destructor. | |
Object Reuse and Initialization | |
| void | clear () |
| Clear this Point object. | |
| int | setgen (const num &g) |
| Specify a generator for the underlying Abelian group. | |
| int | setcurve (const num &a, const num &b) |
| Specify the coefficients in the equation of an elliptic curve: in char p: y 2 = x 3 + a x + b in char 2: y 2 + x y = x 3 + a x 2 + b. | |
| void | power (const Point &x, const num &y) |
| Assign an (unnormalized) multiple of a given Point to this one. | |
| int | loadbin (int n, const char *b) |
| Load an octet string into this Point. | |
| void | add (int n, const char *b) |
| Add; a void version of loadbin(). | |
Assignment and Arithmetic Operators | |
| void | operator= (int n) |
| Assignment operator used to make this Point the identity element in the group. | |
| void | operator= (const Point &x) |
| Assignment operator used to copy Points. | |
| Point | operator- () const |
| Get the additive inverse of this Point. | |
| Point | operator+ (const Point &y) const |
| Add another Point to this one. | |
| Point | operator- (const Point &y) const |
| Subtract another Point from this one. | |
| Point | operator * (const num &x) const |
| Multiply this Point by an integer. | |
Predicate Operators | |
| bool | operator== (int n) const |
| Predicate used to test whether this Point is the identity element in the group. | |
| bool | operator!= (int n) const |
| Predicate used to test whether this Point differs from the identity element. | |
| bool | operator== (const Point &x) const |
| Predicate used to test the equality of this Point with another one. | |
| bool | operator!= (const Point &x) const |
| Predicate used to test the inequality of this Point with another one. | |
Predicate Functions | |
| bool | isDef () const |
| Predicate used to determine whether parameters are defined. | |
| bool | isDH () const |
| Predicate used to determine whether this point is an element of (a multiplicative subgroup of) the group of nonzero integers modulo a large prime. | |
| bool | isEC () const |
| Predicate used to determine whether this Point is on an elliptic curve. | |
| bool | isChar2 () const |
| Predicate used to determine whether this Point is on an elliptic curve in char 2. | |
| bool | isValid () const |
| Predicate used to test whether this Point lies on the underlying elliptic curve. | |
| bool | hasOrder (const num &a) const |
| Predicate used to test whether this group element has a specified order. | |
Inspectors | |
| int | bits () const |
| Get the number of bits required to represent this Point. | |
| int | length () const |
| Get the size in bytes of the largest integer that can be mapped into the current Abelian group. | |
| num | modulus2 () const |
| Get the order of the underlying finite field or order of the group. | |
Conversions | |
| cdk::str | tostr (int n=0) const |
| Convert this Point into a str. | |
| template<class T> | |
| T | to (int opt=0) const |
| Convert Point into an object of type T. | |
Constructor used to create an element of the specified Abelian group.
| p1 | a pointer to the group parameters (GParms) to use for this point. |
| virtual ~Point | ( | ) | [inline, virtual] |
Destructor.
| void add | ( | int | n, | |
| const char * | b | |||
| ) | [inline] |
Add; a void version of loadbin().
| n | length of the octet string in bytes | |
| b | pointer to the octet string |
| int bits | ( | ) | const |
| void clear | ( | void | ) | [inline] |
| bool hasOrder | ( | const num & | a | ) | const |
Predicate used to test whether this group element has a specified order.
| a | suspected order of this group element |
| bool isChar2 | ( | ) | const [inline] |
Predicate used to determine whether this Point is on an elliptic curve in char 2.
| bool isDef | ( | ) | const [inline] |
Predicate used to determine whether parameters are defined.
| bool isDH | ( | ) | const [inline] |
Predicate used to determine whether this point is an element of (a multiplicative subgroup of) the group of nonzero integers modulo a large prime.
| bool isEC | ( | ) | const [inline] |
Predicate used to determine whether this Point is on an elliptic curve.
| bool isValid | ( | ) | const |
| int length | ( | ) | const [inline] |
Get the size in bytes of the largest integer that can be mapped into the current Abelian group.
| int loadbin | ( | int | n, | |
| const char * | b | |||
| ) |
Load an octet string into this Point.
| n | length of the octet string in bytes | |
| b | pointer to the octet string |
| num modulus2 | ( | ) | const [inline] |
Get the order of the underlying finite field or order of the group.
| bool operator!= | ( | const Point & | x | ) | const [inline] |
| bool operator!= | ( | int | n | ) | const [inline] |
| Point operator- | ( | ) | const |
| void operator= | ( | const Point & | x | ) | [inline] |
| void operator= | ( | int | n | ) |
Assignment operator used to make this Point the identity element in the group.
| n | must be 0 (any other value will trigger an exception) |
| bool operator== | ( | const Point & | x | ) | const [inline] |
| bool operator== | ( | int | n | ) | const |
Specify the coefficients in the equation of an elliptic curve:
in char p: y 2 = x 3 + a x + b
in char 2: y 2 + x y = x 3 + a x 2 + b.
| a | the first coefficient | |
| b | the second coefficient |
| int setgen | ( | const num & | g | ) |
Specify a generator for the underlying Abelian group.
| g | a new generator for the underlying group |
| T to | ( | int | opt = 0 |
) | const |
| cdk::str tostr | ( | int | n = 0 |
) | const |
| ISC Cryptographic Development Kit - User's Guide | |
| Questions? E-mail ISC technical support | |
| Copyright© 2002-2006 Information Security Corp. All rights reserved. |