37.3.6.1 Coordinate Systems

General Considerations

In this implementation, several choices have been made related to the coordinate systems managed by the elliptic curve primitives.

There are two systems currently managed by the library:

  • Affine Coordinates System where each curve point has two coordinates (X, Y)
  • Projective Coordinates System where each point is represented with three coordinates (X,Y, Z)

Converting from the affine coordinates system to a projective coordinates system is performed by extending its representation with Z = 1:

(X, Y) ⇒ (X, Y, Z= 1)

Converting from a projective coordinate to an affine one is a service offered by the PUKCL. The formula to perform this conversion is:

(X, Y, Z) ⇒ (X / Z2, Y / Z3)

Points Representations

Depending on the representation (Projective or Affine), points are represented tn memory, as shown in the following figure.
Figure 37-6. Points Representation in Memory

In this figure, the modulus is represented as a reference, and to show that coordinates are always to be provided on the length of the modulus plus one 32-bit word.

The different types of representations are as follows:

Note:
  1. The minimum value for u2ModLength is 12 bytes. Therefore, the significant length of the modulus must be at least three 32-bit words.
  2. In some cases the point can be the infinite point. In this case, it is represented with its Z coordinates equal or congruent to zero.

Modulus and Modular Constant Parameters

In most of the services the following parameters must be provided:

  • P the Modulus (often pointed by {nu1ModBase,u2ModLength + 4}): This parameter contains the Modulus Integer prime P defining the Galois Field used in points coordinates computations. The Modulus must be u2ModLength bytes long, while having a supplemental zeroed 32-bit word on the MSB side.
    Note: Most of the Elliptic Curve computations are reduced modulo P. In many functions the reductions are made with the Fast Reduction.
  • Cns the Modular Constant (often pointed by {nu1CnsBase,u2ModLength + 12}): This parameter contains the Modular Constant associated to the Modulus
Important: The Modular Constant must be calculated before using the GF(p) Elliptic Curves functions by a call to the Setup for Modular Reductions with the GF(p) option (see Modular Reduction Setup in the Modular Reduction from Related Links).