Elliptic Curves (Group Law Basics)
- •
What it is
- •
An elliptic curve over a field is the set of points satisfying an equation of the form (a smooth cubic — no repeated roots, checked via a nonzero discriminant), plus one extra "point at infinity" that serves as the group identity. Remarkably, these points form a genuine abelian group under a geometrically-defined addition: to add two points and , draw the line through them, find its third intersection with the curve, and reflect that point across the x-axis to get (doubling a point uses the tangent line instead). This group operation has no efficient "logarithm" — no known fast way, in general, to recover from a point and — which is the entire basis of elliptic curve cryptography (ECDH, ECDSA). Crucially, this hardness is a property of a genuine cubic curve specifically; equations that only look similar (conics, singular curves, curves over the wrong kind of ring) can secretly be isomorphic to a much simpler, easily-solved group instead.
- •
- •
When to apply
- •
Any protocol described as "elliptic curve" based — but always verify the actual group law and curve equation match the real thing, since "elliptic-curve-flavored" code that's actually built on a different underlying object (a conic, for instance) doesn't inherit real ECC's hardness at all.
- •
- •
Symbols and assumptions
- •
Work on over , with prime and . Points include an identity . All coordinate arithmetic, including inverses, is modulo .
- •
- •
Math — step by step
- •
- Negation is . Thus . Handle this vertical-line case before trying to divide by zero.
- •
- For distinct non-opposite points use slope . For doubling with , use . Doubling a point with gives .
- •
- The line meets the cubic at a third point; reflecting its y-coordinate gives the sum: and . Reduce each result modulo .
- •
- Scalar multiplication means repeated point addition, efficiently evaluated by doubling and adding. It is not coordinate-wise multiplication.
- •
- •
- •
Python
- •
def point_add(P, Q, a, p): if P is None: return Q if Q is None: return P x1, y1 = P; x2, y2 = Q if x1 == x2 and (y1 + y2) % p == 0: return None # point at infinity if P == Q: lam = (3*x1*x1 + a) * pow(2*y1, -1, p) % p else: lam = (y2 - y1) * pow(x2 - x1, -1, p) % p x3 = (lam*lam - x1 - x2) % p y3 = (lam*(x1 - x3) - y1) % p return (x3, y3) def scalar_mult(P, k, a, p): R = None while k > 0: if k & 1: R = point_add(R, P, a, p) P = point_add(P, P, a, p) k >>= 1 return R
- •
- •
SageMath
- •
E = EllipticCurve(GF(p), [a, b]) G = E.random_point() kG = k * G # scalar multiplication via the * operator, group law handled automatically
- •
- •
- •
Cards
- •
What geometric operation defines addition of two points on an elliptic curve?
- •
Draw the line through the two points, find its third intersection with the curve, and reflect across the x-axis.
- •
- •
What condition on a curve's coefficients guarantees it's a genuine (non-singular) elliptic curve?
- •
The discriminant 4a³+27b² must be nonzero (mod the field's characteristic) — a zero discriminant means the curve has a singular point, breaking the group law.
- •
- •