Abstract
Here, we elaborate an approach for determining the number of points on elliptic curves from the family , where p is a prime number >3. The essence of this approach consists in combining the well-known Hasse bound with an explicit formula for the quantities of interest-reduced modulo p. It allows to advance an efficient technique to compute the six cardinalities associated with the family , for , whose complexity is , thus improving the best-known algorithmic solution with almost an order of magnitude.
1. Introduction
The elliptic curves over finite fields play an important role in modern cryptography. We refer to [] for an introduction concerning their cryptographic significance (see, as well, the pioneering works of V. Miller and N. Koblitz from 1980’s [,]). Briefly speaking, the advantage of the so-called elliptic curve cryptography (ECC) over the non-ECC is that it requires smaller keys to provide the same level of security.
It is well-known that to avoid successful relevant attacks against an ECC system, the number of points on the involved curve (called order of the curve) must have at least one very large prime factor. In particular, if the order itself is a (large) prime, then the entire capabilities of the curve are exploited to achieve maximum security.
An efficient deterministic algorithm (of a complexity of, at most, constant times bit-operations where q is the order of an employed finite field) which computes the order of a given elliptic curve of a general type is present in []. In this paper, however, we are interested in the whole family of curves of cardinality . Thus, it seems that there is no deterministic way to apply the Schoof algorithm for finding the orders of all curves in when p is large, although it is still feasible, taking into account the existence of only six equiprobable possibilities (see Corollary 1) and the so-called coupon collector’s problem from the probability theory (see, e.g., []). Of course, a similar claim is valid in respect to the probabilistic improvement of the Schoof algorithm, that is, the SEA algorithm [] with expected running time, heuristically, .
Nevertheless, there are more efficient approaches to the problem of interest, like the algorithmic solution presented in [] that takes bit operations. Moreover, an even better approach (to which this article is devoted) does exist.
There are two main differences between the approach followed in [] and our own:
- Munuera and Tena proposed to use a general-purpose probabilistic algorithm [] for finding out the square root of arbitrary quadratic residue modulo p in order to find , where . Their algorithm is of complexity , whereas our proposal for this task improves to complexity due to an efficient targeted method for computing that specific value;
- The authors of [] find solutions of the Diophantine equation , while we solve for . However, both tasks are carried out by appropriate utilizations of the Euclidean algorithm involving p and mod p; thus, both take bit operations (see, e.g., [] or []).
Hence, our proposal outperforms that in [] with almost an order of magnitude, although it is of probabilistic type, too.
For an analytic solution of the problem considered here, we refer to [], where explicit formulae are obtained for the order of a curve in terms of a proper representation of the prime p in the form for some integers X and Y. Those formulas, however, distinguish between many separate cases, and the computational efficiency is certainly beyond the author’s goals (see, for details, [] Theorem 1). One also may find some particular instances of this problem as exercises in [] Ch. 8, Ex. 15, 27.
Finally, it is worth pointing out that the results obtained by the approach followed in this article are comprehensive and compact, despite the fact that some long-established facts from the theory of quadratic partitions of primes are used. Additionally, that approach has been described in [], but its efficiency is demonstrated only in the case , while in the present paper, the idea is further refined and elaborated in full generality.
The paper is organized as follows. In the next section, we give some preliminaries. Section 3 exposes our approach to the problem including the amended computational estimates for large p. Section 4 provides an example with a specially constructed prime modulo, and also discusses the results of an program experiment to compare the performance of our proposed algorithmic technique with that of the SEA algorithm in the considered scenario. Some conclusions are drawn in the last section.
2. Preliminaries
Let p be a prime and be the ring of residues modulo p, which can also be identified with the prime field . We consider a family of elliptic curves defined as , where is the multiplicative group of . Our aim is to find a suitable method (involving closed-form formulae) for computing the order of a general member of that family, the curve , in terms of the parameters a and p.
For basic number-theoretic notions as the least non-negative and absolute least residues of an integer z modulo another (odd) integer m, we refer to ([], p. 93). Notations “≡” for congruence modulo p and “=” in will be used in an interchangeable manner, depending on the context.
Hereinafter, we recall some necessary supplementary notions and facts (possibly with slight abuses).
An element is called a quadratic residue modulo p if there exists such that . Analogously, for , an element of is called the th order residue modulo p if there exists such that . The set of all th order residues form a subgroup of . We will denote the subgroups of quadratic and cubic residues () modulo p by and , respectively.
The next fact appears to be an immediate extension of the celebrated Euler criterion from the elementary number theory (see, e.g., [] Ch. 7.5).
Proposition 1.
If d is a factor of , then the monomial takes exactly d distinct values in , each one of them times. These values are the th roots of unity in , that is, solutions of the equation: . In particular, equals to 1 if, and only if z is a th power residue.
It is well-known that if, and only if (of course, modulo p takes two values with opposite signs to each other). The following statement, which is crucial for the efficiency of our approach, shows how to find such a square root.
Proposition 2.
Let z be a cubic non-residue modulo p, where . Then is equal to one of the square roots of modulo p.
Proof.
Indeed, according to Proposition 1, the assumption implies is a third root of unity in , different from 1. Thus, satisfies the equation , that is, or equivalently . ☐
Remark 1.
Proposition 1 (with ) easily implies that if , the cardinality of the set of cubic non-residues modulo p equals to . This can be interpreted as a reasoning that a randomly selected element of is a cubic non-residue with probability of . Thus, provided there is a high-quality generator of random integers in the interval , a cubic non-residue can be found after attempts on average. In turn, the square roots of modulo p can be efficiently determined by using Proposition 2.
The next proposition expresses a folklore fact that is decisive for our work.
Proposition 3.
For an odd prime p let , where . Then it holds:
For completeness, we give an alternative proof of that exposed in [].
Proof.
We use the fact that is a cyclic group. Let g be its generating element, that is, for any , there exists an such that . This means that . Putting as the last congruence implies that . Now, there are two cases to be considered:
- if , since the order of is then , which in turn gives that ;
- otherwise, the same reasoning implies .
☐
There is no explicit formula for the number of points on a general type elliptic curve over . The most relevant well-known result in this direction is the following bound (see, e.g., [] Ch. 4).
Theorem 1 (Hasse).
The number of points N on an elliptic curve over satisfies the inequality .
At the end of this section, we recall a needed fact from the theory of quadratic partitions of primes. This is a long-standing result due to Jacobi (1827) later elaborated by Stern (1832) (see, [] vol. III, p. 55 about historical details).
Proposition 4.
If p is a prime of the form for which , then
where the sign utilized is such that .
3. Our Approach
As mentioned in the Introduction, the general framework of our approach was described in []. We briefly exhibit its basic steps here.
The following proposition helps to unambiguously fix the number N of points on a given elliptic curve, provided one can compute the absolute least residue of modulo p denoted by .
Proposition 5.
In notations of Theorem 1, for a prime , it holds:
Proof.
Indeed, if , then evidently, . Thus, the Hasse theorem implies , which means that . ☐
Remark 2.
Note that if one can compute , or equivalently, the least non-negative residue R of an integer z modulo odd m, he/she could easily get:
3.1. An Explicit Formula for the Order of Elliptic Curve Reduced Modulo p
Initially, we yield the following congruence:
where
with and sums defined in Proposition 3.
(For the reader’s convenience, in the Appendix A we present a derivation of the expression for , which has already been obtained in [].)
Further, we evaluate using Proposition 3 and observe that the involved powers are only multiples of 3 in the interval . Thus, there are two distinct cases to be considered:
- In this case, Proposition 3 implies that for all summands on the right-hand-side of Equation (2) vanish mod p. So, , and in turn for each a, it holds that . Indeed, this is a well-known fact (see, e.g., [] Ch. 18, Ex.1).
- In this essential case, it can be easily seen that contains exactly one nonzero summand modulo p, that is, that for . Thus, it holds:
Finally, together with Proposition 5, this immediately implies the following:
Theorem 2.
An immediate consequence (except the trivial cases ) of Proposition 1 with , and Theorem 2 is next.
Corollary 1.
If p is a prime , then the order of the curves from takes exactly six distinct values, each one times in accordance with the sixth roots of unity in : where .
Remark 3.
Although the claim of Corollary 1 is known in one or another form (see, e.g., []), it seems that the uniform distribution of the curves’ order has not been widely discussed in the literature.
3.2. Computational Aspects of Point-Counting in When p Is a Large Prime
In this subsection, we refine and re-estimate the algorithmic technique described roughly in [].
A key part of those computations is that of . Fortunately, this problem can be addressed by noticing that if p is of the form , then it holds:
Hence, Proposition 4 allows modular computation of this binomial coefficient to be performed by taking the proper X from a solution of the quadratic Diophantine equation with two unknowns, X and Y. Such a solution can be found by applying a similar method as that exhibited in [], and consisting of two steps:
- Step 1. Find a square root of in ;
- Step 2. Find X by applying (partly) the Euclidean algorithm for p and the already found .
As follows by Proposition 2, Step 1 can be performed if one knows in advance a cubic non-residue mod p. If, for a given p, such a non-residue is not available, it can be found after attempts on average following Remark 1. Namely, in every such attempt for a randomly selected integer , we compute the element and check whether . If this happens, then is one of the possible in demand. Thus, taking into account the complexity of single multiplication (squaring) (see, e.g., [,]), the expected amount of work in Step 1 is, heuristically, . Additionally, notice that Step 2 is of complexity (see, e.g., [] Theorem 3.13 about details).
Remark 4.
If , there is an efficient deterministic way to find a square root of any quadratic residue ζ, that is, by computing . In particular, this can be applied for (see []).
Besides that, as can be seen by Corollary 1, the six possible distinct values of the second multiplier in expression (3) are linearly expressed in terms of the already found .
In summary, the above considerations show the validity of the next theorem:
Theorem 3.
The total computational complexity for simultaneously finding out the six orders linked with family by the proposed algorithmic technique is .
4. Example and Efficiency Comparison with the SEA Algorithm
4.1. An Example
The example presented here illustrates our probabilistic approach. We choose as the modulo the following prime
which is congruent to .
The numerical data presented below are in the hexadecimal number system.
Consecutively, we:
- Calculate :
- ∘
- choose a random numberD03CE6183277A6719AD52F362919187D79CA6A50D000975EC4903782F08DAAEB
- ∘
- calculate1AF6F28A07E19B1F1FCCB53D1A166E14092BC3AF668514D3D2ABE80CBD6C0A16
- ∘
- , thus is a square root of in :35EDE5140FC3363E3F996A7A342CDC281257875ECD0A29A7A557D0197AD8142D;
- Find X by applying the Euclidean algorithm for p and the found , and calculate
- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBDB3CE472111CA9F0DC134D795D6BFFF;
- Calculate and :
- E5090D75F81E64E0E0334AC2E5E991EBF6D43C50997AEB2C2E5427F34293F5EA, 1AF6F28A07E19B1F1FCCB53D1A166E14092BC3AF668514D3D2ABE80CBD6C0A16;
- Calculate the values of expression (3) using and in the role of multiplier , and take their opposites. Finally, we find out the six orders associated with :
- 100000000000000000000000000000001424C31B8DEEE3560F43EEB286A294004, FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBDB3CE472111CA9F0DC134D795D6C000, FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE065220C024EA85B297C0746F361E6B81,
- *
- 100000000000000000000000000000001F9ADDF3FDB157A4D6A3FAB90C9E19483, 100000000000000000000000000000000B761AD86FC2744EC7700D0685FB85481,
- *
- FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF489E527903D8BB138AFF4F97A047AB83.
Finally, by examining the above numbers with the APR-CL primality test, we detect the presence of two prime orders (remarked by “*”) which correspond to and .
4.2. Efficiency Comparison with the SEA Algorithm
In the program experiments for comparing efficiency of the SEA algorithm with the proposed one, both working at instances of considered task, we used a common laptop with an Intel Core i7-6820HQ at 2.7 GHz (four cores). The algorithm implementation is written in Python, whereas SEA’s one is a highly optimized code written in C from the PARI/GP computer algebra system designed specifically for fast computations in the number theory.
In Table A1 of the Appendix B, we give a list of bit primes used as experimental data input. As shown in Table A2, our method is between 20 to 67 times faster, although the implementation is not optimized. We also carried out an experiment with a sporadic bit prime input, whereby the SEA computes the orders for s, while our own performs the work for milliseconds, that is, almost 680 times faster. The latter fact indicates that the method is much more efficient than the SEA algorithm for large primes, say, above 800 bits.
5. Conclusions
Less or more convenient formulae to compute the orders of elliptic curves over finite fields do exist in contemporary literature (see, e.g., [,,], etc.). In this article, we derive an explicit formula for the order of a curve in the family reduced modulo p. Alongside the famous Hasse bound, this formula comprehensively and concisely resolves the problem we deal with. Moreover, our approach permits the transparent determination of the spectrum of orders for fixed , as well as to re-prove the corresponding known fact in the complementary case . Besides that, based on classical results for quadratic partitions of primes, we describe an efficient algorithmic technique (with complexity )) to simultaneously compute the six orders associated with in cases of interest. The experimental results confirm theoretical estimations for efficiency within expected slight abuse due to still unoptimized implementation. This technique improves the best previously known algorithmic solution [] with almost an order of magnitude, thus enabling under the same cost to achieve values of the parameter p peculiar to higher security ECC systems. It is especially useful when looking (say, by random search) for prime order elliptic curves belonging to families of considered type if the modulo p is varied.
Author Contributions
Conceptualization, Y.B. and M.M.; methodology, Y.B.; software, M.M.; validation, Y.B.; formal analysis, Y.B. and M.M.; investigation, Y.B. and M.M.; resources, Y.B. and M.M.; data curation, Y.B. and M.M.; writing—original draft preparation, Y.B. and M.M.; writing—review and editing, Y.B. and M.M.; visualization, Y.B. and M.M.; supervision, Y.B.; project administration, Y.B.; funding acquisition, Y.B. and M.M. All authors have read and agreed to the published version of the manuscript.
Funding
This research was partially supported by the Bulgarian National Science Fund under Contract KP-06-N32/2-2019.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
All data are contained within the article.
Conflicts of Interest
The authors declare no conflict of interest.
Abbreviations
The following abbreviations are used in this manuscript:
ECC | Elliptic Curve Cryptography |
SEA | Schoof-Elkies-Atkin |
APR-CL | Adleman-Pomerance-Rumely-Cohen-Lenstra |
Appendix A. Derivation of the Expression for H(a,p)
Excluding the point at infinity and taking into consideration the meaning of Legendre symbol, for the cardinality of the set of “real” points lying on the curve , it could be obtained the following expression:
Next, reducing Equation (A1) modulo p and making use of the Euler criterion, we obtain:
where denotes the sum .
Further, performing the binomial expansion and changing the order of summation, we have:
Since the last summand above equals to then Equation (A2) is simplified to
where the expression for is obtained from (A3) by removing the last summand.
Appendix B. Tables for Comparing the Efficiency

