GD32W51x User Manual
980
in PKCAU_CTL register as "000010". The operation declaration is shown in
Modular exponentiation of fast mode
. The operation result is
“
result = A
e
mod n
”
.
Figure 29-16. Modular exponentiation of fast mode
Modulus length M
Operand A
PKCAU RAM
0x404
Exponent e
0x408
Exponent length
0x400
...
0xA44
Modulus n
...
0xBD0
0xD5C
Montgomery
parameter
0x594
...
A
e
mod n
...
0x724
Operand A
0xA44
Offset address
input
output
Offset address
0≤A<n, 0≤e<n, 0≤result<n, 0<n<2
M
, 0<M≤3136, 0<Montgomery parameter (R
2
mod n)<n.
Modular inversion
The Modular exponentiation of fast mode operation is selected by configuring MODSEL[5:0]
in PKCAU_CTL register as "001000". The operation declaration is shown in
. The operation result is
“
result = A
-1
mod n
”
.
Figure 29-17.
Modular inversion
Modulus length M
Operand A
PKCAU RAM
0x404
Modulus n
0x408
...
0x400
...
0x8B4
0xA44
...
0xBD0
...
A
-1
mod n
...
0xBD0
Offset address
input
output
Offset address
0<A<n, 0<result<n
,
0<n<2
M
, 0<M≤3136.
Note:
1
.
If the modulus n is prime, for all values of A that satisfy the condition
“
1≤A<n
”
,
the modular
inversion output is valid.