Group order and Hasse's theorem
The number of points on the curve #E(Fp) is one of the most important values in ECC: all private keys live in a group of exactly this order. Hasse's theorem bounds this number to a very narrow interval:
|#E(F_p) - (p + 1)| <= 2 * sqrt(p)
That is, the number of points is always around p + 1. For a small p, the exact number can be counted directly: for each x = 0..p-1 we calculate v = x³ + a·x + b and
- if
v = 0— 1 point (y = 0); - if
vis a quadratic residue — 2 points (±y); - otherwise — 0 points.
At the end, do not forget to add +1 for the point at infinity O. Euler's criterion tells whether v is a quadratic residue or not: if the value of pow(v, (p-1)//2, p) is 1, it is a residue, if p-1, it is not a residue.
Find #E(Fp) for the following curve:
p = 65599
a = 50406
b = 59578
For checking: Hasse interval — [65088, 66112]. Your answer must be within this interval.
Answer: number only — in decimal format, without spaces and without additional characters (for example 1234).