GD32W51x User Manual
981
2
.
If the modulus n is not prime, only when the greatest common divisor of A and n is 1, the
modular inversion output is valid.
RSA CRT exponentiation
The RSA CRT exponentiation operation is selected by configuring MODSEL[5:0] in
PKCAU_CTL register as "000111".
p and q are part of the private key, and are primes
d
P
= d mod (p-1)
d
Q
= d mod (q-1)
q
inv
= q
-1
mod p
These parameters above allow the recipient to compute the exponentiation m = A
d
(mod pq)
more efficiently as follows:
m = A
d
(mod pq)
m
1
= A
dP
mod p
m
2
= A
dQ
mod p
h = q
inv
( m
1
– m
2
) mod p, m
1
>m
2
m = m
2
+ hq
The operation declaration is shown in
Figure 29-18. RSA CRT exponentiation
. The
operation result is
“
result = A
d
mod pq
”
.
Figure 29-18. RSA CRT exponentiation
Operand length L
Operand d
P
PKCAU RAM
0x404
Operand d
Q
0x408
...
0x400
...
0x65C
0xBD0
0x7EC
Prime p
Prime q
0xD5C
...
Operand q
inv
0x97C
A
d
mod n
0x724
Operand A
0xEEC
...
Offset address
input
output
Offset address
The range of parameters used by
RSA CRT exponentiation operation is shown in
Range of parameters used by RSA CRT exponentiation operation
.