Elliptic Curves Over Finite Fields

15 min read

The previous article established arithmetic in F11\mathbb{F}_{11}. We now use that arithmetic to construct the points of one elliptic curve over the field, then add those points directly.

Throughout this article, the running example is

y2≡x3+x+1(mod11).y^2 \equiv x^3 + x + 1 \pmod{11}.

Before building it step by step, take a look at what the so called point cloud looks like:

You don't need to understand it right now. This is the final result that we are aiming to achieve throughout this article. This animation is merely to build some intuition of what the final result should be - a point cloud.

Some preliminary things you may have already noticed:

  • The axes list the field representatives 00 through 1010.
  • Some xx values have no corresponding yy value, most valid xx values have two yy values related by y↦−y mod 11y \mapsto -y \bmod 11, and the point (2,0)(2,0) has only one corresponding yy.

The choice p=11p = 11 keeps the field small enough to visualize while still defining a nonsingular elliptic curve. By the end of this article, we will reconstruct its 13 plotted affine points, add the point at infinity, and use the complete 14-element group for point addition.

Note

Recall that F11\mathbb{F}_{11} means arithmetic modulo 1111. Its elements are the representatives 00 through 1010, and every operation is reduced modulo 1111.

Next, we go step by step from the elliptic curve equation we have been seing so far, until we end up with the exact same result as above.

1. Start with an Elliptic Curve Over the Real Numbers

Consider the equation

y2=x3+x+1y^2 = x^3 + x + 1

Over the real numbers, where xx and yy may take any real value. For each chosen xx, we first compute the right side:

x3+x+1x^3 + x + 1

Whenever this value is non-negative, the corresponding real yy-coordinates are

y=±x3+x+1y = \pm\sqrt{x^3 + x + 1}

This produces two branches that are symmetric about the horizontal axis:

(x,y)and(x,−y)(x,y) \qquad\text{and}\qquad (x,-y)

The result is the familiar smooth elliptic-curve shape.

The curve is continuous because the underlying coordinate system is R2\mathbb{R}^2. Between any two real coordinate values, infinitely many other real values exist.

2. Replace the Infinite Coordinate Plane with a Finite Coordinate Set

Since we are primarily interested in elliptic curves over a finite field, we will want to convert the real number curve into a finite set of points.

So we first restrict the inputs xx and yy to not come from real numbers, but from natural numbers over some modulo pp - giving us a finite field:

Fp\mathbb{F}_p

containing the pp values

0,1,2,…,p−10, 1, 2, \ldots, p - 1

For the running example,

p=11p = 11

the possible coordinate representatives are

0,1,2,…,100, 1, 2, \ldots, 10

So both xx and yy must now come from this finite set. Visually, we can introduce a finite 11×1111 \times 11 coordinate grid:

0≤x<110≤y<110 \le x < 11 \qquad 0 \le y < 11

The real curve may remain visible in the background as a reference, but the square should not be interpreted as a literal crop of the real curve.

The finite-field curve is not the part of the real curve that happens to lie inside this square. The square only represents the available coordinate values in F11\mathbb{F}_{11}.

3. Restrict the Input xx to Field Elements

Over the real numbers, xx can vary continuously.

Over F11\mathbb{F}_{11}, there are only eleven possible values:

x∈{0,1,…,10}x \in \{0, 1, \ldots, 10\}

Define the right-hand-side polynomial

f(x)=x3+x+1f(x) = x^3 + x + 1

We now evaluate f(x)f(x) once for every possible field element xx.

For example:

f(0)=1f(1)=3f(2)=11f(3)=31f(4)=69\begin{aligned} f(0) &= 1 \\ f(1) &= 3 \\ f(2) &= 11 \\ f(3) &= 31 \\ f(4) &= 69 \end{aligned}

At this stage, these are still ordinary integer results. Some lie inside the range 00 to 1010, while others are much larger.

The important transition is that the continuous input axis has become a finite collection of discrete columns.

4. Reduce the Right-Hand Side Modulo pp

The coordinates and arithmetic now belong to F11\mathbb{F}_{11}, so every polynomial result must be reduced modulo 1111.

Define

rhs⁡(x)=(x3+x+1) mod 11\operatorname{rhs}(x) = (x^3 + x + 1) \bmod 11

For the previous values:

rhs⁡(0)=1rhs⁡(1)=3rhs⁡(2)=11 mod 11=0rhs⁡(3)=31 mod 11=9rhs⁡(4)=69 mod 11=3\begin{aligned} \operatorname{rhs}(0) &= 1 \\ \operatorname{rhs}(1) &= 3 \\ \operatorname{rhs}(2) &= 11 \bmod 11 = 0 \\ \operatorname{rhs}(3) &= 31 \bmod 11 = 9 \\ \operatorname{rhs}(4) &= 69 \bmod 11 = 3 \end{aligned}

