Schoof's algorithm

This is an old revision of this page, as edited by Giftlite (talk | contribs) at 18:47, 5 February 2009 (Introduction: -sp). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Schoof's Algorithm is an important tool of Elliptic Curve Cryptography that provides us with an efficient way of counting points on elliptic curves. Published as a paper by René Schoof in 1985, the algorithm was a theoretical break through, as it was the first deterministic polynomial time algorithm.

Before Schoof's algorithm, approaches to counting points on elliptic curves such as the Naive and Baby-step giant-step algorithms were, for the most part, tedious and had an exponential running time.

This article explains Schoof's approach, laying emphasis on the mathematical ideas underlying the structure of the algorithm.

Introduction

In order to count points on elliptic curve, we compute the cardinality of  , the group of an elliptic curve   over a finite field   of characteristic  . Schoof's approach to compute the cardinality   makes use of Hasse's theorem along with the Chinese Remainder Theorem and Division Polynomials.

We treat an elliptic curve   as the zero locus of an algebraic equation of a special form, commonly known as the Weierstrass form. Over a field of characteristic  , this equation can be written as

 

The set of points defined over   satisfying this equation, together with an additional `point at infinity'  , form the abelian group  , with   acting as the zero element.

Hasse's Theorem

Hasse's theorem states that if   is an elliptic curve over the finite field  , then   satisfies

 

This powerful result, given by Hasse in 1934, simplifies our problem by narrowing down   to a finite (albeit large) set of possibilities. Defining   to be  , and making use of this result, we now have that computing the cardinality of   modulo   where  , is sufficient for determining  , and thus  . While there is no efficient way to compute   directly for general  , it is possible to compute   for   prime, rather efficiently. We choose   to be a set of distinct primes such that  . Given   for all  , the Chinese Remainder Theorem allows us to compute  .

In order to compute   for a prime  , we make use of the theory of the Frobenius endomorphism   and Division Polynomials. Note that considering primes   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   since there are more efficient algorithms for small characteristic fields.

The Frobenius Endomorphism

Given the elliptic curve   we consider   to be the curve with same defining equation as  , but now allowing points with coordinates in  , the algebraic closure of  . Given curve  , there exists a map (the Frobenius endomorphism) given by  

This map is the identity on   and one can extend it to the point at infinity  , making it a group morphism from   to itself.

The Frobenius endomorphism satisfies a quadratic polynomial which is linked to the cardinality of   by the following theorem:

Theorem: The Frobenius endomorphism given by   satisfies the characteristic equation

  where  

Thus we have for all  ,  , where + denotes addition on the elliptic curve and   and   denote scalar multiplication of   by   and of   by  .

Fixing  , we now move on to solving the problem of determining  , defined as  , for a given prime  . If a point   is in the torsion subgroup  , then   where   is the unique integer such that   and  . Being a group morphism, we have that   and if   is an integer, then  . Thus   will have the same order as  . Thus for   belonging to  , we also have   if  . Hence we have reduced our problem to solving the equation

 

Computation modulo primes

We must now compute   as a pair of rational functions   in terms of   and   (remember that we are working modulo  ). We do so by using Division Polynomials, which lie at the heart of the remaining part of Schoof's algorithm.

We obtain:

 

where  , a function of   and  , is the  th division polynomial. By replacing   by  , we have that   is an expression in  .

We must split the problem into two cases: the case in which  , and the case in which  .


Case 1:  

By using the addition formula for the group   we obtain:

 

We are now able to use the  -coordinate to narrow down the choice of   to two possibilities, namely the positive and negative case. Using the  -coordinate one later determines which of the two cases holds.

We first show that   is a function in   alone. Consider  . Since   is even, by replacing   by  , we rewrite the expression as  

Note that such a substitution would mean that we are working in the quotient ring  .

Now if   for one point   in   then   satisfies   implying that   for all points   in   and confirming that  .

But since the roots of the  -th Division Polynomial   are exactly the  -coordinates of the points of   and are simple, we can reduce our problem to solving the equation

  (where   is the  -th division polynomial)

That is, we are now working in the ring  .

As mentioned earlier, using the   and   we are now able to determine which of the two values of   (  or  ) works. This computation fails in case the assumption of inequality was wrong.

Case 2:  

We begin with the assumption that  . For a point   in   satisfying this, plugging it into the characteristic equation yields that  . And consequently that  . This implies that   is a square modulo   unless   is  . We discount the latter case as it yields a contradiction. We find  's square-roots over  . If  , we find that   will be   mod   depending on the y-coordinate. If   turns out not to be a square modulo  , our assumption that   is rendered false, forcing us to consider the case where  , in which case our argument asserts that   is  .

As you might notice, it is possible for   to be a square   but  . In this case however, it suffices to check whether or not either square root   satisfies  , for  , and this amounts to checking whether or not  . If it is   then we are in the minus case and  ; if   we proceed as in the plus case with  .


Additional Case:  

If you recall, our initial considerations omit the case of  . Since we assume   to be odd,   and in particular,   if and only if   has an element of order 2. By definition of addition in the group, any element of order 2 must be of the form  . Thus   if and only if the polynomial   has a root in  , if and only if  .


The Algorithm

(1) Choose a set of primes  ,   such that    
(2) For  ,   if and only if    
(3) For    do  
         (a) let   be the unique integer such that    and  
         (b) compute   as above.   
         (c) for    do  
                   (i)  if    go to ii. . Otherwise try next value of  . If you have unsuccesfully tried  , go to (d).  
                   (ii) if    then  ; otherwise    
         (d) Find  's square roots modulo  ,if they exist. If they don't exist then  . Otherwise let    
         (e) If    . Otherwise    
(4) Use Chinese Remainder Theorem to compute  .

Note that since the set   was chosen so that  , by Hasse's theorem, we in fact know   precisely.


Complexity of Schoof's Algorithm

Most of the computation is taken by the evaluation of   and  , for each prime  , that is computing  ,  ,  ,   for each prime  . This involves exponentiation in the ring   and requires   multiplications. Since the degree of   is  , each element in the ring is a polynomial of degree  , and we obtain that  . Thus each multiplication in the ring   requires   multiplications in   which in turn requires   bit operations. In total, the number of bit operations for each prime   is  . By the prime number theorem, we have around   primes, and thus the total complexity of Schoof's algorithm turns out to be  .

Improvements to Schoof's Algorithm

In the 1990s, Elkies, followed by Atkin devised improvements to Schoof's basic algorithm by restricting the set of primes   considered before to primes of a certain kind. These came to be called Elkies primes and Atkin primes respectively. A prime   is called an Elkies prime if the characteristic equation:   splits over  , 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 Schoof-Elkies-Atkin algorithm. The first problem to address is to determine whether a given prime is Elkies or Atkin. In order to do so, we make use of modular polynomials, which come from the study of modular forms and an interpretation of elliptic curves over the complex numbers as lattices. Once we have determined which case we are in, instead of using Division Polynomials, we proceed by working modulo the modular polynomials   which have a lower degree than the corresponding division polynomial   (degree   rather than  ). This results in a further reduction in the running time, giving us an algorithm more efficient than Schoof's, with complexity  .


Implementations

Several algorithms were implemented in C++ by Mike Scott and are available with source code. The implementations are free (no terms, no conditions), but they use MIRACL library which is only free for non-commercial use. Note that (unmodified) programs may be used to generate curves for commercial use. There are

  • Schoof's algorithm implementation for   with prime  .
  • Schoof's algorithm implementation for  .


See Also

References

  • R. Schoof: Elliptic Curves over Finite Fields and the Computation of Square Roots mod p. Math. Comp., 44(170):483-494, 1985. Avaliable at http://www.mat.uniroma2.it/~schoof/ctpts.pdf
  • R. Schoof: Counting Points on Elliptic Curves over Finite Fields. J. Theor. Nombres Bordeaux 7:219-254, 1995. Avaliable at http://www.mat.uniroma2.it/~schoof/ctg.pdf
  • G. Musiker: Schoof's Algorithm for Counting Points on  . Avaliable at http://www-math.mit.edu/~musiker/schoof.pdf
  • A. Brown: Algorithms for Elliptic Curves over Finite Fields, EPFL - LMA. Avaliable at http://algo.epfl.ch/handouts/en/andrew.pdf
  • V. Müller : Die Berechnung der Punktanzahl von elliptischen kurven über endlichen Primkörpern. Master's Thesis. Universität des Saarlandes, Saarbrücken, 1991. Avaliable 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.
  • L. C. Washington: Elliptic Curves: Number Theory and Cryptography. Chapman & Hall/CRC, New York, 2003.
  • N. Koblitz: A Course in Number Theory and Cryptography, Graduate Texts in Math. No. 114, Springer-Verlag, 1987. Second edition, 1994