ECDSA verify signature
Last updated
Last updated
The algorithm to verify a ECDSA signature takes as input the signed message msg + the signature {r, s} produced from the signing algorithm + the public key pubKey, corresponding to the signer's private key. The output is boolean value: valid or invalid signature. The ECDSA signature verify algorithm works as follows (with minor simplifications):
Calculate the message hash, with the same cryptographic hash function used during the signing: h = hash(msg)
Calculate the modular inverse of the signature proof: s1 =
Recover the random point used during the signing: R' = (h * s1) * G + (r * s1) * pubKey
Take from R' its x-coordinate: r' = R'.x
Calculate the signature validation result by comparing whether r' == r
The general idea of the signature verification is to recover the point R' using the public key and check whether it is same point R, generated randomly during the signing process.