Modulo reduction replaces every integer with its representative in

0,1,…,100, 1, \ldots, 10

A useful visual model is to move each temporary polynomial value vertically by a multiple of 1111 until it enters the finite coordinate window.

The resulting markers are the points

(x,rhs⁡(x))\bigl(x, \operatorname{rhs}(x)\bigr)

These markers show the modular value of the right-hand side for every possible xx.

They are not yet the elliptic-curve points.

This is the only part that resembles “wrapping.” We are wrapping discrete polynomial outputs modulo pp, not wrapping the continuous real curve itself.

5. Compute the Possible Values of y2y^2

The left-hand side of the elliptic-curve equation is

y2y^2

We must therefore evaluate

lhs⁡(y)=y2 mod 11\operatorname{lhs}(y) = y^2 \bmod 11

for every possible value

y∈{0,1,…,10}y \in \{0, 1, \ldots, 10\}

The first few results are:

02 mod 11=012 mod 11=122 mod 11=432 mod 11=942 mod 11=552 mod 11=362 mod 11=372 mod 11=582 mod 11=992 mod 11=4102 mod 11=1\begin{aligned} 0^2 \bmod 11 &= 0 \\ 1^2 \bmod 11 &= 1 \\ 2^2 \bmod 11 &= 4 \\ 3^2 \bmod 11 &= 9 \\ 4^2 \bmod 11 &= 5 \\ 5^2 \bmod 11 &= 3 \\ 6^2 \bmod 11 &= 3 \\ 7^2 \bmod 11 &= 5 \\ 8^2 \bmod 11 &= 9 \\ 9^2 \bmod 11 &= 4 \\ 10^2 \bmod 11 &= 1 \end{aligned}

The values mirror after y=5y = 5:

52 mod 11=62 mod 11=342 mod 11=72 mod 11=532 mod 11=82 mod 11=95^2 \bmod 11 = 6^2 \bmod 11 = 3 \qquad 4^2 \bmod 11 = 7^2 \bmod 11 = 5 \qquad 3^2 \bmod 11 = 8^2 \bmod 11 = 9

These repeated values are why one right-hand-side residue can produce two valid yy-coordinates.

This happens because

(−y)2=y2(-y)^2 = y^2

In modular arithmetic,

−y mod p=p−y-y \bmod p = p - y

so yy and p−yp - y produce the same square.

The values that can be written as y2 mod py^2 \bmod p are called quadratic residues modulo pp.

Not every field element is a quadratic residue. Therefore, not every right-hand-side value can correspond to a valid elliptic-curve point.

6. Match the Left-Hand Side with the Right-Hand Side

A coordinate pair (x,y)(x, y) belongs to the finite-field curve exactly when

y2≡x3+x+1(mod11)y^2 \equiv x^3 + x + 1 \pmod{11}

Using the helper functions introduced above, this condition is

lhs⁡(y)=rhs⁡(x)\operatorname{lhs}(y) = \operatorname{rhs}(x)

Consider x=3x = 3.

The right-hand side is

rhs⁡(3)=(33+3+1) mod 11=9\begin{aligned} \operatorname{rhs}(3) &= \bigl(3^3 + 3 + 1\bigr) \bmod 11 \\ &= 9 \end{aligned}

We now search for values of yy satisfying

y2≡9(mod11)y^2 \equiv 9 \pmod{11}

There are two solutions:

32=9≡9(mod11)3^2 = 9 \equiv 9 \pmod{11}

and

82=64≡9(mod11)8^2 = 64 \equiv 9 \pmod{11}

Therefore, the finite-field curve contains the two points

(3,3)and(3,8)(3,3) \qquad\text{and}\qquad (3,8)

For another xx, the right-hand-side residue may have:

  • two corresponding yy-values;
  • one corresponding yy-value in the special case y=0y = 0;
  • no corresponding yy-value when the residue is not a quadratic residue.

7. Repeat the Matching Process for Every xx

The construction is now repeated for every possible value

x∈{0,1,…,10}x \in \{0, 1, \ldots, 10\}

For each xx:

  1. Compute

    r=(x3+x+1) mod 11r = (x^3 + x + 1) \bmod 11
  2. Find every yy such that

    y2 mod 11=ry^2 \bmod 11 = r
  3. Add the corresponding coordinate pairs (x,y)(x, y).

Equivalently, the complete finite-field curve is

E(F11)={(x,y)∈F112  |  y2≡x3+x+1(mod11)}∪{O}E(\mathbb{F}_{11}) = \left\{ (x, y) \in \mathbb{F}_{11}^2 \;\middle|\; y^2 \equiv x^3 + x + 1 \pmod{11} \right\} \cup \{\mathcal{O}\}

Here, O\mathcal{O} is the point at infinity used as the identity element for elliptic-curve point addition. It is part of the mathematical group, but it does not appear as an ordinary point in the two-dimensional coordinate grid.

