The Problem with Real Numbers
So far, we’ve drawn smooth curves with real numbers.
But computers can’t store infinite decimal precision. And cryptography needs exact arithmetic.
The solution: work with integers modulo a prime .
Modular Arithmetic
Instead of:
We compute:
Same equation as before, we just added to both sides.
Now and can only be integers from to .
A Small Example
Let’s use and the curve .
Is on the curve?
, so no.
Is on the curve?
, so yes!
What Changes?
The curve is no longer smooth. It becomes a scattered set of points.
But the key insight: point addition still works.
The same formulas apply, just with modular arithmetic. The scattered points still form a group, and we can still do efficiently.
This is how real cryptographic curves work. secp256k1 (used by Bitcoin) uses a 256-bit prime.