Expand description

A trait that generalizes over a curve concept.

General equation of a curve is: y^2 = x^3 + a*x + b

Provides all the parametrizations through associated constants.

Associated constant slices must incorporate zero padding required by PUKCC.

Const generics are limited. It is impossible to have const arrays with a length as a separate const parameter. Therefore slices are used instead and length verification is moved to runtime (Curve::verify_curve)

Associated Constants

Length of P modulus (bytes)

Length of the scalar (bytes)

P modulus parameter Length: MOD_LENGTH + 4

A parameter of a curve Length: MOD_LENGTH + 4

B parameter of a curve Length: MOD_LENGTH + 4

X coordinate of a base point (point of origin on a curve) Length: MOD_LENGTH + 4

Y coordinate of a base point (point of origin on a curve) Length: MOD_LENGTH + 4

Z coordinate of a base point (point of origin on a curve) It is equal to 1 Length: MOD_LENGTH + 4

Order point of the curve Length: SCALAR_LENGTH + 4

Modulo reduction constant precalculated with RedMod service in a SetupConstant mode

Note: That CNS value is for services over prime field: GF(p) For polynomials GF(2^n) it has to be generated separately Length: SCALAR_LENGTH + 12

Provided methods

Function that can be used during runtime to verify if a curve is correctly defined.

That is:

  • lengths of slices are following the requirements
  • slices are 4 aligned

Implementors