43.3.7.4 Scalar Point Multiply

Purpose

This service is used to multiply a point by an integral constant K on a given elliptic curve over GF(2n).

How to Use the Service

Description

The operation performed is:

PtC = K × PtA

In this computation, the following parameters need to be provided:

  • A the input point is filled in projective coordinates (X,Y,Z) (pointed by {nu1PointABase,3*u2ModLength + 12}). This point can be the Infinite Point.
  • Cns the Fast Modular Constant filled (pointed by {nu1CnsBase,u2ModLength + 8})
  • P the modulus filled (pointed by {nu1ModBase,u2ModLength + 4})
  • The workspace not initialized (pointed by {nu1WorkSpace, 8*u2ModLength + 44}
  • The a and b parameters relative to the elliptic curve (pointed by {nu1ABBase,2*u2ModLength + 8})
  • K the scalar number (pointed by {nu1ScalarNumber,u2ScalarLength + 4})

The resulting C point is represented in projective coordinates (X,Y,Z) and is stored at the very same place than the input point A. This point can be the Infinite Point.

The service name for this operation is GF2NEccMulFast. This service uses Fast mode and Fast Modular Reduction for computation.

Important: Before using this service, ensure that the constant Cns has been calculated with the setup of the Fast Modular Reductions service.

Parameters Definition

Table 43-98. GF2NEccMulFast Service Parameters
ParameterTypeDirectionLocationData LengthBefore Executing the ServiceAfter Executing the Service
nu1ModBasenu1ICrypto RAMu2ModLength + 4Base of modulus PBase of modulus P
nu1CnsBasenu1ICrypto RAMu2ModLength + 12Base of CnsBase of Cns
u2ModLengthu2ILength of modulus PLength of modulus P
nu1KBasenu1ICrypto RAMu2KLengthScalar number used to multiply the point AUnchanged
u2KLengthu2ILength of scalar KLength of scalar K
nu1PointBasenu1I/OCrypto RAM3*u2ModLength + 12Input point A (projective coordinates)Resulting point C (projective coordinates)
nu1ABasenu1ICrypto RAM2*u2ModLength + 8Parameters a and b of the elliptic curveUnchanged
nu1Workspacenu1ICrypto RAM8*u2ModLength + 44Corrupted workspace

Code Example

PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;

PUKCL (u2Option) = 0;

PUKCL _GF2NEccMul(nu1ModBase) = <Base of the ram location of P>; 
PUKCL _GF2NEccMul(u2ModLength) = <Byte length of P>;
PUKCL _GF2NEccMul(nu1CnsBase) = <Base of the ram location of Cns>; 
PUKCL _GF2NEccMul(nu1PointBase) = <Base of the ram location of the A point>; 
PUKCL _GF2NEccMul(nu1ABase) = <Base of the ram location of the parameters a and b of the elliptic
curve>;
PUKCL _GF2NEccMul(nu1KBase) = <Base of the ram location of the scalar number>; 
PUKCL _GF2NEccMul(nu1Workspace) = <Base of the ram location of the workspace>;
PUKCL _GF2NEccMul(u2KLength) = <Length of the ram location of the scalar number>;

...

// vPUKCL_Process() is a macro command, which populates the service name
// and then calls the library...
vPUKCL_Process(GF2NEccMulFast,&PUKCLParam); 
if (PUKCL (u2Status) == PUKCL_OK)
            {
            ...
            }
else // Manage the error

Constraints

No overlapping between either input and output are allowed. The following conditions must be avoided to ensure the service works correctly:

  • nu1ModBase, nu1CnsBase, nu1PointBase, nu1ABase, nu1KBase, nu1Workspace are not aligned on 32-bit boundaries
  • {nu1ModBase, u2ModLength + 4}, {nu1CnsBase, u2ModLength + 8}, {nu1PointBase, 3*u2ModLength+ 12}, {nu1ABase, 2*u2ModLength + 8}, {nu1KBase, u2KLength} or {nu1Workspace, 8*u2ModLength + 44} are not in Crypto RAM
  • u2ModLength is either: < 12, > 0xffc or not a 32-bit length
  • All overlapping between {nu1ModBase, u2ModLength + 4}, {nu1CnsBase, u2ModLength +8}, {nu1PointBase, 3*u2ModLength + 12}, {nu1ABase, 2*u2ModLength + 8}, {nu1KBase, u2KLength} and {nu1Workspace, 8*u2ModLength + 44}

Status Returned Values

Table 43-99. GF2NEccMulFast Service Return Codes
Returned StatusImportanceMeaning
PUKCL_OKThe computation passed without problem.