Elliptic Curve Signature Verification Steps
This section describes how signature verification works for the "secp256r1" elliptic curve. In the context of digital signatures, verification is the process of determining whether a signature is valid for a given message and public key. The steps provided here outline how the verification process works mathematically using elliptic curve cryptography.
h (message hash)
Message Hash: Before the verification process begins, the original message is hashed, usually using a cryptographic hash function like SHA-256. The hash output, often denoted
h
, ensures a fixed size, and it abstracts the content of the message.
pubKey = (public key of the signer private key)
Public Key: This is a point on the elliptic curve that corresponds to the signer's private key. In asymmetric cryptography, the private key is kept secret by the signer and the corresponding public key is shared with others.
Calculate the modular inverse of the signature proof:
s1 = s^(−1)(modn)
Here,
s
is one of the two components of the digital signature (the other beingr
). The operations^(−1)(modn)
computes the modular inverse ofs
. This means that(s * s^(−1)) % n = 1
, wheren
is the order of the elliptic curve group.
Recover the random point used during the signing:
R' = (h * s1) * G + (r * s1) * pubKey
This step reconstructs the random point
R'
that was used during the signing process. The equation involves multiple operations:Scalar multiplication:
h * s1
andr * s1
.Elliptic curve point multiplication:
(h * s1) * G
and(r * s1) * pubKey
.Elliptic curve point addition: The sum of the two previously computed points.
G
is the generator point of the elliptic curve, a predefined point used in all operations for a given curve.
Take from R' its x-coordinate:
r' = R'.x
From the reconstructed random point
R'
, extract its x-coordinate, denotedr'
.
Calculate the signature validation result by comparing whether:
r' == r
Finally, the verification process checks if the extracted x-coordinate
r'
is equal tor
(the other component of the digital signature). If they match, the signature is considered valid for the given message and public key. If they don't, the signature is invalid.
In essence, these steps ensure that the signature was generated with the private key corresponding to the provided public key and for the specified message. This verification process ensures the authenticity and integrity of the message.
Last updated