2. Double_fun_ctest_gf2m

2.1. Function description:

This demo shows the operation of ECC point doubling using projective coordinate formula for short-weierstrass curve in GF(2^m).

  • Allocate enough memory space of SRAM used by internal logic during computation.

  • Filling data to address of N, then configure & start INV_N0 operation.

  • Filling data to address of RR, then configure & start MOD operation.

  • Filling data to address of operand a & b for montgomery multiplication operation, then configure & start MontMult operation.

  • Configure & start ECC point doubling for short-weierstrass curve.

  • Waiting process done to compare the result with the golden data to check.

2.2. Main Configuration:

2.2.1. INV_N0 operation:

Operation code

Field

Data length

Reserved area size

OP_INV_N0

GF(2^m)

6 words

11 words per variable

Note

Operation code is OP_INV_N0, the operand is N.

2.2.2. MOD operation:

Operation code

Option

Field

Operand a length

Operand b length

OP_MOD

ordinary

GF(2^m)

13 words

6 words

Note

Operation code is OP_MOD, the operand a is RR, operand b is N.

2.2.3. MontMult operation:

Operation code

Type

Field

OP_MontMult

MM_MULT

GF(2^m)

Note

Operation code is OP_MontMult:

  1. The operand a is A, operand b is RR, the result stored in A;

  2. The operand a is B, operand b is RR, the result stored in B;

2.2.4. PDBL operation:

Operation code

Field

Gx length

Gy length

Gz length

Qx length

Qy length

Qz length

OP_GFP_PDBL

GF(2^m)

6 words

6 words

6 words

6 words

6 words

6 words

Note

Operation code is OP_GFP_PDBL:

  1. The x-coordinate of the first input point is Gx, the y-coordinate of the first input point is Gy, the z-coordinate of the first input point is Gz;

  2. The x-coordinate of the second input point is Qx, the y-coordinate of the second input point is Qy, the z-coordinate of the second input point is Qz.

2.3. Test result:

If the result is same as the standard data, then print pass, if not print fail.

2.4. IO connection:

None