liveBook · Manning

ECDSA

As explained in Elliptic Curve Cryptography for Developers

The Elliptic Curve Digital Signature Algorithm, a public-key signature scheme that generates and verifies signatures using elliptic-curve group operations and message hashes.

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
figure

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

How Elliptic Curve Cryptography for Developers covers it

How deep it goes
Derives signing and verification equations, maps them to subroutines, and omits many details of the NIST standard.
Examples
Uses C-style signing and verification routines tested against example curves, pass phrases, and a shared message buffer.
What it assumes
Assumes message hashing, elliptic-curve points, private/public keys, base-point multiplication, and modular arithmetic routines.
What you can do after
Build it from scratch by implementing signature structures, signing and verification routines, modular arithmetic, and point operations.
How it connects
Connects hash functions, private and public keys, elliptic-curve point operations, digital signatures, and Schnorr signatures.

Also explained in

Compare how 3 books explain ECDSA →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elliptic Curve Cryptography for Developers. The section links point to the parts of the book it draws on.