The plot contains 1313 ordinary, or affine, points. The full elliptic-curve group also includes O\mathcal{O}, so

#E(F11)=13+1=14.\#E(\mathbb{F}_{11}) = 13 + 1 = 14.

8. The Final Finite-Field Elliptic Curve

After all matches have been collected, the continuous real curve has disappeared. What remains is a finite set of isolated points.

This point cloud is the affine part of the elliptic curve over F11\mathbb{F}_{11} — the same 13-point cloud shown in the preview at the start of the article. Adding O\mathcal{O} gives the complete 14-element group used for point addition.

It looks unrelated to the smooth real curve because the underlying coordinate system and arithmetic have changed:

Real-number curveFinite-field curve
Coordinates belong to R\mathbb{R}Coordinates belong to Fp\mathbb{F}_p
Infinitely many possible coordinatesExactly pp possible values per axis
Ordinary arithmeticArithmetic modulo pp
Smooth and continuousFinite and discrete
Visual geometric curveAlgebraically defined point set

The defining equation is structurally the same:

y2=x3+ax+by^2 = x^3 + ax + b

What changes is the number system in which the equation is interpreted.

9. Why the Points Appear in Symmetric Pairs

Suppose (x,y)(x, y) satisfies the curve equation:

y2≡x3+ax+b(modp)y^2 \equiv x^3 + ax + b \pmod{p}

Because

(−y)2=y2(-y)^2 = y^2

the point

(x,−y)(x, -y)

also satisfies the equation.

Inside Fp\mathbb{F}_p, the additive inverse of yy is represented by

p−yp - y

Therefore, finite-field points usually occur in pairs:

(x,y)and(x,p−y)(x,y) \qquad\text{and}\qquad (x, p-y)

For example, with p=11p = 11,

3+8=11≡0(mod11)3 + 8 = 11 \equiv 0 \pmod{11}

Thus 88 is the modular additive inverse of 33, and the points

(3,3)and(3,8)(3,3) \qquad\text{and}\qquad (3,8)

form a symmetric pair.

The visual symmetry lies around the middle of the coordinate range, but its mathematical cause is modular additive inversion—not ordinary reflection geometry.

10. What Modulo Does—and Does Not Do

It is useful to distinguish three different ideas.

10.1. Modulo does

  • restrict coordinates to the representatives 0,…,p−10, \ldots, p - 1;
  • reduce polynomial results into that range;
  • define addition, subtraction, multiplication, and division inside Fp\mathbb{F}_p;
  • determine which coordinate pairs satisfy the elliptic-curve equation.

10.2. Modulo does not

  • crop the real elliptic curve;
  • round real-valued curve points to integers;
  • sample points directly from the real curve;
  • fold the entire continuous curve into a square.

The real and finite-field plots are two visualizations of the same algebraic equation interpreted over different number systems.

The real curve provides useful geometric intuition, but the finite-field point set must be computed directly using modular arithmetic.

11. Point Addition Over a Finite Field

The chord-and-tangent picture from the real-number curve is useful intuition, but it is not a literal construction over Fp\mathbb{F}_p. There is no continuous curve or ordinary straight line to draw through the finite point cloud.

Instead, the same group law is defined algebraically with finite-field arithmetic. For a short Weierstrass curve over a prime field with p>3p > 3, let

P=(x1,y1)andQ=(x2,y2).P=(x_1,y_1) \qquad\text{and}\qquad Q=(x_2,y_2).

When P≠QP \ne Q and x1≠x2x_1 \ne x_2, calculate the slope using a modular inverse:

λ=(y2−y1)(x2−x1)−1(modp).\lambda = (y_2-y_1)(x_2-x_1)^{-1} \pmod p.

Then the sum is P+Q=(x3,y3)P+Q=(x_3,y_3), where

x3=λ2−x1−x2(modp),y3=λ(x1−x3)−y1(modp).\begin{aligned} x_3 &= \lambda^2-x_1-x_2 \pmod p, \\ y_3 &= \lambda(x_1-x_3)-y_1 \pmod p. \end{aligned}

If PP and QQ have the same xx-coordinate but are different points, then Q=−PQ=-P and:

P+Q=O.P+Q=\mathcal{O}.

For point doubling, when P=QP=Q and y1≠0y_1 \ne 0, use:

λ=(3x12+a)(2y1)−1(modp),\lambda=(3x_1^2+a)(2y_1)^{-1}\pmod p,

followed by the same formulas for x3x_3 and y3y_3. If y1=0y_1=0, then P=−PP=-P, so:

2P=O.2P=\mathcal{O}.
Important

Division in these formulas means multiplication by a modular inverse. The denominator must be non-zero; the exceptional cases above handle the times when it is zero.

