ECDSA is a public-key digital-signature algorithm. Signing hashes a message, combines the hash with a random scalar and private key, and produces the pair (c, d). Verification recomputes the message hash, combines the signature with the public key and base point, and checks a reduced x-coordinate. Any message change causes verification to fail. section 5.0 section 5.4
The core operations use the base-point order n for scalar arithmetic:
- Hash message M to e = hash(M) mod n. section 5.2
- Choose random k, compute R = kB, and set c = R.x mod n. section 5.2
- With private key s_p, compute d = k⁻¹(e + c·s_p) mod n; the signature is (c, d). section 5.2
- For verification, compute h = d⁻¹, h₁ = e′h, h₂ = ch, then R′ = h₁B + h₂P_p; accept when R′.x mod n equals c. section 5.2 section 5.2.2
Signing and verifying in code
A signing routine hashes the message, chooses k, multiplies the base point, reduces R.x to c, and computes d through modular multiplication, addition, and division. The verification routine hashes the same message, inverts d, computes two scalar multiples, adds the resulting points, reduces the final x-coordinate, and returns success only when it equals c. A test initializes the signature, signs a buffer, and verifies that same buffer; changing the message produces failure. section 5.2.1 section 5.2.2 section 5.2.3
Figure 5.2 ECDSA signature steps
Follow the signature-step diagram alongside equations 5.3–5.9 to connect the signing and verification flows with their scalar and point operations. section 5.2


