EncodedPoint< Point > Class Template Referenceabstract

Abstract class for encoding and decoding ellicptic curve points. More...

`#include <ecpoint.h>`

## Public Member Functions

virtual bool | DecodePoint (Point &P, BufferedTransformation &bt, size_t len) const =0
| Decodes an elliptic curve point.
virtual bool | DecodePoint (Point &P, const byte *encodedPoint, size_t len) const =0
| Decodes an elliptic curve point.
virtual bool | VerifyPoint (const Point &P) const =0
| Verifies points on elliptic curve.
virtual unsigned int | EncodedPointSize (bool compressed=false) const =0
| Determines encoded point size.
virtual void | EncodePoint (byte *encodedPoint, const Point &P, bool compressed) const =0
| Encodes an elliptic curve point.
virtual void | EncodePoint (BufferedTransformation &bt, const Point &P, bool compressed) const =0
| Encodes an elliptic curve point.
virtual Point | BERDecodePoint (BufferedTransformation &bt) const =0
| BER Decodes an elliptic curve point.
virtual void | DEREncodePoint (BufferedTransformation &bt, const Point &P, bool compressed) const =0
| DER Encodes an elliptic curve point.

## Detailed Description

template<class Point>
class EncodedPoint< Point >

Abstract class for encoding and decoding ellicptic curve points.

Template Parameters

  Point | ellicptic curve point

EncodedPoint is an interface for encoding and decoding elliptic curve points. The template parameter `Point` should be a class like ECP or EC2N.

Since
  Crypto++ 6.0

Definition at line 90 of file ecpoint.h.

## Constructor & Destructor Documentation

## ~EncodedPoint()

template<class Point >

virtual EncodedPoint< Point >::~EncodedPoint | ( |  | ) |

inline virtual

Definition at line 93 of file ecpoint.h.

## Member Function Documentation

## DecodePoint() [1/2]

template<class Point >

virtual bool EncodedPoint< Point >::DecodePoint | ( | Point & | P,
|  | BufferedTransformation & | bt,
|  | size_t | len
| ) |  | const

pure virtual

Decodes an elliptic curve point.

Parameters

  P | point which is decoded
  bt | source BufferedTransformation
  len | number of bytes to read from the BufferedTransformation

Returns
  true if a point was decoded, false otherwise

Implemented in EC2N, and ECP.

## DecodePoint() [2/2]

template<class Point >

virtual bool EncodedPoint< Point >::DecodePoint | ( | Point & | P,
|  | const byte * | encodedPoint,
|  | size_t | len
| ) |  | const

pure virtual

Decodes an elliptic curve point.

Parameters

  P | point which is decoded
  encodedPoint | byte array with the encoded point
  len | the size of the array

Returns
  true if a point was decoded, false otherwise

Implemented in EC2N, and ECP.

## VerifyPoint()

template<class Point >

virtual bool EncodedPoint< Point >::VerifyPoint | ( | const Point & | P | ) | const

pure virtual

Verifies points on elliptic curve.

Parameters

  P | point to verify

Returns
  true if the point is valid, false otherwise

Implemented in EC2N, and ECP.

## EncodedPointSize()

template<class Point >

virtual unsigned int EncodedPoint< Point >::EncodedPointSize | ( | bool | compressed = `false` | ) | const

pure virtual

Determines encoded point size.

Parameters

  compressed | flag indicating if the point is compressed

Returns
  the minimum number of bytes required to encode the point

Implemented in EC2N, and ECP.

## EncodePoint() [1/2]

template<class Point >

virtual void EncodedPoint< Point >::EncodePoint | ( | byte * | encodedPoint,
|  | const Point & | P,
|  | bool | compressed
| ) |  | const

pure virtual

Encodes an elliptic curve point.

Parameters

  P | point which is decoded
  encodedPoint | byte array for the encoded point
  compressed | flag indicating if the point is compressed

`encodedPoint` must be at least EncodedPointSize() in length

Implemented in EC2N, and ECP.

## EncodePoint() [2/2]

template<class Point >

virtual void EncodedPoint< Point >::EncodePoint | ( | BufferedTransformation & | bt,
|  | const Point & | P,
|  | bool | compressed
| ) |  | const

pure virtual

Encodes an elliptic curve point.

Parameters

  bt | target BufferedTransformation
  P | point which is encoded
  compressed | flag indicating if the point is compressed

Implemented in EC2N, and ECP.

## BERDecodePoint()

template<class Point >

virtual Point EncodedPoint< Point >::BERDecodePoint | ( | BufferedTransformation & | bt | ) | const

pure virtual

BER Decodes an elliptic curve point.

Parameters

  bt | source BufferedTransformation

Returns
  the decoded elliptic curve point

Implemented in EC2N, and ECP.

## DEREncodePoint()

template<class Point >

virtual void EncodedPoint< Point >::DEREncodePoint | ( | BufferedTransformation & | bt,
|  | const Point & | P,
|  | bool | compressed
| ) |  | const

pure virtual

DER Encodes an elliptic curve point.

Parameters

  bt | target BufferedTransformation
  P | point which is encoded
  compressed | flag indicating if the point is compressed

Implemented in EC2N, and ECP.

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

- ecpoint.h