GD32W51x User Manual
971
RSA decryption
After receiving the ciphertext, Bob decrypts the ciphertext to get the plaintext by the private
key. The decryption process is m =
c
d
mod n.
29.3.3.
ECC algorithm
Suppose the message is M, d is the private key, G is the base point of the chosen elliptic
curve, Q is a point of the chosen elliptic curve,with a prime order n. The hash function is
HASH(), z is the Ln leftmost bits of HASH (M), where Ln is the bit length of the order n. The
ECDSA sign and verification are detailed as follows:
ECDSA sign
The signature result of ECDSA consists of r and s. The process to generate ECDSA signature
is shown in
Figure 29-3. Flow chart of ECDSA sign
.
Figure 29-3. Flow chart of ECDSA sign
Select random number k
(0<k<n)
Calculate R = k x G
Calculate e = HASH(M)
r = x
R
, x
R
is the x coordinate
of R
Calculate s = (z + d
·
r)k
-1
mod n
Generate signature (r,s)
r is not 0?
s is not 0?
No
Yes
Yes
No
start
finish