Content deleted Content added
Link should be Hasse's theorem on elliptic curves |
m revision for accuracy and clarity →Case 1: (x^{q^{2}}, y^{q^{2}}) \neq \pm \bar{q}(x, y) |
||
(76 intermediate revisions by 50 users not shown) | |||
Line 1:
{{Short description|Efficient algorithm to count points on elliptic curves}}
'''Schoof's The algorithm was published by [[René Schoof]] in 1985 and it was a theoretical
This article explains Schoof's approach, laying emphasis on the mathematical ideas underlying the structure of the algorithm.
Line 7 ⟶ 8:
==Introduction==
Let <math>E</math> be an [[elliptic curve]] defined over the finite field <math>\mathbb{F}_{q}</math>, where <math>q=p^n</math> for <math>p</math> a prime and <math>n</math> an integer <math>\geq 1</math>. Over a field of characteristic <math>\neq 2, 3</math> an elliptic curve can be given by a (short) Weierstrass equation
: <math>
y^
</math>
with <math>A,B\in \mathbb{F}_{q}</math>. The set of points defined over <math>\mathbb{F}_{q}</math> consists of the solutions <math>(a,b)\in\mathbb{F}_{q}^2</math> satisfying the curve equation and a [[point at infinity]] <math>O</math>. Using the [[
In order to count points on an elliptic curve, we compute the cardinality of <math>E(\mathbb{F}_{q})</math>.
Schoof's approach to computing the cardinality <math>\
==Hasse's
{{main|Hasse's theorem on elliptic curves}}
Hasse's theorem states that if <math>E/\mathbb{F}_{q}</math> is an elliptic curve over the finite field <math>\mathbb{F}_{q}</math>, then <math>\
: <math>
\mid q + 1 - \
</math>
This powerful result, given by Hasse in 1934, simplifies our problem by narrowing down <math>\
In order to compute <math>t \pmod l</math> for a prime <math>l \neq p</math>, we make use of the theory of the Frobenius endomorphism <math>\phi</math> and [[division polynomials]]. Note that considering primes <math>l \neq p</math> is no loss since we can always pick a bigger prime to take its place to ensure the product is big enough. In any case Schoof's algorithm is most frequently used in addressing the case <math>q=p</math> since there are more efficient, so called <math>p</math> adic algorithms for small
==The Frobenius
Given the elliptic curve <math>E</math> defined over <math>\mathbb{F}_{q}</math> we consider points on <math>E</math> over <math>\
This map is the identity on <math>E(\mathbb{F}_{q})</math> and one can extend it to the point at infinity <math>O</math>, making it a [[group morphism]] from <math>E(\bar{\mathbb{F}}_{q
The Frobenius endomorphism satisfies a quadratic polynomial which is linked to the cardinality of <math>E(\mathbb{F}_{q})</math> by the following theorem:
'''Theorem:''' The Frobenius endomorphism given by <math>\phi</math> satisfies the characteristic equation
: <math> \phi ^
Thus we have for all <math>P=(x, y) \in E</math> that <math>(x^{q^{2}}, y^{q^{2}} ) + q(x, y) = t(x^{q}, y^{q})</math>, where + denotes addition on the elliptic curve and <math>q(x,y)</math> and <math>t(x^{q},y^{q})</math>
denote scalar multiplication of <math>(x,y)</math> by <math>q</math> and of <math>(x^{q},y^{q})</math> by <math>t</math>.
One could try to symbolically compute these points <math>(x^{q^{2}}, y^{q^{2}})</math>, <math>(x^{q}, y^{q})</math> and <math>q(x, y)</math> as functions in the [[
and
Schoof's idea was to carry out this computation restricted to points of order <math>l</math> for various small primes <math>l</math>.
Fixing an odd prime <math>l</math>, we now move on to solving the problem of determining <math>t_{l}</math>, defined as <math>t \pmod l</math>, for a given prime <math>l \neq 2, p</math>.
If a point <math>(x, y)</math> is in the <math>l</math>-[[torsion subgroup]] <math>E[l]=\{P\in E(\bar{\mathbb{F}_{q}}) \mid lP=O \}</math>, then <math>qP = \bar{q}P</math> where <math>\bar{q}</math> is the unique integer such that <math>q \equiv \bar{q} \pmod l</math> and <math>\mid \bar{q} \mid< l/2</math>.
Note that <math>\phi(O) = O</math> and that for any integer <math>r</math> we have <math>r\phi (P) = \phi (rP)</math>. Thus <math>\phi (P)</math> will have the same order as <math>P</math>. Thus for <math>(x, y)</math> belonging to <math>E[l]</math>, we also have <math>t(x^{q}, y^{q})= \bar{t}(x^{q}, y^{q})</math> if <math>t \equiv \bar{t} \pmod l</math>. Hence we have reduced our problem to solving the equation
: <math> (x^{q^{2}}, y^{q^{2}}) + \bar{q}(x, y) \equiv \bar{t}(x^{q}, y^{q}),</math>▼
▲<math> (x^{q^{2}}, y^{q^{2}}) + \bar{q}(x, y) \equiv \bar{t}(x^{q}, y^{q}),</math>
where <math>\bar{t}</math> and <math>\bar{q}</math> have integer values in <math>[-(l-1)/2,(l-1)/2]</math>.
==Computation modulo primes==
The
in
The scalar multiplication <math>\bar{q}(x, y)</math> can be done either by [[exponentiation by squaring|double-and-add]] methods or by using the <math>\bar{q}</math>th division polynomial. The latter approach gives:
: <math>
\bar{q} (x,y) = (x_{\bar{q}},y_{\bar{q}}) = \left( x - \frac {\psi_{\bar{q}-1} \psi_{\bar{q}+1}}{\psi^{2}_{\bar{q}}}, \frac{\psi_{2\bar{q}}}{2\psi^{4}_{\bar{q}}} \right)
</math>
where <math>\psi_{n}</math> is the
<math>y_{\bar{q}}/y</math> is a function in
We must split the problem into two cases: the case in which <math>(x^{q^{2}}, y^{q^{2}}) \neq \pm \bar{q}(x, y)</math>, and the case in which <math>(x^{q^{2}}, y^{q^{2}}) = \pm \bar{q}(x, y)</math>. Note that these equalities are checked modulo <math>\psi_l</math>.
===Case 1: <math>(x^{q^{2}}, y^{q^{2}}) \neq \pm \bar{q}(x, y)</math>===
By using the [[
: <math>
X(x,y) = \left( \frac{y^{q^{2}} - y_{\bar{q}}}{x^{q^{2}} - x_{\bar{q}}} \right) ^{2} - x^{q^{2}} - x_{\bar{q}}.
</math>
Note that this computation fails in case the assumption of inequality was wrong.
We are now able to use the
We first show that
Since <math>q^{2}-1</math> is even, by replacing <math>y^{2}</math> by <math>x^3+Ax+B</math>, we rewrite the expression as
: <math>
(x^3+Ax+B)((x^3+Ax+B)^{\frac{q^{2}-1}{2}}-\theta(x))^2
</math>
and have that
: <math>
X(x)\equiv (x^3+Ax+B)\left(\frac{(x^3+Ax+B)^{\frac{q^{2}-1}{2}}-\theta(x)}{x^{q^2}-x_{\bar{q}}}\right)^2\bmod \psi_l(x).
</math>
Now if <math>X \equiv x^{q} _ {\bar{t}}\bmod \psi_l(x)</math> for
: <math>
\phi ^{2}(P) \mp \bar{t} \phi(P) + \bar{q}P = O
</math>
for all <math>l</math>-torsion points <math>P</math>. ▼
As mentioned earlier, using <math>Y</math> and <math>y_{\bar{t}}^{q}</math> we are now able to determine which of the two values of <math>\bar{t}</math> (<math>\bar{t}</math> or <math>-\bar{t}</math>) works. This gives the value of <math>t\equiv \bar{t}\pmod l</math>. Schoof's algorithm stores the values of <math>\bar{t}\pmod l</math> in a variable <math>t_l</math> for each prime <math>l</math> considered.▼
▲As mentioned earlier, using
===Case 2:
We begin with the assumption that <math>(x^{q^{2}}, y^{q^{2}}) = \bar{q}(x, y)</math>. Since
This implies that
\bar{q}(x, y)=w\phi(x,y)</math>. If so, <math>t_{l}</math> is <math>\pm 2w \pmod l</math> depending on the y-coordinate.
If
===Additional
If you recall, our initial considerations omit the case of <math>l = 2</math>.
Since we assume
==The
Input:
:(1) Choose a set of odd primes <math>S</math>, <math>p \notin S</math> such that <math>N=\prod_{l\in S} l > 2\sqrt{q}.</math> ▼
Output:
::(a) Let <math>\bar{q}</math> be the unique integer such that <math>q \equiv \bar{q} \pmod l</math> and <math>\mid \bar{q} \mid< l/2</math>. Compute <math>\psi_l</math>. All following computations in this loop are in the following ring: <math>\mathbb{F}_{q}[x,y]/(y^{2}-x^{3}-Ax-B, \psi_{l}).</math>▼
The number of points of {{mvar|E}} over <math>F_q</math>.
▲
{{nowrap|'''Put''' <math>t_2=0</math> '''if''' <math>\gcd(x^{q}-x, x^{3} + Ax + B)\neq 1</math>, '''else''' <math>t_2=1</math>.}}
:::(i) compute <math>(X,Y) </math>.▼
{{nowrap|Compute the division polynomial <math>\psi_l</math>}}.
:::(ii)for <math>1\leq \bar{t} \leq (l-1)/2</math> do ▼
All computations in the loop below are performed {{nowrap|in the ring <math>\mathbb{F}_{q}[x,y]/(y^{2}-x^{3}-Ax-B, \psi_{l}).</math>}}
::::(iii)if <math>X = x^{q} _ {\bar{t}}</math> then▼
▲
::(d)else if <math>q</math> is a square modulo <math>l</math> then▼
{{nowrap|Compute <math>(X,Y)</math>.}}
:::(iii)if <math>w(x^{q}, y^{q})=(x^{q^{2}}, y^{q^{2}})</math> then <math>t_l=2w</math>▼
:::(iv)else if <math>w(x^{q}, y^{q})=(x^{q^{2}}, -y^{q^{2}})</math> then <math>t_l=-2w</math>▼
{{nowrap|'''if''' <math>Y = y^{q} _ {\bar{t}}</math> '''then'''}}
{{nowrap|<math>t_{l}=\bar{t}</math>;}}
:(4)Use the Chinese Remainder Theorem to compute <math>\sharp E(\mathbb{F}_{q}) \pmod{2N}</math>.▼
'''else'''
{{nowrap|<math>t_{l}=-\bar{t}</math>.}}
{{nowrap|compute {{mvar|w}} with <math>q\equiv w^{2} \pmod l</math>}}
{{nowrap|compute <math>w(x^{q}, y^{q})</math>}}
▲
{{nowrap|<math>t_l=2w</math>}}
▲
{{nowrap|<math>t_l=-2w</math>}}
'''else'''
{{nowrap|<math>t_{l}=0</math>}}
'''else'''
{{nowrap|<math>t_{l}=0</math>}}
▲
from the equations <math>t \equiv t_{l} \pmod l</math>, where <math>l \in S</math>.
==Complexity==
Most of the computation is taken by the evaluation of <math>\phi(P)</math> and <math>\phi^{2}(P)</math>, for each prime <math>l</math>, that is computing <math>x^q</math>, <math>y^q</math>, <math>x^{q^2}</math>, <math>y^{q^2}</math> for each prime <math>l</math>. This involves exponentiation in the ring <math>R = \mathbb{F}_{q}[x, y]/ (y^2-x^3-Ax-B, \psi_l)</math> and requires <math>O(\log q)</math> multiplications. Since the degree of <math>\psi_l</math> is <math>\frac{l^2-1}{2}</math>, each element in the ring is a polynomial of degree <math>O(l^2)</math>. By the [[prime number theorem]],
==
▲Most of the computation is taken by the evaluation of <math>\phi(P)</math> and <math>\phi^{2}(P)</math>, for each prime <math>l</math>, that is computing <math>x^q</math>, <math>y^q</math>, <math>x^{q^2}</math>, <math>y^{q^2}</math> for each prime <math>l</math>. This involves exponentiation in the ring <math>R = \mathbb{F}_{q}[x, y]/ (y^2-x^3-Ax-B, \psi_l)</math> and requires <math>O(\log q)</math> multiplications. Since the degree of <math>\psi_l</math> is <math>\frac{l^2-1}{2}</math>, each element in the ring is a polynomial of degree <math>O(l^2)</math>. By the [[prime number theorem]], we have around <math>O(\log q)</math> primes of size <math>O(\log q)</math> giving that <math>l</math> is <math>O(\log q)</math> and we obtain that <math>O(l^2) = O(\log^2q)</math>. Thus each multiplication in the ring <math>R</math> requires <math>O(\log^4 q)</math> multiplications in <math>\mathbb{F}_{q}</math> which in turn requires <math>O(\log^2 q)</math> bit operations. In total, the number of bit operations for each prime <math>l</math> is <math>O(\log^7 q)</math>. Given that this computation needs to be carried out for each of the <math>O(\log q)</math> primes, the total complexity of Schoof's algorithm turns out to be <math>O(\log^8 q)</math>. Note that fast polynomial arithmetic reduces the costs down to <math>O(\log^5 q)</math>.
{{main|Schoof–Elkies–Atkin algorithm}}
In the 1990s, [[Noam Elkies]], followed by [[A. O. L. Atkin]], devised improvements to Schoof's basic algorithm by restricting the set of primes <math>S = \{l_1, \ldots, l_s\}</math> considered before to primes of a certain kind. These came to be called Elkies primes and Atkin primes respectively. A prime <math>l</math> is called an Elkies prime if the characteristic equation: <math>\phi^2-t\phi+ q = 0</math> splits over <math>\mathbb{F}_l</math>, while an Atkin prime is a prime that is not an Elkies prime. Atkin showed how to combine information obtained from the Atkin primes with the information obtained from Elkies primes to produce an efficient algorithm, which came to be known as the [[
Under the heuristic assumption that approximately half of the primes up to an <math>O(\log q)</math> bound are Elkies primes, this yields an algorithm that is more efficient than Schoof's, with an expected running time of <math>O(\log^6 q)</math> using naive arithmetic, and <math>\tilde{O}(\log^4 q)</math> using fast arithmetic. Although this heuristic assumption is known to hold for most elliptic curves, it is not known to hold in every case, even under the [[Generalized Riemann Hypothesis|GRH]].
==Implementations==
Several algorithms were implemented in [[C++]] by Mike Scott
* Schoof's algorithm [
* Schoof's algorithm [
==See also==
* [[Elliptic
* [[Counting points on elliptic curves]]
* [[Division Polynomials]]
Line 146 ⟶ 170:
==References==
* R. Schoof: Elliptic Curves over Finite Fields and the Computation of Square Roots mod p. Math. Comp., 44(170):
* R. Schoof: Counting Points on Elliptic Curves over Finite Fields. J. Theor. Nombres Bordeaux 7:
* G. Musiker: Schoof's Algorithm for Counting Points on <math>E(\mathbb{F}_{q})</math>. Available at http://www
* V. Müller : Die Berechnung der Punktanzahl von elliptischen kurven über endlichen Primkörpern. Master's Thesis. Universität des Saarlandes, Saarbrücken, 1991. Available at http://lecturer.ukdw.ac.id/vmueller/publications.php
* A. Enge: Elliptic Curves and their Applications to Cryptography: An Introduction. Kluwer Academic Publishers, Dordrecht, 1999.
Line 155 ⟶ 178:
* N. Koblitz: A Course in Number Theory and Cryptography, Graduate Texts in Math. No. 114, Springer-Verlag, 1987. Second edition, 1994
{{Number-theoretic algorithms}}
[[Category:Asymmetric-key cryptosystems]]▼
{{Algebraic curves navbox}}
[[Category:Group theory]]▼
[[Category:Elliptic curve cryptography]]
[[Category:Elliptic curves]]
▲[[Category:Group theory]]
[[Category:Finite fields]]
[[Category:Number theory]]
|