13. Mexp_fun_ctest_gfp
13.1. Function description:
This demo shows the operation of modular exponentiation in GF(p).
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 exponent & base, then configure & start modular exponentiation.
Waiting process done to compare the result with the golden data to check.
13.2. Main Configuration:
13.2.1. INV_N0 operation:
Operation code |
Field |
Data length |
Reserved area size |
OP_INV_N0 |
GF(p) |
32 words |
37 words per variable |
Note
Operation code is OP_INV_N0, the operand is N.
13.2.2. MOD operation:
Operation code |
Option |
Field |
Operand a length |
Operand b length |
OP_MOD |
ordinary |
GF(p) |
67 words |
8 words |
Note
Operation code is OP_MOD:
The operand a is RR, operand b is N, RR length is 67 words.
13.2.3. MEXP operation:
Operation code |
Field |
Exponent length |
Base |
OP_MEXP |
GF(p) |
32 words |
32 words |
13.3. Test result:
If the result is same as the standard data, then print pass, if not print fail.
13.4. IO connection:
None