ECP Class Reference

Elliptic Curve over GF(p), where p is prime. More...

Inheritance diagram for ECP:

## Public Types

typedef ModularArithmetic | Field
typedef Integer | FieldElement
typedef ECPPoint | Point
Public Types inherited from AbstractGroup< ECPPoint >
typedef ECPPoint | Element

## Public Member Functions

| ECP (const ECP &ecp, bool convertToMontgomeryRepresentation=false)
| ECP (const Integer &modulus, const FieldElement &a, const FieldElement &b)
| ECP (BufferedTransformation &bt)
void | DEREncode (BufferedTransformation &bt) const
bool | Equal (const Point &P, const Point &Q) const
| Compare two elements for equality. More...
const Point & | Identity () const
const Point & | Inverse (const Point &P) const
| Inverts the element in the group. More...
bool | InversionIsFast () const
const Point & | Add (const Point &P, const Point &Q) const
| Adds elements in the group. More...
const Point & | Double (const Point &P) const
| Doubles an element in the group. More...
Point | ScalarMultiply (const Point &P, const Integer &k) const
| Performs a scalar multiplication. More...
Point | CascadeScalarMultiply (const Point &P, const Integer &k1, const Point &Q, const Integer &k2) const
| TODO. More...
void | SimultaneousMultiply (Point *results, const Point &base, const Integer *exponents, unsigned int exponentsCount) const
| Multiplies a base to multiple exponents in a group. More...
Point | Multiply (const Integer &k, const Point &P) const
Point | CascadeMultiply (const Integer &k1, const Point &P, const Integer &k2, const Point &Q) const
bool | ValidateParameters (RandomNumberGenerator &rng, unsigned int level=3) const
bool | VerifyPoint (const Point &P) const
unsigned int | EncodedPointSize (bool compressed=false) const
bool | DecodePoint (Point &P, BufferedTransformation &bt, size_t len) const
bool | DecodePoint (Point &P, const byte *encodedPoint, size_t len) const
void | EncodePoint (byte *encodedPoint, const Point &P, bool compressed) const
void | EncodePoint (BufferedTransformation &bt, const Point &P, bool compressed) const
Point | BERDecodePoint (BufferedTransformation &bt) const
void | DEREncodePoint (BufferedTransformation &bt, const Point &P, bool compressed) const
Integer | FieldSize () const
const Field & | GetField () const
const FieldElement & | GetA () const
const FieldElement & | GetB () const
bool | operator== (const ECP &rhs) const
Public Member Functions inherited from AbstractGroup< ECPPoint >
virtual const Element & | Identity () const=0
| Provides the Identity element. More...
virtual bool | InversionIsFast () const
| Determine if inversion is fast. More...
virtual const Element & | Subtract (const Element &a, const Element &b) const
| Subtracts elements in the group. More...
virtual Element & | Accumulate (Element &a, const Element &b) const
| TODO. More...
virtual Element & | Reduce (Element &a, const Element &b) const
| Reduces an element in the congruence class. More...

## Detailed Description

Elliptic Curve over GF(p), where p is prime.

Definition at line 42 of file ecp.h.

## Member Function Documentation

## Equal()

bool ECP::Equal | ( | const Point & | a,
|  | const Point & | b
| ) |  | const

virtual

Compare two elements for equality.

Parameters

  a | first element
  b | second element

Returns
  true if the elements are equal, false otherwise

Equal() tests the elements for equality using `a==b`

Implements AbstractGroup< ECPPoint >.

## Inverse()

const Point& ECP::Inverse | ( | const Point & | a | ) | const

virtual

Inverts the element in the group.

Parameters

  a | first element

Returns
  the inverse of the element

Implements AbstractGroup< ECPPoint >.

## Add()

const Point& ECP::Add | ( | const Point & | a,
|  | const Point & | b
| ) |  | const

virtual

Adds elements in the group.

Parameters

  a | first element
  b | second element

Returns
  the sum of `a` and `b`

Implements AbstractGroup< ECPPoint >.

## Double()

const Point& ECP::Double | ( | const Point & | a | ) | const

virtual

Doubles an element in the group.

Parameters

  a | the element

Returns
  the element doubled

Reimplemented from AbstractGroup< ECPPoint >.

## ScalarMultiply()

Point ECP::ScalarMultiply | ( | const Point & | a,
|  | const Integer & | e
| ) |  | const

virtual

Performs a scalar multiplication.

Parameters

  a | multiplicand
  e | multiplier

Returns
  the product

Reimplemented from AbstractGroup< ECPPoint >.

## CascadeScalarMultiply()

Point ECP::CascadeScalarMultiply | ( | const Point & | x,
|  | const Integer & | e1,
|  | const Point & | y,
|  | const Integer & | e2
| ) |  | const

virtual

TODO.

Parameters

  x | first multiplicand
  e1 | the first multiplier
  y | second multiplicand
  e2 | the second multiplier

Returns
  TODO

Reimplemented from AbstractGroup< ECPPoint >.

## SimultaneousMultiply()

void ECP::SimultaneousMultiply | ( | Point * | results,
|  | const Point & | base,
|  | const Integer * | exponents,
|  | unsigned int | exponentsCount
| ) |  | const

virtual

Multiplies a base to multiple exponents in a group.

Parameters

  results | an array of Elements
  base | the base to raise to the exponents
  exponents | an array of exponents
  exponentsCount | the number of exponents in the array

SimultaneousMultiply() multiplies the base to each exponent in the exponents array and stores the result at the respective position in the results array.

SimultaneousMultiply() must be implemented in a derived class.

Precondition
  `COUNTOF(results) == exponentsCount`
  `COUNTOF(exponents) == exponentsCount`

Reimplemented from AbstractGroup< ECPPoint >.

The documentation for this class was generated from the following file:

- ecp.h