Example: Doubling a point in E(\mathbb{F}_{11})

On the running curve, a=1a=1 and P=(1,5)P=(1,5). Because 10−1≡10(mod11)10^{-1}\equiv10\pmod{11}:

λ=(3⋅12+1)(2⋅5)−1=4⋅10≡7(mod11).\lambda=(3\cdot1^2+1)(2\cdot5)^{-1} =4\cdot10 \equiv7\pmod{11}.

Therefore:

x3=72−1−1≡3(mod11),y3=7(1−3)−5≡3(mod11).\begin{aligned} x_3&=7^2-1-1\equiv3\pmod{11},\\ y_3&=7(1-3)-5\equiv3\pmod{11}. \end{aligned}

So 2(1,5)=(3,3)2(1,5)=(3,3). Adding (1,5)(1,5) to (3,3)(3,3) with the distinct-point formula gives 3(1,5)=(8,2)3(1,5)=(8,2).

These formulas produce the same abstract group operation introduced earlier. Together with O\mathcal{O}, the points of a nonsingular finite-field curve form an abelian group, even though the real-number geometric construction is no longer literal.

12. Nonsingular Curves

Choosing a prime modulus does not mean that every curve is automatically suitable. The curve must also be nonsingular.

For a short Weierstrass curve

y2=x3+ax+by^2 = x^3 + ax + b

over a field of characteristic greater than 33, the nonsingularity condition is

4a3+27b2≢0(modp)4a^3 + 27b^2 \not\equiv 0 \pmod{p}

For the running example,

a=1,b=1,p=11a = 1, \qquad b = 1, \qquad p = 11

we obtain

4(13)+27(12)=31≡9(mod11)4(1^3) + 27(1^2) = 31 \equiv 9 \pmod{11}

which is nonzero. Therefore, the curve is nonsingular over F11\mathbb{F}_{11}.

13. Complete Construction Algorithm

The full point set can be computed directly with the following procedure:

points = []

for x in 0 .. p-1:
    rhs = (x^3 + a*x + b) mod p

    for y in 0 .. p-1:
        lhs = y^2 mod p

        if lhs == rhs:
            points.append((x, y))

14. From This Toy Cloud to Production Curves

Our running example uses p=11p = 11 so that every calculation and every point fits on the page. It is useful for learning, but it offers no security: anyone can enumerate its tiny field, list its curve points, and try every possible scalar.

Production ECC uses exactly the same ideas—evaluate an elliptic-curve equation over a finite field and add its points with finite-field arithmetic—but with a published parameter set and a much larger prime. The remaining public parameters that turn the group into a key system are introduced in the next article.

For example, the real-number graph of

y2=x3+7y^2 = x^3 + 7

is a smooth curve. The production curve secp256k1 uses that same polynomial over the finite field

p=2256−232−977p = 2^{256} - 2^{32} - 977

so its defining equation is

y2≡x3+7(modp)y^2 \equiv x^3 + 7 \pmod{p}

The construction is the same as our p=11p = 11 point cloud, but the scale is completely different.

Production curveField sizeEquation formNotes
secp256k1p=2256−232−977p = 2^{256} - 2^{32} - 977y2≡x3+7(modp)y^2 \equiv x^3 + 7 \pmod{p}A short-Weierstrass curve, like the form used in this article.
P-256 / secp256r1a 256-bit prime fieldy2≡x3−3x+b(modp)y^2 \equiv x^3 - 3x + b \pmod{p}Another standardized short-Weierstrass parameter set.
Curve25519p=2255−19p = 2^{255} - 19v2≡u3+486662u2+u(modp)v^2 \equiv u^3 + 486662u^2 + u \pmod{p}Uses the Montgomery form rather than the short-Weierstrass form.

With p=11p = 11, the coordinate grid has only

112=12111^2 = 121

possible coordinate pairs, and our curve has only 1313 ordinary points. For a roughly 256-bit production field, the coordinate grid has about 25122^{512} possible locations and the curve has on the order of 22562^{256} points. A literal point-by-point plot would therefore look like a dense square or noise, not like the sparse cloud above.

The graph below draws a tiny, genuine sample of secp256k1 points. The coordinates are scaled down for display; it is not the complete point cloud.

The large modulus is not only about making the picture bigger. Together with a carefully selected curve and a large prime-order subgroup, it makes recovering a secret scalar from a public point computationally infeasible. A 256-bit field is commonly chosen to target roughly 128 bits of classical security.

A large prime alone is not enough. Real systems use vetted, standardized curve parameters and must validate points and handle scalar arithmetic correctly.

15. Summary

The path from the real elliptic curve to the finite-field point cloud is:

The cloud is not a distorted image of the real curve.

It is the complete set of coordinate pairs in Fp2\mathbb{F}_p^2 that satisfy the same algebraic equation under modular arithmetic.

Comments