Elliptic-curve point count over a finite field (source code)

= Elliptic-curve point count over a finite field

If $\alpha,\beta$ are the roots of $T^2-aT+q$, where $a=q+1-\#E(\mathbb F_q)$, then
$$
\#E(\mathbb F_{q^r})=q^r+1-\alpha^r-\beta^r.
$$