Elliptic Curves & Ed25519
The group law on a curve, why the discrete log there resists index calculus, and why the ecosystem moved from Weierstrass/NIST curves to Curve25519 — completeness, constant time, and no unexplained constants.
Elliptic-curve cryptography gets the same security as RSA or finite-field Diffie–Hellman from dramatically smaller keys — 256 bits versus 3072 — because the best known attack on the elliptic-curve discrete log is generic square-root (, i.e. Pollard rho) rather than the sub-exponential index calculus that erodes RSA and finite-field DH. Smaller keys mean less bandwidth, less computation, and less battery, which is why every modern protocol defaults to curves.
The curve and its group law #
Over a prime field with , a short Weierstrass curve is the set of points satisfying
plus a point at infinity that acts as the identity. The non-vanishing discriminant condition rules out singular curves (cusps and self-intersections), where the group structure would collapse.
The points form an abelian group under a geometric "chord and tangent" addition, expressed algebraically as:
- is the identity; (points are inverses when they share )
- Addition, for , with :
- Doubling, for , with :
All arithmetic is mod , and the divisions are modular inverses — so each addition costs an inversion, which is why implementations work in projective coordinates to defer them.
Hasse's theorem bounds the group order near :
Scalar multiplication is computed by double-and-add in steps. The one-way function is the ECDLP: given and , find . All known algorithms are exponential — — which is the entire source of ECC's key-size advantage.
Why the ecosystem left Weierstrass curves behind #
The group law above has a defect visible in its own statement: it is a case analysis. Adding a point to itself, adding inverses, and handling are separate branches. Branches on secret data are timing side channels, and forgetting a branch is a correctness bug.
Curve25519 (Bernstein, 2006) is a Montgomery curve over , with a birationally equivalent Edwards form (edwards25519) used for signatures. Its design targets the failure modes rather than the raw math:
| Property | NIST P-256 (Weierstrass) | Curve25519 / Ed25519 |
|---|---|---|
| Addition formulas | incomplete — special cases | complete — one formula, every input pair |
| Constant-time implementation | achievable but delicate | natural (Montgomery ladder) |
| Invalid-curve / point validation | required, often forgotten | input decoding is total, but protocols must reject an all-zero X25519 shared secret |
| Parameter provenance | unexplained NSA-supplied seeds | rigid derivation from stated criteria |
| Cofactor | 1 | 8 — must be handled, and RFC 8032 specifies how |
| Key / signature size | 32 / 64 bytes | 32 / 64 bytes |
Two primitives are what you actually use, and they are distinct:
- X25519 — Diffie–Hellman key agreement (RFC 7748). The default in TLS 1.3, SSH, Signal, WireGuard.
- Ed25519 — signatures (RFC 8032). Deterministic nonce derived from the key and message, removing the nonce footgun by construction.
Domain parameters are part of the algorithm #
A short Weierstrass deployment is not identified by “256-bit ECC.” It needs the field, coefficients, base point, base-point order, and cofactor:
SEC 2 v1.0 records this sextuple for curves including secp256k1 and secp256r1 and correctly relates a roughly 256-bit prime-order curve to about 128 bits of classical security. Its smaller curves and SHA-1-era status tables are historical, not present recommendations. NIST SP 800-186 (2023) is the current NIST domain-parameter publication and includes approved Weierstrass and Edwards curves.
secp256k1 and secp256r1 are different groups despite equal field size. Bitcoin and Ethereum consensus rules use secp256k1; much of TLS and WebPKI uses P-256/secp256r1. Keys, compressed points, and signatures cannot be moved between them merely because both are “256-bit.”
Source claims audit #
Seeded from a university lab manual (elliptic-curve lab). Status of its load-bearing claims:
| Claim from source | Status | Notes |
|---|---|---|
| Weierstrass form, discriminant condition , point at infinity | current | Standard |
| Full group law: identity, inverses, addition and doubling with explicit | current | Verified by independent recomputation |
| Hasse's theorem bounds | current | Correct |
| Points form an abelian group; costs additions | current | Double-and-add |
| ECDH protocol on a curve, | current | Correct |
| Worked example , | current | Recomputed: , discriminant , arithmetic confirmed |
| Definition of supersingular () stated without consequence | incomplete | The source defines it and moves on. It is a disqualifying property — MOV attack; added |
| "All known algorithms for the inverse problem require exponential time" | current | True for well-chosen curves; the qualifier is doing heavy lifting, hence curve selection matters |
| Lab objective text says "master encoding and decoding with the DES cipher" | error in source | Copy-paste from the DES lab; the lab is about elliptic curves |
| Source omits Curve25519, Edwards form, constant-time concerns, cofactors | — | Added; this is what the last decade of deployment is about |
| Point compression (one coordinate + a sign bit, ~25% smaller public keys, ANSI X9.62 ECDSA) | current | From the companion lab report rather than the manual; added above with the secp256k1 02/03 encoding and X25519's x-only form |
Sources
- docsRFC 7748 — Elliptic Curves for Security
- docsRFC 8032 — Edwards-Curve Digital Signature Algorithm (EdDSA)
- paperCurve25519: new Diffie-Hellman speed records (Bernstein, 2006)
- docsSafeCurves: choosing safe curves for elliptic-curve cryptography
- docsSEC 2 Version 1.0 — Recommended Elliptic Curve Domain Parameterspdfnotes
- docsNIST SP 800-186 — Elliptic Curve Domain Parameters