Table A1.
Prime Numbers .
Table A1.
Prime Numbers .
Prime Number (HEX) | |
---|---|
1744AA82FB357A0A99A571EABF8E72B860517859044F993E2606ECAF7BC6CB169 | |
1032FAF22DC31F3E339E3F0CAC8BF44F21B383D3A687A41326A4CC77EAC31D881 | |
19C7E604E23D3DEF8A371353FD8EFA4C9F7503083CD2FCE2EA7FEF1120EC3B3E9 | |
1750F9C8F1490EEDC1B05F0CA012ED4B42925C588AA5FFCC285F84E802EA71C65 | |
161D8802C08AC9AB133B20100B50C4CF1710A7BEDBA3292B56567D996DE3CEF4D | |
1BF6DA0DA929F9784E07C6835AD78389B06CBD5FB776F9F2371AC79B7C7FC1B6D | |
1946A87890B83A015439E75B2BA2C20C9D742E7A85B592815A5D6C11DDACD4695 | |
1819AA8747CF5595260B5A3D7FF8E800DD365E21E26DEBC306F7E48B12C2E2A29 | |
18864DC62E42429367F6826C5F2AAF1401875EA94E1DA3D70DB1BB7D049F90525 | |
1304670800156954405D850ABD3086D0E8AC7B898E4CC9F18000CF2B9087DBD15 |

