3 Explaining the core of elliptic curve mathematics
This chapter introduces the core mathematics behind elliptic curves by first building intuition in the familiar real-number plane and then carrying the same ideas into finite fields. It explains that an elliptic curve can be viewed as a set of points satisfying an equation of the form \(y^2=x^3+a_4x+a_6\), with each point having a negation given by \(-(x,y)=(x,-y)\). The special point at infinity acts as the additive identity, making it possible to define a full algebra of points on the curve and to represent that identity in code with a simple sentinel value.
The text then shows how elliptic curves support point addition and point multiplication using formulas that work over both the real numbers and finite fields. To add two points, one computes a slope, then derives the new coordinates from that slope; when the same point is added to itself, a tangent-based case is handled with a unified formula to reduce side-channel leakage. Point multiplication is built from repeated doubling and conditional addition, following a binary “double and add” approach that is efficient and commonly used in cryptographic implementations.
Finally, the chapter translates the mathematics into practical code and introduces ways to embed arbitrary data onto a curve. It defines simple structures for points and curves, routines for initializing, copying, testing, printing, and generating random points, and the implementation details for addition and multiplication over a prime field. For data embedding, the method starts from a candidate \(x\) value, checks whether the corresponding curve value is a quadratic residue, and increments until a valid point is found, then derives the two possible \(y\) values. Together, these routines form the computational foundation needed for later elliptic curve cryptography.
Elliptic curve \(y^2=x^3-5 x +5\)
Elliptic curve over the complex plane
Points on a curve over a complex plane
Adding a point to itself
Double and add method
All points on tiny elliptic curve \(y^2=x^3+23x-1\) mod \(43\)
Embedding data on a curve
Summary
- The fundamental formula for ordinary elliptic curves is \[y^2=x^3+a_4 x + a_6\]
- The sum of two points on an elliptic curve is the negative point of the intersection point to the curve of a line drawn between them.
- The point at infinity is not on the curve. It is the identity element and, for ordinary curves, can be represented as \((0, 0)\) in code.
- Elliptic curves over finite fields have a 1-to-1 mapping to curves over the complex plane.
- The point addition formula has a special form for use in secure applications. Using a standard form can leak key information when side channel attacks are applied.
- Point multiplication uses a double and add algorithm to rapidly compute extremely large prime multipliers.
- When the point \(mP\) is the point at infinity 0, then \(P\) is order \(m\) and a member of the \(m\)-torsion subgroup.
- For coding, curves and points have simple structures, which include \((a_4, a_6)\) and \((x, y)\), respectively.
- The point addition routine must check for the point at infinity on input and output.
- Point multiplication code uses the same addition routine for doubling and adding to enhance security.
- To embed data on a curve the \(x\) value is incremented until \(x^3+a_4 x + a_6\) is a quadratic residue. When sending a message on a curve point, the last 6 to 8 bits should be considered noise.
- Random points are found by embedding random \(x\) values on the curve. This will be useful for many routines described throughout the book.
FAQ
What is an elliptic curve in this chapter’s simplified form?
An elliptic curve is written asy^2 = x^3 + a4*x + a6. In this chapter, the focus is on ordinary curves over finite fields, so the other coefficients from the general equation are set to 0.Why does every valid x-value on an elliptic curve usually have two y-values?
Because the equation involvesy^2, each valid x-value usually gives two square roots: one positive and one negative. So the points appear as (x, y) and (x, -y).What is the point at infinity and why is it important?
The point at infinity is the identity element for elliptic curve addition. It is not actually on the curve, but it behaves like zero: any point plus it is the same point, and a point added to its inverse gives the point at infinity.How is the negative of a point on an elliptic curve defined?
The negative of(x, y) is (x, -y). The x-coordinate stays the same, while the y-coordinate changes sign.How do you add two different points on an elliptic curve?
Draw a line through the two points, find where it intersects the curve, and then reflect that intersection point across the x-axis. Algebraically, you compute the slopeλ, then calculate the new x- and y-coordinates from the point addition formulas.What happens when you add a point to itself?
That is point doubling. Instead of a line through two distinct points, you use the tangent line at the point. The same point addition formulas are used, but the slope is computed for the tangent case.Why is the condition y1 + y2 = 0 a special case in point addition?
If y1 + y2 = 0, the denominator in the slope formula becomes 0, so the slope is undefined. In that case, the result is the point at infinity.What is point multiplication in elliptic curve cryptography?
Point multiplication means adding a point to itselfk times, written as Q = kP. In practice, this is done efficiently using the double-and-add method rather than repeated addition.Why does the chapter use the double-and-add method for multiplication?
It is much faster than adding the point one step at a time. The method processes the bits of the scalar, doubling each round and adding the original point when a bit is set.How can arbitrary data be embedded onto an elliptic curve?
Start with a candidate x-value, computef(x) = x^3 + a4*x + a6, and test whether it has a square root. If not, increment x and try again until a valid point is found. Then compute the two possible y-values and keep both points.
Elliptic Curve Cryptography for Developers ebook for free