J
OURNAL DE
T
HÉORIE DES
N
OMBRES DE
B
ORDEAUX
R
ENÉ
S
CHOOF
Counting points on elliptic curves over finite fields
Journal de Théorie des Nombres de Bordeaux, tome
7, n
o1 (1995),
p. 219-254
<http://www.numdam.org/item?id=JTNB_1995__7_1_219_0>
© Université Bordeaux 1, 1995, tous droits réservés.
L’accès aux archives de la revue « Journal de Théorie des Nombres de Bordeaux » (http://jtnb.cedram.org/) implique l’accord avec les condi-tions générales d’utilisation (http://www.numdam.org/conditions). Toute uti-lisation commerciale ou impression systématique est constitutive d’une infraction pénale. Toute copie ou impression de ce fichier doit conte-nir la présente mention de copyright.
Article numérisé dans le cadre du programme Numérisation de documents anciens mathématiques
Counting
points
onelliptic
curves overfinite
fields
par
RENÉ
SCHOOFABSTRACT. -We describe three algorithms to count the number of points
on an elliptic curve over a finite field. The first one is very practical when the finite field is not too large; it is based on Shanks’s baby-step-giant-step
strategy. The second algorithm is very efficient when the endomorphism
ring of the curve is known. It exploits the natural lattice structure of this
ring. The third algorithm is based on calculations with the torsion points
of the elliptic curve
[18].
This deterministic polynomial time algorithm wasimpractical in its original form. We discuss several practical improvements by Atkin and Elkies.
1. Introduction.
Let p be a
large
prime
and let E be anelliptic
curve overFp
given
by
aWeierstraB
equation
for some
A,
B EFp.
Since the curve is notsingular
we have that4A3
+2782 ~
0(mod p~ .
We describe several methods to count the rationalpoints
onE,
i.e.,
methods to determine the number ofpoints
{x, y)
on Ewith x, y E
Fp.
Most of what we sayapplies
toelliptic
curves over anyfinite base field. An
exception
is thealgorithm
in section 8.In this paper we
merely
report
on workby
others;
these results have notbeen and will not be
published by
the authors themselves. We discuss analgorithm
due to J.-F.Mestre,
anexposition
of Cornacchia’salgorithm
dueto H.W. Lenstra and recent work
by
A.O.L. Atkin and N.D. Elkies. Let.E{Fp)
denote the set of rationalpoints
of E. It is easy to see thatthe number of
points
inE(Fp)
withgiven
X-coordinate x EFp
is0, 1
or 2. Moreprecisely,
there arerational
points
on E with X-coordinateequal
to x. Herep
denotes thequadratic
residuesymbol. Including
thepoint
atinfinity,
the set of rationalpoints
E(Fp)
of E therefore hascardinality
This
implies
thatevaluating
the sumis the same
problem
ascomputing
#E(Fp) .
For very small
primes
(p
200say)
astraightforward
evaluation of thissum is an efficient way to
compute
~E (Fp) .
Inpractice
it is convenient tomake first a table of squares modulo p and then count how often is a square for x =
0, 1,
... , p -- 1. The
running
time of thisalgorithm
isfor every c > 0.
For
larger
p, there are betteralgorithms.
In section 2 we discuss anal-gorithm
based on Shanks’sbaby-step-giant-step
strategy.
Itsrunning
timeis for every c > 0. This
algorithm
ispractical
for somewhatlarger
primes;
it becomesimpractical
when p has morethan,
say, 20dec-imal
digits.
In section 3 weexplain
a clever trick due to J.-F.Mestre[6,
Alg.7.4.12]
whichsimplifies
certain group theoreticalcomputations
in thebaby-step-giant-step algorithm.
This version has beenimplemented
in the PARIcomputer
algebra
package
[4].
In section 4 we discuss an
algorithm
to count the number ofpoints
on anelliptic
curve E overFp,
when theendomorphism ring
of .E is known.It is based on the usual reduction
algorithm
for lattices inR,2.
We dis-cuss Cornacchia’s relatedalgorithm
[7]
and H.W. Lenstra’sproof
[15]
of its correctness.In section 5 we discuss a deterministic
polynomial
timealgorithm
tocount the number of
points
on anelliptic
curve over a finite field[18].
Itis based on calculations with torsion
points.
Therunning
time isO (log8p),
but thealgorithm
is not very efficient inpractice.
In sections6,
7 and 8 weexplain practical improvements by
A.O.L. Atkin[1, 2]
and N.D. Elkies[l0].
These enabled Atkin in 1992 tocompute
the number ofpoints
on the curvemodulo the the smallest 200
digit
prime:
The result is
The curve is "random" in the sense that it was
inspired by
the addressof the INRIA institute: Domaine de Voluceau -
Rocquencourt,
B.P.105,
78153 LeChesnay
cedex. See the papersby
Morain andCouveignes
[8,17]
andby
Lehmann et ale[13]
for evenlarger
examples.
There are several unsolved
computational
problems concerning elliptic
curves over finite fields. There
is,
forinstance,
no efficientalgorithm
known to find the Weierstraflequation
of anelliptic
curve overFp
with agiven
number of rational
points.
Theproblem
ofefficiently computing
thestruc-ture of the group of
points
over a finitefield,
or, moregenerally,
theproblem
of
determining
theendomorphism
ring
of agiven
elliptic
curve, is also veryinteresting.
Finally,
Elkies’simprovement, explained
in sections 7 and8,
applies only
to half the
primes
1: those for which the Frobeniusendomorphism
acting
onthe 1-torsion
points,
has itseigenvalues
inFi.
It would be veryinteresting
to extend his ideas to the
remaining
I.Recently
the methods of section 8 have been extendedby
J.-M.Cou-veignes
[9]
tolarge
finite fields of smallcharacteristic,
inparticular
tolarge
finite fields of characteristic 2. This
problem
first came up incryptogra-phy
[16].
Couveignes
exploits
the formal group associated to theelliptic
curve.
I would like to thank J.-M.
Couveignes,
D. Kohel and H.W. Lenstra for their comments on earlier versions of this paper.2.
Baby
steps
andgiant
steps.
In this section we
explain
thebaby-step-giant-step algorithm
tocompute
the number of
points
on anelliptic
curve E overFp
given
by
Y2
=X3
+ AX + B. The mostimportant
ingredient
is the fact that the set ofpoints
forms an additive group with the well-known chord andtangent
method:
Fig.l. The group law.
The
point
atinfinity
(0 :
1 :0)
is the neutral element of this group. Theopposite
of apoint
P = is thepoint
It isvery easy
to derive
explicit
formulas for the addition ofpoints:
if P =(Xl,
Yl)
and~ _
(X2, y2)
are twopoints
withQ :1= - P,
then their sum is(X3,
Y3)
whereHere A is the
slope
of the linethrough
P andQ.
We have A =(y2
-yl)/(x2 - XI) if
P,- Q
and A =(3x
+A) /2yi
otherwise.The
following
result,
theanalogue
of the RiemannHypothesis, gives
anTheorem 2.1.
(H.
Hasse,
1933)
Let p be aprime
and Iet E be anelliptic
curve over
Fp.
ThenProof. See
[21].
The groups
E(Fp)
"tend" tobe cyclic.
Notonly
canthey
begenerated
by
at most twopoints,
but for anyprime l,
theproportion
of curves E overFp
with theI-part
ofE~Fp~
notcyclic does,
roughly speaking,
not exceed1/~-1).
The idea of the
algorithm
is topick
a randompoint
P EE(Fp)
and tocompute
aninteger
m in the interval(p
+ 1-2qfi, p
+ 1 +2vfP)
such that mP = 0. If m is theonly
such number in theinterval,
it follows fromTheorem 2.1 that m =
#E(Fp).
To
pick
thepoint
P =(x, y)
inE~Fp)
onejust
selects random values ofx until
X3
+ Ax + B is a square inFp.
Thencompute
a squareroot y
ofx3
+ Ax + B. See[20]
and[6, Alg.1.5.11
for efhcientpractical
methods tocompute
square roots mod p.The number m is
computed
by
means of theso-called
baby-step-giant-step
strategy
due to D. Shanks[19];
see also[6, Alg.5.4.1].
His methodproceeds
as follows. First make thebaby
steps:
make a list of the firsts x
~
multiples
P, 2P, 3P, ... ,
sP of thepoint
P. Notethat,
since theinverse of a
point
is obtainedby inverting
thesign
of itsY-coordinate,
oneactually
knows the coordinates of the 2s + 1points:
0,
~P,
::l:2P,
... , ~sP.Next
compute
Q
=(2s
+1)P
andcompute,
using
thebinary expansion
of p+1,
thepoint
R =(p+ I)P. Finally
make thegiant
steps:
by
repeatedly
adding
andsubtracting
thepoint Q
compute R,
R ±Q,
R ±2C~, ... ,
R ~tQ.
Here t =[2y’P/(2s
+1)],
which isapproximately
equal
toBy
Theorem
2.1,
thepoint
R +iQ
is,
for someinteger
i =0,
±1,
±2,... ,
~tequal
to one of thepoints
in our list ofbaby
steps:
for this i one has thatPutting
m = p + 1 +(2s
+I)i -- j,
we have mP = 0. Thiscompletes
thedescription
of thealgorithm.
It is
important
that one canefficiently
search among thepoints
in thelist of
baby
steps;
one should sort this list or use some kind of hashcoding.
It is not difhcult to see that therunning
time of thisalgorithm
isfor every - > 0. The
algorithm
fails if there are two distinctintegers
m,m’
in the interval
(p
+ 1 ~- + 1 +2JP)
with mP =m’P
= 0. Thisrarely
happens
inpractice.
If itdoes,
then(m - m’) P
= 0 and oneknows,
infact,
the order d of P.
Usually
it suffices torepeat
thealgorithm
with a secondrandom
point.
The factthat,
thistime,
one knows that d divides#E(Fp)
usually
speeds
up the secondcomputation
considerably.
Very
rarely
thealgorithm
is doomed to fail because there is for everypoint
P more than one m in the interval(p
+ 1-2JP,p
+ 1 +2JP)
for which mP = 0. Thishappens
when theexponent
of the groupE(Fp)
is very small.Although writing
a program that covers these rareexceptional
cases is somewhatpainful,
these are not very seriousproblems;
one cancompute
independent
generators
for the group, ... etc. In the next sectionwe discuss Mestre’s
elegant
trick to avoid thesecomplications.
3. Mestre’s
algorithm.
We
explain
an idea of J.-F. Mestre to avoid the group theoreticalcom-plications
that were mentioned at the end of section 2. Itemploys
thequadratic
twist of E. If theelliptic
curve E isgiven
by
theWeierstraB-equation y2
=X3
+ AX +B,
then the twisted curve E’ isgiven by
gY2 -
X~
+ AX + B for some non-square g EFp.
Theisomorphism
class of this curve does notdepend
on the choice of g. It is easy to see thatis a
WeierstraB-equation
of the curve B’. It follows from the formulagiven
in the introduction that
#E’(Fp)
+ #E(Fp)
=2 ~p +
1).
Therefore,
in orderto
compute
one may as wellcompute
~E’~Fp).
It follows from Theorems 3.1 and 3.2 below that if has a very smallexponent,
thenthe group of
points
on itsquadratic
twistE’
does not. One can use thisobservation as follows: if for a curve
E,
thebaby-step-giant-step
strategy
has failed for a number of
points
P because each time more than one valueof m was found for which mP =
0,
thenreplace
Eby
itsquadratic
twist E’ andtry
again. By
the discussion at the end of section3,
it is verylikely
that this time thealgorithm
will succeed.Before
formulating
Theorems 3.1 and 3.2 we introduce a few morecon-cepts :
the j -invariant
of anelliptic
curve B which isgiven by
theequation
It is easy to see that E and its
quadratic
twist E’ have the samej-invariants.
For most
j-invariants j
EFp
there are, up toisomorphism,
precisely
twoelliptic
curves E overFp with j(E)
=j:
a curve E and itsquadratic
twist. There are two well knownexceptions: j =
0 when p == 1(mod
3)
andj
= 1728 when p = 1(mod
4).
In the first case there are six curves and inthe second case there are four.
The
morphisms
f :
E - E that preserve thepoint
atinfinity
form thering
End(E) ofF p-endomorphisms
of
E. It isisomorphic
to acomplex
quadratic
order. If A EZo
denotes the discriminant of the order we havewhere 6 = 2
or b = °
2depending
on whether A is even or odd. Anelliptic
curve and itsquadratic
twist haveisomorphic
endomorphism rings.
If p = 1
(mod 3),
the six curveswith j
= 0 all have theirendomorphism
ring
isomorphic
toZ[(l
+--3~~2~
andif p m 1 (mod
4),
the four curves Ewith j
= 1728 all haveEnd(E)
isomorphic
to thering
of Gaussianintegers
ZM.
The Frobenius
endomorphism
p EEnd(.E)
isthe endomorphism
given
by
’
It satisfies the
quadratic
relationin the
endomorphism ring
of ~E. Here t is aninteger
which is related to the number ofFp-points
on Eby
The group
E (F p )
isprecisely
the kernel of thehomomorphism
p - 1
acting
on the group of
points
over analgebraic
closure ofFp.
Therefore theexponent
of the groupE(Fp)
is(p
+ 1-t) /n,
where n is thelargest integer
suchE(Fp)
admits asubgroup
isomorphic
toZ/nZ
xZ/nZ.
Equivalently,
n is thelargest integer
forwhich p
z 1(mod n)
inEnd(E).
Theorem 3.1.
~J.-F. Mestre)
Let p > 457 be aprime
and let E be anelliptic
curve overFp.
Then either E or itsquadratic
twist E’ admits anProof. The
endomorphism
rings
of E and E‘ are bothisomorphic
to thesame
quadratic
order 0 of discriminant A.Let p
E ~ denote the Frobeniusendomorphism
of E. Let n be thelargest
integer
suchthat p
= 1(mod n)
inEnd(E)
and let N =(p
+ 1 -t)/n
denote theexponent
ofE(Fp).
We have thatwhich
implies
that n divides the index[0 :
SinceE~ :
isequal
to thequotient
of the discriminants of the orders 0 and we see thatn2 divides
(tz -
4p)/A.
Similarly,
let m be thelargest
integer
such that -~p = 1(mod
m)
inEnd(E)
and let NI =(p
+ 1 +t)/m
denote theexponent
ofE’(Fp).
ThenTherefore
m2
also divides(t~ -
4p)/ A.
Since n divides~p -1
and m dividesp +
1,
we see thatgcd(n, m)
divides which divides 2.Therefore ~ .
3 this
implies
that(nrn~2
4 3
* If bothexponents
N andM are less than we have that
and therefore
which
implies
that p 1362.A
straightforward
case-by-case
calculation shows that the theorem also holds for theprimes
p with 457 p 1362. Thiscompletes
theproof.
For p = 457 the theorem is not valid: consider the curve
given by
Its
j-invariant
is 0 and thering
ofendomorphisms
isZ~b~,
where6 = (1 +
endomorphism
isgiven by p
= -17 + 246 which has trace -10. The group ofpoints
overF457
hascardinality
468 and since cp = 1 -6(3 -
4b),
it isisomorphic
toZ/78Z ? Z/6Z.
Thequadratic
twistY2
=X3 -125
has Frobenius 17 - 246 = 1 +8(2 -
36).
The group of rationalpoints
hascardinality
468 and isisomorphic
toZ/56Z ? Z/8Z.
Both groups have anexponent
notexceeding
4 457 N
85.51023.Note that the result mentioned in
[6, Prop.7.4.11]
is not correct.To make sure that the
baby-step-giant-step
algorithm
asexplained above,
works for an
elliptic
curve overE,
one does notreally
need to find a rationalpoint
on E of order at least What one needs is apoint
P as describedin the
following
theorem.Theorem 3.2. Let p > 229 be a
prime
and let E be anelliptic
curve overFp.
Then either E or itsquadratic
twistE’
admits anFp-rational
point
P with theproperty
that theonly integer
m E(p
+ 1-2VP,p
+ 1 + for which mP = 0 is the order of the group ofpoints.
Proof.
By
theproof
of Mestre’sresult,
the theorem is true for p > 457. Acase-by-case
calculation shows that it isactually
true for p > 229.For p = 229 the theorem is not valid: consider the curve
given by
Its
ring
ofendomorphisms
isagain
Z[b].
The Frobeniusendomorphism
isgiven
by cp
= -17 + 126 which has trace -22.Since p
= 1 +6(-3
+26)
the group ofpoints
overF229
hascardinality
252 and isisomorphic
toZ/42Z0153Z/6Z.
Thequadratic
twisty2
=X 3 - 8
has Frobenius 17 + 126 =1 -
4(4 - 3~).
The group of rationalpoints
hascardinality
208 and isisomorphic
toZ/52ZOZ/4Z.
Every
rationalpoint
on the curvey2 = X3-1
is killed
by
the order of the group252,
but alsoby
252 - 42 = 210.Every
rational
point
on the twisted curvey2
=X~ -
8 is killedby
both 208 andby
260 = 208 + 52.The interval
(p
+ 1 -2Vp-,p
+ 1 +2JP)
contains theintegers
200,
201,
... ,
259,
260.Many
of the curves E for which Theorem 3.2.fails,
have theirj-invariants
equal
to 0 or 1728 and therefore theirendomorphism rings
areisomorphic
toZ[(1
+H)/2]
orZ[il
respectively. However,
if one knowswhen p is very
large.
This is a consequence of Theorem 4.1 of the nextsec-tion. When one excludes the curves with
j-invariant
0,
then Theorem 3.1 is correct for p > 193 and Theorem 3.2 is correct for p > 53.4. Cornacchia’s
algorithm.
In this section we
explain
how to count the number ofpoints
on anelliptic
curve.E,
when theendomorphism ring
of E is known. In this case there is anextremely
efficientpractical
algorithm.
It forms the basis of theprimality
test of Atkin and Morain[3].
As
usual,
p is alarge
prime
and E is anelliptic
curve overFp
given
by
aWeierstra13-equation
y2
=X3
+ AX + B. Let A denote the discriminant of theendomorphism ring
End(E)
of E. Recall thatEnd(E)
isisomorphic
to a
subring
of C:where 6
2
or2
depending
on whether A is even or odd.The Frobenius
endomorphism p
EEnd(E)
satisfies = 0 wheret is an
integer
satisfying
t2
4p.
It is related to#E(Fp)
by
the formula#E(Fp)
= p + 1- t. If p dividesA,
then t = 0 and#E(Fp)
= p + 1. Therefore we assume from now on that p does not divide A. In order tocompute
#E(Fp),
it suffices tocompute cp
EEnd(E) ~
Z[6]
c C. First weobserve that p = This shows that the
prime
psplits
inEnd(E)
into aproduct
of the twoprincipale prime
ideals(cup)
and(IT)
of index p.The idea of the
algorithm
is tocompute
agenerator
of aprime divisor p
of p in
Z[6].
If~ ~
-3 or-4,
agenerator
isunique
up tosign
and hence weobtain
(or
itsconjugate)
and therefore t up tosign.
This leavesonly
twopossibilities
for#E(Fp).
It is not difficult to decide which of the twopossible
values is the correct one. One eitherpicks
a randompoint Q
E and checks whether(p
+ 1 ~t)Q
= 0 or one considers the action of cp on the 3-torsionpoints.
When A = -3 or-4,
there are 6 and4
possibilities respectively
for the value of t. These cases can be handledin a
similar,
efficient way[14, p.112].
To
compute
agenerator
of theprime
ideal p
CZ[b]
we firstcompute
asquare root b of A modulo p.
Replacing
bby
p - b if necessary, we mayprime
ideal of index p. It divides p.Since p
isprincipal,
the fractional idealis
equal
to an ideal of the form(Z
+62)a
for some a EZ[b].
In otherwords,
there is a matrix(p $)
ESL2 (Z)
such thatInspection
of theimaginary
parts,
shows that =p. Therefore
r + sb is a
generator
of either theideal p
or itsconjugate.
To find the matrix
(~ ~),
we consider the usual action of the groupSL2 (Z)
on the upper half
plane
Iz
E C : Imz >0}.
Both(b
+B/A)/2
and b arein the same
SL2(Z)-orbit
and b is contained in the standard fundamentaldomain.
By
successiveapplications
of the matrices(~l~)
and(~ k) 1
ESL2(Z)
onetransforms z =
to
6. The matrix(:)
is then theproduct
of all the2p
r s
matrices involved.
This
algorithm
is well known. It is areformulation
of the usualalgo-rithm for
reducing
positive
definitequadratic
forms. It is very efhcient[6,
Alg.5.4.2].
We do notgive
all the details because thefollowing
theorem[7]
gives
an evensimpler
solution ourproblem.
Theorem 4.1.
(G.
Cornacch.ia,
I908)
Let 0 be acomplex quadratic
orderof discriminant 0 and let p be an odd
prime
number for which A is anon-zero square modulo p. Let x be an
integer
withx 2 =- A
(mod p),
x - ~
(mod 2)
and 0 x2p.
Defne the finiEe sequence ofnon-negative
integers
xo, x~, ... , xt = 0 as follows,xo
= 2p,
zi = x,
xi+l the remainder after division
by
xi.Let i be the smallest index for
which xi
2JP.
If A dividesx2 -
4p
and thequotient
is a squarev2,
thenis a
generator
of aprime
ideal p
of 0dividing
p. Ifnot,
then theprime
ideals p of 0 that divide p are notprincipal.
Proof.
(H.W.
Lenstra[15])
The ideal p =((x -
~~~2, p~
of 0 is aprime
divisor of p. We
view p
as a lattice L in C. We define a finite sequence ofelements zt E L
by
zo = p,(x -
B/A)/2
andwhere q E
Z>o
is theintegral
part
ofRezi/Rezi-1.
Since the sequenceRe Zi
isstrictly
decreasing,
thelast zt
has realpart
equal
to 0. The traces zi + zi areprecisely
the Xi
in Cornacchia’salgorithm.
Theimaginary
parts
of
the Zi
form analternating
sequence and isincreasing.
Any
twoconsecutive zi
form a basis for L over Z.Fig.2. The lattice L.
’
A minimal element of the lattice L is a non-zero vector z E L with the
lattice
points
except
on its corners. In otherwords,
every w E
L withsatisfies
irewl
[
=irezi
[
andlimwl
[
=limzl.
It iseasy to see that all
the vectors zi are minimal. There is
only
one smallexception
to this: when the realpart
of z, exceedsRe zo /2
=p/2,
thenIm z2
=-Im zl,
butso Zl is not minimal in this case.
i
Fig.3. w = + pzi.
Apart
from thisexception,
the vectors+zj
areprecisely
all minimalvectors of L. We
briefly explain
thisgeneral
fact: let w E L be a minimal vector with Re w > 0.Then,
putting
-zt, one can either "see" wfrom the
origin
between and for some i= 1, 2,... , t
or one canIm zo
= 0which, by
theminimality
of w,implies
that w =zo or w = zl. In the other cases
let q
denote theintegral
part
of Thenzi+l = zi-i -
9~ and
If A > 2 then either or would be contained in the interior of the
rectangular
box with center 0 and corner w. Since w isminimal
this isimpossible
and we have thatfor some p
satisfying
(The
point zi
is contained in the box with center 0 and corner + pzj whenever 0 A q. It isusually
contained in theinterior,
in which casewe
conclude, by minimality of w,
that /z = 0 or A =q. The
exceptional
caseoccurs when zz+1
+ pzj
= za. In this and w =(zo
+z2)/2.
Since p does notdivide x,
this case does not occur for our lattice L.If p
isprincipal,
everygenerator
isevidently
minimal. Therefore one ofthe Zi
is agenerator
of p. Consider the one with maximal realpart.
SinceI
=B/P?
its trace Xi i = zi + z2 is less than2
We must show thatRe zi-,
> Since isin p =
(zi)
and since the realpart of Zi
ismaximal,
z2-i is not agenerator
of p and we have thatIZi-112
21zi
2.
Therefore
which shows that
Re z;-i
>qfi.
This
completes
theproof.
When A is even, both initial values xo and x, are even. Therefore all xi
are even and one can
simplify
Cornacchia’salgorithm
a little bitby
dividing
everything
by
2: let xo = PA/4
(mod
p)
andstop
the Euclideanalgorithm
when xiJP.
See[6, Alg.15.2].
The
running
time of both thesealgorithms
tocompute
E(Fp)
when theendomorphism
ring
isgiven,
is dominatedby
the calculation of the squareroot of A modulo p.
Using
the methodexplained
in[20]
or[6, Alg.1.5.1]
5. A
polynomial
timealgorithm.
In this section we
briefly
explain
a deterministicpolynomial
timealgo-rithm
[18]
to count the number ofpoints
on anelliptic
curve E overFp.
We suppose that E is
given
by
a Weierstra8equation y2
=X3
+ AX + B.It is easy to
compute
~E~Fp)
modulo 2: thecardinality
of the groupE(Fp)
is even if andonly
if it contains apoint
of order 2. Since thepoints
of order 2 have the form(~,0),
this meansprecisely
that thepolynomial
X3
+ AX + B has a zero inFp.
This,
inturn,
isequivalent
toThis can be tested
efhciently;
the bulk of thecomputation
is the calcu-lation of XP in thering
Fp[X] /(X
+ AX +B),
which can be doneby
repeated
squarings
andmultiplications,
using
thebinary
presentation
of theexponent
p. The amount of work involved isO (logp) .
Now we
generalize
this calculation to otherprimes
l. Wecompute
#E(Fp)
modulo the first few smallprimes 1
=3, 5, ?, ....
Since, by
Hasse’sTheorem ,
it suffices that
in order to determine the
cardinality
uniquely
by
means of the Chinese Remainder Theorem. A weak form of theprime
number theorem shows that this can be achieved with at most0(log p)
primes
each of size atmost
O(logp).
Since p islarge,
theprimes I
are very small withrespect
to p. Inparticular, 1 :A
p.As in the case where 1 =
2,
we use thesubgroup
of 1-torsionpoints
ofE(Fp):
The group
E[l]
isisomorphic
toZ/IZ
xZ/lZ.
There existpolynomials,
the socalled divisionpolynomials
that vanish
precisely
in the 1-torsionpoints.
Forexample
The division
polynomials
can be calculatedrecursively by
means of theaddition formulas
[5, 18].
Theirdegree
is(12 -
1)/2.
The amount of work involved incalculating
them is dominatedby
the rest of thecomputation,
so we don’t bother
estimating
it.The Frobenius
endomorphism
~p : E - E satisfies thequadratic
rela-tion
-where t is an
integer
satisfying
#E(Fp)
= p + 1-- t. In thealgorithm
wecheck which of the relations
holds on the group
E[l]
of
1-torsionpoints.
It iseasily
seen that the relation canonly
hold for t’ - t(mod 1)
and in this way we obtain the value of t modulo t.The
point
is that the relations can beexpressed
by
means ofpolynomials
and that
they
can be checkedefficiently:
we have thatif and
only
ifmodulo the
polynomials
andy2 - X 3 -
AX -- B. Herep’
denotes theinteger
congruent
to p(mod
1)
that satisfies 0p’
l. Note that the"+" that occurs in the formula is the addition on the
elliptic
curve andthat the
multiplications
arerepeated
additions.The bulk of the
computation
is,
first,
thecomputation
of the powersXp,
and
then, I
times,
the addition of thepoint
(XP, YP),
which boils down to afew additions and
multiplications
in the samering.
Since the elements of thering
have size12log,
the amount of work involved isO(logp(l2Iogp)2)
andrespectively.
Here we assume that the usualmultiplication
algorithms
arebeing
used,
so thatmultiplying
two elements oflength n
takes timeproportional
ton2 .
Keeping
in mind that I =0 (log p~
and that we have to do this calculation foreach 1,
we conclude that the amount of work involved in the entire calculation isSo,
this is a deterministicpolynomial
timealgorithm,
i.e. it isasymptoti-cally
very fast. Inpractice
itbehaves,
unfortunately,
ratherpoorly
because of thehuge
degrees
of the divisionpolynomials
involved. Forinstance,
thecomputations
for theexample
with p ~10200
mentioned in the introduc-tion would involveprimes 1
> 250. For such1, representing
one elementin the
ring
X3 -
AX -B)
requires
more than 1.5megabytes
of memory.In the
following
sections weexplain practical improvements
of thisalgo-rithm due to Atkin and Elkies. ,
6. The action of Frobenius on the 1-torsion
points.
As in the
previous sections, let
p be alarge
prime
and let E be anelliptic
curve over
Fp
given by
aWeierstrafi-equation.
In this section His aprime
different from p and we
study
the action of the Frobeniusendomorphism
on the groupE[l]
of 1-torsionpoints
on anelliptic
curve. As anapplication
we describe Atkin’salgorithm
[1,2]
tocompute
the order of theimage
of the Frobeniusendomorphism
in the groupPGL2 (Fd).
Weexplain
how thiscan be used to count the number of
points
on anelliptic
curve overFp.
For every
prime I
we introduce the so-called modularequations.
This asymmetric
polynomial
4li(S, T)
EZ[S,T],
which isequal
to toSIT’
i+
TI+1
plus
terms of the form with and i+ j
21.By
thefamous
Kronecker congruencerelation,
one has thatT)
==(Sl -
T) (T -
Sl)
(mod t).
Thepolynomial
has theproperty
that for any field_F’ of and for everyj-invariant j
EF,
the I + 1 zeroesj
E ~’ of thepolynomial
4li (j, T)
= 0 areprecisely
thej-invariants
of theisogenous
curvesE/C.
Here E is anelliptic
curve withj-invariant j
and Cruns
through
the t + 1cyclic subgroups
ofE[t].
See[21]
for the construction of the curvesE/C.
The
polynomial
T)
describes asingular
model for the modular curveXo (1)
inP’
x P~ over
Z. As anexample
wegive
the modularequation
for ~=3:
An
elliptic
curve .E over a finite field of characteristic p is calledsuper-singular if
it possesses nopoints
of order p, not even over analgebraic
closure
Fp.
Equivalently,
some power of the Frobeniusendomorphism
of Eis an
integer.
Since theproperty
ofbeing supersingular only depends
on thecurve E over
Fr,
itonly depends
on thej-invariant
of E. Therefore we canspeak
ofsupersingular j-invariants.
Supersingular
curves are rare. Theirj-invariants
arealways
contained inFp2
and the number ofsupersingular
j-invariants
inFp
isapproximately
See[21].
For an
elliptic
curveE,
anisogeny
E -~E/C
isusually
defined overthe field that contains the
j-invariants
of E and but this need notbe true if the
j-invariant
of E issupersingular
orequal
to 0 or 1728. Thefollowing
proposition
is sufficient for our purposes.Proposition
6.1. Let E be anelliptic
curve overFr.
Suppose
that itsj-invariant j
is notsupersingular
and 0 or 1728. Then~i~
thepolynomial
~l( j, T)
has azero j
EFpr
if andonly
if the kernel C of thecorresponding isogeny
is a 1-dimensional
eigenspace
inE[l].
Here p
denotes the Frobeniusendomorphism
of E.(ii)
Thepolynomial
4~1(j,
T)
splits completely
inFpr
[T]
if andonly
acts as a scalar matrix onProof.
(i)
If C is aneigenspace
of it is stable under the action of theGalois group
generated by
Therefore theisogeny
.E ~--~E~C
is definedover
Fpr
and thej-invariant j
ofE/C
is contained inFpr.
Conversely,
=0,
then there is acyclic
subgroup
C of such that thej-invariant
ofE~C
isequal
to j E
Fpr .
Let E’ be anelliptic
curveover
Fpr
withj-invariant
equal
toj.
LetE/C --;
E’
be anFp-isomorphism
and let
f :
E )E /C -
E’
be thecomposite
isogeny.
It has kernel C. The groupHomppr
(E, E’)
ofisogenies
E ---> E’’ that are defined overFpr
is asubgroup
of the group of allisogenies
HomFp
(E,
E’).
SinceE is not
supersingular,
Romi" p (E,
E’)
is free of rank 2. Thesubgroup
HomFpr
(E,
E’)
is either trivial orequal
toE’).
Thereforef
is defined overFpr
as soon as there exists anisogeny
E ---~E’
which isde-fined over
Fpr.
This means that C is aneigenspace
ofcpr,
as soon as curvesE and E’ are
FPT-isogenous
or,equivalently,
when their Frobeniusendo-morphisms
overF pr satisfy
the same characteristicequation
[21,
Chpt.III,
Thm.
7.7].
We will show that E’ can be chosen to be
Fpr-isogenous
to E. Since Eand E’
areisogenous
overFp,
thequotient
fields of theirendomorphism
rings
areisomorphic
to the samecomplex quadratic
field K.Let 0
and1/J’
denote the Frobenius
endomorphisms
overFpr
of E andE’
respectively.
We have
that
pr.
wehave,
up tocomplex conjugation,
the relation’lj;s = 1/;’ S
for somepositive integer
s.If ~ _ 1/;’,
the curves E andE’
areFpr-isogenous. If 0 =
then wereplace
E’by
itsquadratic
twist,
which has Frobeniusendomorphism
2013~.
Again
the curves E andE’
areFpr-isogenous.
From now on we suppose
that 0 0 -.:J:1/l.
Then1/J / ’lj;’
E K is a root ofunity
of order at least 3 and either K =Q(i)
or K =Q(()
and 0’
=:I:(1f;
or::i:(-11/J.
Here C
denotes aprimitive
cube root ofunity.
Theendomorphism rings
of Eand E’
are orders of conductorf
andf ’
respectively
in K. We have thefollowing:
-
f
andf’
arecoprime.
Weonly give
the easyproof
for K =Q(i);
the other case is similar. .Let 0
= a + bi for some a, b EZ,
and
f
divides b whilef ’
divides a. Since a and b arecoprime integers,
so are
f
andf’.
- The
quotient
f / f’
isequal
to1, 1
or1/1.
To seethis,
letRc
CEnd(E)
be the
subring
definedby
The index of this
ring
in divides I and the natural mapRC
-End(E’)
given by g
~ g is a well definedinjective ring homomorphism.
the dual
isogeny
off ,
we find in a similar way thatf
dividesl f’.
Iff
would not divide
f’
andf’
would not dividef ,
thenordz(J)
=ordl( f’)+1
andord, (f ’)
= + 1 which is absurd. Therefore eitherf
dividesf’
or
f’
dividesf
and we conclude that eitherf’/ f
divides I orf / f’
di-vides l.It follows
easily
that eitherf
orf’
isequal
to 1.Since j 0
0 or1728,
the conductor
f
cannot be 1. Thereforef’
= 1 and thej-invariant j
ofE’
is 1728 or 0respectively.
In the first case K =Q(i)
and,
since E isnot
supersingular,
p - 1(mod 4)
and there are, up toisomorphisms,
fourcurves over
Fp
with j
= 1728. Their Frobeniusendomorphisms
aregiven
by
~~, =l:.i1/J.
Therefore one of these curves isFpr-isogenous
to E and wereplace
E’
by
thisFp-isomorphic
curve. In the secondcase j = 0
andp - 1
(mod
3);
there are six curvesFp
with3*-’invariants equal
to0,
one ofwhich is
isogenous
to E. Wereplace
E’by
this curve. In both cases weconclude that the
isogeny
f
and its kernel C are defined overFpr,
Thisproves
(i).
(ii)
If allzeroes j
of are contained inFpr,
thenby (i),
all 1-dimensionalsubspaces
ofE(l]
areeigenspaces
of Thisimplies
thatcpr
is a scalar matrix.This proves the
proposition.
’
The conditions of the
proposition
are necessary. Forinstance,
let E bethe
elliptic
curve overF7
given by
theequation
y2
=X3 -
1. Ithas
j-invariant 0. Let 1 = 3. The 3-division
polynomial
isequal
toW3(X) =
X (X 3 -
4)
and the modularequation
with S= j
= 0 becomes~3 ( j, T )
=T(T -
3)3
(mod
7).
The zero X = 0 of~Y3(X)
gives
rise to thesubgroup
C ={oo,
(0, ~i)}
where i EF49
satisfiesi2
= -1. The group C is thekernel of the
endomorphism
1 - 6 where 6 isgiven by
6(z, y) = (2x, y).
ThereforeE/C 9!
E andE/C
hasj-invariant equal to j
= 0. Thisexplains
thezero j
= 0 of~3(j,T).
The other(triple)
zero j
= 3 is thej-invariant
ofE/C
where C is any of the other threesubgroups
of order 3. The sixnon-trivial
points
in these groups aregiven by
(±2z, ~4).
Since the Frobeniusendomorphism cp
actstransitively
on these sixpoints,
we conclude thatthe
only
eigenspace
of cp
is the kernel of 1 - 6. There are noeigenspaces
corresponding
to the thezero j
= 3 of~3 ( j, T ).
For
supersingular
curves EProp.6.1
is,
ingeneral,
also false. Forin-stance,
let p = 13 and consider the curve Egiven by
y2
=X3 -
3X - 6over
F13.
Thej-invariant
of E isequal
to 5 and E has 14points
overFig.
Therefore the trace of the Frobeniusendomorphism p
is zero and cpsu-persingular.
Allsupersingular
curves overF13
havej-invariant equal
to 5.Therefore,
for everyprime 1,
the modularequation
4li(j, T)
iscongruent
to
(T -
5)i~’~
(mod 13).
All its zeroes are inF13,
but when I is aprime
modulo which -13 is not a square, the characteristic
equation
cp2 +
13 = 0 of the Frobeniusendomorphism
p is irreducible modulo l.Therefore p
hasno 1-dimensional
eigenspaces
inE[l].
In
general, if j
is asupersingular
j-invariant,
all irreducible factors ofthe
polynomial
EF p [T ~
havedegree
1 or 2. Thefollowing
twopropositions
are in[2].
Proposition
6.2. Let E be anon-supersingular
eltiptic
curve overFp
withj-invariant j ~
0 or 1728. Let~~( j, T)
=fi f2 ...
f s
be the factorization of~~( j, T~
EFp[T]
as aproduct
of irreduciblepolynomials.
Then there arethe
following
possibilities
for thedegrees
f s:
tj)
1
and d;
in other factors as a
product
of a linear factor and anirreducible factor of
degree
I. In this case 1 divides the discriminantt2 - 4p.
Weput
r = I in this case.,
(ii)
l,l,r,r,...
,r;in this
case t2 -
4p
is a squaremodulo t,
thedegree
r divides 1 -1 andp acts
onE[l]
as a matrix(g§)
withÀ, P,
EFi .
0,0(ill)
r, r, r, ... , r for some r >
1;
in this case
t2 -
4p
is not a square modulol,
thedegree
r divides 1 + 1 and cp acts onE[t]
as a 2 x 2-matrix that has a characteristicpolynomial
which is irreducible modulo t.
In all cases, r is the order of cp in the group
PGL2(F,)
and the trace t of cpsatisfies
~~
=((
+~-~ ~~p
(mod
l ~
for someprimitive
r-th root ofunity C
EFl.
Proof. This follows from theprevious
proposition.
The Frobeniusendo-morphism W
acts on via a 2 x 2-matrix with characteristicequation
cp2 - tcp
+ p
= 0. If the matrix has a doubleeigenvalue
and is notdiagonal-izable,
then there isonly
one 1-dimensionaleigenspace of p
and the matrixIf the matrix has two
eigenvalues
inFi
I and isdiagonalizable,
then thediscriminant t2 --
4p
is a square modulo I andE[l]
is the directproduct
of two 1-dimensionalp-eigenspaces.
This accounts for the two factors ofdegree
1 of~I ( j, T~ .
Theremaining
factors havedegree r,
where r is the smallestpositive integer
such thatcpr
is a scalar matrix. This is case(ii).
If the matrix has two
conjugate
eigenvalues
À,1t
EF12 - F1,
then thereare no 1-dimensional
eigenspaces
and all irreducible factors of4), (j, T)
havedegree
r where r is the smallestexponent
such that ar EFi .
It is easy to see that this is also the smallestexponent
such thatcpr
is scalar. Thiscovers case
(iii)
To prove the last
statement,
we note that the matrixcpr
acts onE[l]
asa scalar matrix. This
implies
that theeigenvalues
A and p of psatisfy
ar = SinceAtt
= p, we have~2r - pr
and hencea~
=(p
for someprimitive
r-th root ofunity .
Thisimplies
that t2
=(a+p/~)2 -
(~+~’-1)ap
(mod 1)
as
required.
Here one shouldtake C
=1 in case(i)
where r = t.The
following
proposition
puts
a further restriction on thepossible
valueof r.
Proposition
6.3.Suppose
E is anon-supersingular
curve overFr
withj-invaria~nt j ~
0 or 1728. Let I be an oddprime
and let s denote the number of irreducible factors in the factorization of4), (j,
T)
EFp [T].
ThenProof. If 1
divides t~ -
4p
and ~p has order I we are in case(i)
ofProp.6.2
and the result is true.
Suppose
thereforethat t2 -
4p
0i.e.,
that we are in case(ii)
or(iii)
and let T CPGL2 (FI)
be a maximal toruscontaining
o. In otherwords,
we take T= (o ° :
Esplit
inop I
case
(ii)
and we take Tnon-split,
i.e.,
isomorphic
to in case(ill).
Let12
T denote the
image
of T inPGL2(FI).
The group T iscyclic
of order 1 - 1 in case(ii)
and of order 1 + 1 incase (ui).
The determinant induces anisomorphism
det :T/T2
---~ F* / (F* ~ ~ .
Since the characteristicequation
of p
is + p =0,
the actionof p
is viadet(cp)
=p and we obtain an
isomorphism
This shows that the index
[T : cpJ
is odd if andonly
if p is not a squaremod l. Since the number s of irreducible factors
T)
overFp
isequal
Propositions
6.2 and 6.3 can beemployed
to obtain information about the trace t. The restriction toelliptic
curves that are notsupersingular
and 0 or 1728 is not very serious. For curves withj-invariant equal
to0 or
1728,
thealgorithm
of section 4 is much moreefhcient,
whilesupersin-gular
curvesalways
have t = 0 and hence p + 1points
overFp.
The chance that a "random"elliptic
curve like in theintroduction,
issupersingular,
is verysmall;
theprobability
is boundedby
O(p-l/2).
Inpractice
this caseis
recognized
easily
because for eachprime 1,
thepolynomial
(11 (j, T)
hasonly
irreducible factors ofdegree
1 and 2.Rather than
doing
thecomputations
modulo the divisionpolynomial
Wi (X )
ofdegree
~t2-1)/2
that were introduced in section5,
Atkin doescom-putations
modulo thepolynomial
T)
ofdegree
l+1.
This is much moreefhcient,
but one obtains less information: instead ofcomputing
t(mod 1),
Atkin
only
obtains certain restrictions on the value of t(mod 1).
Atkin’s
algorithm.
Let E be anelliptic
curve overFp
given by
aWeierstrafl-equation. Let j
EFp
denote itsj-invariant.
Let I be aprime
number.
Atkin first determines how many zeroes the
polynomial
«p,(j, T)
has inFp.
This is doneby computing
,Then one can see which case of
Prop.6.2
applies
to theprime
l. The bulkof the calculation is the
computation
of TP in thering
since the
degree
is I +1,
the amount of work isproportional
toTo
compute
the exact order r of the Frobeniusendomorphism in
PGL2(Fl),
Atkin
computes
in additionfor i =
2, 3, ....
For i = r one finds that thegcd
isequal
toT)
and this is the smallest index i with thisproperty.
One knowsby Prop.6.2
thatr divides 1 + 1 and
by Prop.6.3
one knows theparity
of(1
±1)/r.
This information can be used tospeed
up thecomputations.
By
the last statement ofProp.6.2,
theknowledge
of rseverely
restrictsthe