GD32W51x User Manual
972
ECDSA verification
Before verifying the signature, be sure to get the signer's public key, message, and signature.
The process to generate ECDSA signature is shown in
Figure 29-4. Flow chart of ECDSA
.
Figure 29-4. Flow chart of ECDSA verification
Calculate w=s
-1
mod n
Calculate e = HASH(M)
Calculate u
1
= (wz) mod n
Calculate u
2
= (wr) mod n
Calculate P = u
1
·
G +
u
2
·
Q
Invalid signature
r = x
P
mod n?
(x
P
is the x coordinate
of P)
No
Valid signature
Yes
0<r<n and 0<s<n?
Yes
No
start
finish
Note:
The HASH in the above diagram is the agreed cryptographic hash function.
29.3.4.
Integer arithmetic operations
The integer arithmetic operation can be selected by configuring the MODSEL[5:0] in
PKCAU_CTL register. The operation modes to be selected is shown in
Table 29-2. Integer arithmetic operations
MODSEL[5:0]
Operation m odes
000000
calculate Montgomery parameter and then modular exponentiation