Table A2.
Efficiency Comparison.
Table A2.
Efficiency Comparison.
Test № | Prime | SEA Execution Time (ms) | Our Method Execution Time (ms) |
---|---|---|---|
1 | 829.7 | 12.4 | |
2 | 251.8 | 12.3 | |
3 | 636.4 | 12.2 | |
4 | 430.9 | 11.5 | |
5 | 436.8 | 11.1 | |
6 | 284.7 | 12.3 | |
7 | 355.4 | 10.9 | |
8 | 558.0 | 12.2 | |
9 | 398.1 | 11.1 | |
10 | 393.2 | 11.1 |
References
- Van Tilborg, H. Elliptic curve cryptosystems; too good to be true? Nieuw Arch. Voor Wiskd. 2001, 5, 220–225. [Google Scholar]
- Miller, V.S. Use of elliptic curves in cryptography. In Conference on the Theory and Application of Cryptographic Techniques; Springer: Berlin, Germany, 1985; pp. 417–426. [Google Scholar]
- Koblitz, N. Elliptic curve cryptosystems. Math. Comput. 1987, 48, 203–209. [Google Scholar] [CrossRef]
- Schoof, R. Counting points on elliptic curves over finite fields. J. ThéOrie Des Nombres Bordx. 1995, 7, 219–254. [Google Scholar] [CrossRef]
- Croucher, J.S. Collecting Coupon—A Mathematical Approach. Aust. Sr. Math. J. 2006, 20, 31–35. [Google Scholar]
- Munuera, C.; Tena, J.G. An algorithm to compute the number of points on elliptic curves of j-invariant 0 or 1728 over a finite field. Rend. Del Circ. Mat. Palermo 1993, 42, 106–116. [Google Scholar] [CrossRef]
- Peralta, R. A simple and fast probabilistic algorithm for computing square roots modulo a prime number (Corresp). IEEE Trans. Inf. Theory 1986, 32, 846–847. [Google Scholar] [CrossRef]
- Knuth, D.E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd ed.; Addison-Wesley Longman Publishing Co., Inc.: Boston, MA, USA, 1997. [Google Scholar]
- Von zur Gathen, J.; Gerhard, J. Modern Computer Algebra; Cambridge University Press: Cambridge, UK, 2013. [Google Scholar]
- Kırlar, B.B. On the elliptic curves y2 = x3 − c with embedding degree one. J. Comput. Appl. Math. 2011, 235, 4724–4728. [Google Scholar] [CrossRef]
- Ireland, K.; Rosen, M. A Classical Introduction to Modern Number Theory, 2nd ed.; Springer: New York, NY, USA, 1990. [Google Scholar]
- Borissov, Y.; Markov, M. An Approach for Computing the Number of Points on Elliptic Curve y2 = x3 + a (mod p) via Explicit Formula for That Number Modulo p. In Proceedings of the 2019 Ninth International Workshop on Signal Design and Its Applications in Communications (IWSDA), Dongguan, China, 20–24 October 2019; pp. 1–5. [Google Scholar]
- Rosen Kenneth, H. Elementary Number Theory and Its Applications, 6th ed.; Addison-Weley Publishing Company: Boston, MA, USA, 2011. [Google Scholar]
- Hardy, G.; Wright, E.; Heath-Brown, R.; Silverman, J.; Wiles, A. An Introduction to the Theory of Numbers; Oxford University Press: Oxford, UK, 2008. [Google Scholar]
- Washington, L.C. Elliptic Curves: Number Theory and Cryptography; CRC Press: Boca Raton, FL, USA, 2008. [Google Scholar]
- Dickson, L.E. History of the Theory of Numbers: Quadratic and Higher Forms; Courier Corporation: North Chelmsford, MA, USA, 2012; Volume 3. [Google Scholar]
- Bos, J.W.; Halderman, J.A.; Heninger, N.; Moore, J.; Naehrig, M.; Wustrow, E. Elliptic curve cryptography in practice. In International Conference on Financial Cryptography and Data Security; Springer: Berlin, Germany, 2014; pp. 157–175. [Google Scholar]
- Wilker, P. An efficient algorithmic solution of the Diophantine equation u2 + 5v2 = m. Math. Comput. 1980, 35, 1347–1352. [Google Scholar]
- Harvey, D.; Hoeven, J. Integer Multiplication in Time O(nlogn). 2020. Available online: https://hal.archives-ouvertes.fr/hal-02070778v2 (accessed on 7 June 2021).
- Cohen, H. A Course in Computational Algebraic Number Theory; Springer Science & Business Media: New York, NY, USA, 2013; Volume 138. [Google Scholar]
- Silverman, J.H. The Arithmetic of Elliptic Curves; Springer Science & Business Media: New York, NY, USA, 2009; Volume 106. [Google Scholar]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).