The Elliptic Net Algorithm Revisited
Abstract
Pairings have been widely used since their introduction to cryptography. They can be applied to identity-based encryption, tripartite Diffie-Hellman key agreement, blockchain and other cryptographic schemes. The Acceleration of pairing computations is crucial for these cryptographic schemes or protocols. In this paper, we will focus on the Elliptic Net algorithm which can compute pairings in polynomial time, but it requires more storage than Miller’s algorithm. We use several methods to speed up the Elliptic Net algorithm. Firstly, we eliminate the inverse operation in the improved Elliptic Net algorithm. In some circumstance, this finding can achieve further improvements. Secondly, we apply lazy reduction technique to the Elliptic Net algorithm, which helps us achieve a faster implementation. Finally, we propose a new derivation of the formulas for the computation of the Optimal Ate pairing on the twisted curve. Results show that the Elliptic Net algorithm can be significantly accelerated especially on the twisted curve. The algorithm can be faster than the previous ones on the twisted 381-bit BLS12 curve and faster on the twisted 676-bit KSS18 curve respectively.
Keywords:
Elliptic Net Algorithm Twists of Elliptic Curves Pairings Denominator Elimination High Security Level.1 Introduction
Pairings as mathematical primitives can offer efficient solutions to some special difficult problems in cryptography [25]. Nowadays, pairings still play a vital role in some areas. In the blockchain, pairings can be applied for the zero-knowledge succinct non-interactive argument of knowledge (zk-SNARK) [8, 14]. Moreover, pairings can be used for the compression of public keys in the isogeny-based cryptosystem [26].
The implementation of pairings is a key operation in these applications. The Weil pairing, the Tate pairing and their variants such as the Ate pairing [17, 21], the R-ate pairing [19], and the Optimal Ate pairing [34] are used in some cryptographic schemes. It is well known that pairings can be computed by Miller’s algorithm [22, 23] which was proposed in 1986. Miller’s algorithm has been optimized a lot since 2000, and it has been developed to be in a relatively mature stage. There also exists another polynomial time algorithm to compute pairings, i.e., the Elliptic Net algorithm. This algorithm was proposed in 2007 by Stange [31] who first defined elliptic nets and gave a relationship between elliptic nets and the Tate pairing. We abbreviate this original Elliptic Net algorithm to ENA. Compared with Miller’s algorithm, the Elliptic Net algorithm requires more computational costs while it can be implemented efficiently on a personal computer. Furthermore, there is no inverse operation involved in affine coordinates in the Elliptic Net algorithm. Therefore, the implementation of this algorithm is simple and intuitive.
Elliptic nets are generated by elliptic divisibility sequences which were first studied by Morgan Ward [35] in 1948. These sequences arise from any choice of an elliptic curve and rational points on that curve. For more information about elliptic divisibility sequences see [10]. The method called Double-and-Add for updating each value of an elliptic divisibility sequence in polynomial time which was proposed by Rachel Shipsey [30].
Pairings can be computed using elliptic nets of rank . The ENA was used to compute the Tate pairing originally [31]. Then the explicit formulas for computing some variants of the Tate pairing using the ENA were given [33, 27]. In 2015, an improved version of the ENA was proposed [7]. We abbreviate this algorithm to IENA in this work. The IENA can perform well if the parameter of the Miller loop has low Hamming weight. Fortunately, the most popular paring-friendly curves all meet this condition. Due to the particularity of the structure of elliptic nets, an parallel strategy for the ENA to compute pairings was proposed [28].
Elliptic nets of rank can be applied to scalar multiplication, and it is an algorithm that can resist side-channel attacks. Kanayama et al. [18] adopted the ENA to compute scalar multiplication using elliptic nets of rank , i.e., division polynomials. Besides, there are some other works about scalar multiplication based on elliptic nets. An optimized version of scalar multiplication algorithm using division polynomials was proposed in [6], which saved multiplications at each iteration by using the equivalence of elliptic nets. Based on these previous works, Rao et al. [32] proposed a modified algorithm based on elliptic nets to compute scalar multiplication.
However, the efficiency of the Elliptic Net algorithm still needs to be avoided. In order to shorten the gap between the Elliptic Net algorithm and Miller’s algorithm in efficiency, we develop several methods. Firstly, we analyze the properties of elliptic nets and conclude that the inverse operation in the IENA can be eliminated. Secondly, we construct the Optimal Ate pairing on the twisted curve and discuss the relationship between the Optimal Ate pairing on the original elliptic curve and that on the twisted curve with divisor and pull-back. This is a new derivation of the formulas for pairing computation which is entirely on the twisted curve. Thirdly, lazy reduction technique is employed in our implementation to get a further improvement. The specific contributions of this work are:
-
•
We explore how to eliminate the inverse operation in the IENA. For the IENA, an inverse operation is involved at addition step in the Double-and-Add algorithm. In this paper, we get a result in the updating process of the IENA. If all the values of an elliptic net in the current state are multiplied by a non-zero fixed value, then the value of the reduced Tate pairing or its variants can not be changed. This finding means that the inverse operation can be replaced by several multiplications. The implementation indicates that the IENA works well if it is further modified by this trick. Besides, this trick contributes to the scalar multiplication algorithm in [32].
-
•
The idea of twists is employed to speed up the Elliptic Net algorithm. Twists of elliptic curves are deeply applied to Miller’s algorithm, which can significantly decrease the amount of multiplications. More detailed descriptions see [15, 17]. Throughout the process of Miller’s algorithm, Costello et al. [9] explored the pairing computation which is entirely on the twisted curve. Based on these works, we use the Elliptic Net algorithm to compute the Optimal Ate pairing entirely on the twisted curve. We will provide a new proof based on the theory of divisors and pull-back, which has a strength that it not depends on the process of Miller’s algorithm. Hence, this is totally different from the previous work. Furthermore, we give the explicit formulas of the line function of the Optimal Ate pairing on the twisted curve. We boost the performance of the Elliptic Net algorithm on a 381-bit BLS12 curve at 128-bit security level and a 676-bit KSS18 curve at 192-bit security level by using twists [4]. Twists of elliptic curves allow us to transfer the operations from to the proper subfield of , which significantly reduces the total amount of multiplications.
-
•
We adopt lazy reduction technique [20] which only performs one reduction for the sum of several multiplications to the Elliptic Net algorithm. Lazy reduction was first introduced in quadratic extension field arithmetic for Miller’s algorithm by Michael Scott [29] and further developed in [2]. In the Elliptic Net algorithm, we observe that there are many terms have the form , which inspires us to apply lazy reduction for this algorithm. In our implementation, lazy reduction reduces by around 27% the number of modular reductions.
We conclude that pairings can be efficiently computed with the Elliptic Net algorithm. Even though it is still slower than Miller’s algorithm, the ratio of the cost of the Elliptic Net algorithm to Miller’s algorithm is reduced from more than to less than after the modification in this work.
The rest of this paper is organized as follows. Section 2 gives an overview of pairings, twists of elliptic curves and the Elliptic Net algorithm. In Section 3, we replace an inverse operation by several multiplications in the IENA. Section 4 analyzes the Ate pairing and Optimal Ate pairing on the twisted curve that are computed by the Elliptic Net algorithm. In Section 5, we apply lazy reduction technique to the Elliptic Net algorithm. The implementation and efficiency analysis are discussed in Section 6. Section 7 concludes the paper.
2 Preliminaries
In this section, we will give the definition of the Tate pairing and the (Optimal) Ate pairing. A brief description of twists of elliptic curves and the Elliptic Net algorithm will also be provided.
2.1 Pairings
Let be a finite field where and is a prime. Let be an elliptic curve defined over . We denote the -power Frobenius endomorphism on by . The number of points on is given by , where is the Frobenius trace of .
Choose a large prime with , and let be the embedding degree with respect to such that but . Choose and . The -th roots of unity in , which we denote by .
For an integer and a point on , let be a rational function such that
In particular, . Then the reduced Tate pairing [12] is defined as
Furthermore, if we choose and in specific subgroups of , the pairing computation can be sped up. Define
Choose and . Let . We can define a pairing when :
which is called the Ate pairing [17].
The Ate pairing is a variant of the Tate pairing, and the length of the Miller loop is short[21, 19]. The Optimal Ate pairing allows us to obtain the shortest loop length [34]. We have the following theorem [34, 37, 38].
Theorem 2.1
Let with . We have , where is the Euler function of , then we can define a bilinear map
where . If then is non-degenerate. We call as the Optimal Ate pairing.
The explicit expression of the Optimal Ate pairing depends on the family type of pairing-friendly curves. In this work, we mainly consider the implementation of the Optimal Ate pairing on the BLS12 and KSS18 curves. More specific information will be discussed in Section 6.
2.2 Twists of Elliptic Curves
Definition 1
A twist of degree of is an elliptic curve defined over . We can define an isomorphism over from to with is minimal:
The potential degree is or [25, 15]. For the BLS12 and KSS18 curves, is a twist of degree of . Let . For the M-type and D-type twists [3] with degree , the corresponding isomorphism is given as follows:
(1) | |||||
Furthermore, we have the following theorem for the Tate pairing:
Theorem 2.2
[5] Let be an elliptic curve. Choose . Suppose that the embedding degree with respect to and is . There exists an isogeny and is the dual of , where is an elliptic curve over . Choose and . We have .
Notice that is an isogeny of degree . If we denote the dual of by , then , i.e., . By Definition 1, choose and . We can compute pairings on the twisted curve . And the loop length is the same as which is computed on the original curve .
2.3 The Elliptic Net algorithm
An elliptic net satisfies some certain recurrence relation which is a map from a finitely generated free Abelian group to an integral domain . An elliptic net of rank 1 satisfies the following recurrence relation:
(2) | ||||
where . Let be a short Weierstrass curve over , where . And the characteristic of is not equal to or .
2.3.1 Scalar Multiplication
For each , we can define division polynomials as follows [15].
Division polynomials are elliptic nets of rank , i.e., . They can be used to compute scalar multiplication.
2.3.2 Pairing Computation
Elliptic nets of rank is applied to pairing computation. The relationship between the Tate pairing and an elliptic net is given below.
According to Equation (2), we obtain the explicit formulas to update the values of an elliptic net. We can compute the Tate pairing in polynomial time if the initial values of an elliptic net are given. For simplicity, we abbreviate to . In [31], they defined a block that consists of a first vector of eight consecutive terms centered on term and a second vector of three consecutive terms centered on , where .
Assume that . For the first vector, all of terms can be updated by two formulas as follows.
(5) |
(6) |
For the second vector, we need the following formulas to update the terms.
(7) |
(8) |
(9) |
(10) |
For some certain conditions, can be changed to by the equivalence of elliptic nets [6].
The IENA is shown in Algorithm 1. Generally, updating a block centered on to a block centered on is called the Double step, and updating a block centered on to a block centred on is called the DoubleAdd step, which is represented by and respectively. The algorithm to compute the process of line 2-8 in Algorithm 1 is called the Double-and-Add algorithm. If we just need to compute scalar multiplication, then we only need to update the first vector by Equation (5)-(6). We do not use the IENA to compute scalar multiplication here. There exists an inversion if we need to compute the DoubleAdd step in the IENA. But for the scalar multiplication, the scalar is random and we can not ensure that is an integer with low Hamming weight. Notice that multiplications can be saved at each iteration in the Double-and-Add algorithm if [6]. In this work, we will improve the Double-and-Add algorithm for scalar multiplication in two situations in [32].
Note that twists of elliptic curves have been applied for accelerating Miller’s algorithm successfully. The situation of operations entirely on the twisted curve was proposed [9]. Their derivation of the Ate pairing entirely on the twisted curve heavily relies on the process of Miller’s algorithm. Pairings entirely on the twisted curve can also be computed by the Elliptic Net algorithm, but it still needs to be verified.
3 Elimination of the Inverse Operation
In the IENA, an inverse operation is always involved at addition step. We will show how to eliminate this inverse operation in this section, i.e., replace the inversion by few multiplications.
When a block centered on is updated to a block centered on , the value satisfies the following recursive formula:
(11) |
From Equation (11), we need to compute the inverse element of . To eliminate this inverse operation, we multiply by simultaneously when the bit is equal to . We have the following theorem to support this approach.
Theorem 3.1
Let , be the current state of an elliptic net.
-
1.
For , if are multiplied by , i.e.,
then in the next state
Furthermore, if is chosen to be in a proper subfield of , then the value of the reduced Tate pairing or its variants can not be changed.
-
2.
For , if and are multiplied by , then in the next state all the terms of this elliptic net will be multiplied by , and the value of the reduced Tate pairing or its variants can not be changed.
Proof
Let us consider first.
Note that the recursive formula for is
(12) |
We multiply by , then the new updated should be
(13) | ||||
Similarly, we can show that the new updated This finishes the proof for the first assertion.
Then we consider the second vector. Note that there are only two values of the first vector involved for computing each . The new updated will be multiplied by .
Therefore, the value of the new pairing is equal to the product of the original pairing value and a fixed power of . However, if the constant is chosen to be in a proper subfield of , then the final exponentiation will eliminate the value of the fixed power of the constant . So the value of the reduced Tate pairing or its variants can not be changed even if all the values of in the state are multiplied by a non-zero fixed value .
Now we prove the second part of this theorem. In Theorem 2.3, we know that
If we multiply and by , where is any non-zero value, then we have:
for some integer . This means that if we multiply all values in the updating block by a fixed non-zero value, the ratio of can not be changed.∎
Remark 1
We just consider the situation at the Double step. At the the DoubleAdd step, the conclusion can be verified similarly.
Remark 2
Theorem 3.1 can also be applied for any pairing-friendly curves while we may have to multiply both dimension of vectors. In this situation, we cost multiplications and the result can not be changed.
Until now, we have shown how to replace the inverse operation by several multiplications. For some popular pairing-friendly curves, we have a friendly situation. Take the BLS12 curve we used in this work as an example, then there is a proposition which is helpful to our algorithm. The related parameters of the BLS12 curve can be seen in Section 6.1.1 and the towering scheme is shown as follows.
-
•
, where ;
-
•
, where ;
-
•
.
Proposition 1
Choose and .
For , if is odd, then is in the proper subfield of ; If is even, then belongs to . Furthermore, let , if is even.
Proof
We abbreviate to .
Note that , where is a division polynomial. Therefore, we just verify the proposition in two situations according to Section 3.2 in [36]:
-
1.
Assume that is odd, then is a polynomial in . For the short Weierstrass curve , can be replaced by polynomials in . Furthermore, and the -coordinate of is . Therefore, is always in a proper subfield of .
-
2.
If is even, then is a polynomial in . And the -coordinate of is , so can be written as , where .
∎
From Proposition 1, if are multiplied by , where , then both and will always be in . From Theorem 3.1, in the next state the value of or will be multiplied by . And or will be multiplied by . Therefore, if the last iteration is the doubling step, then the value of the reduced Tate pairing or its variants can not be changed.
Moreover, the last iteration of the Miller loop on the BLS12 curve will always invoke the doubling step. Hence, we can avoid the inversion in the IENA. This means that we can use multiplications to eliminate inversion. Therefore, the effect of our method always works well when the cost of inverse operation is more than that of multiplications.
For the situation of scalar multiplication algorithm based on elliptic nets, we have the following corollary.
Corollary 3.2
Choose . Let be the current state of an elliptic net which is associate to . For , if are multiplied by , i.e., . Then the value of the scalar multiplication can not be changed.
Proof
Besides, we can have a further improvement based on the algorithm in [32]. Their Double-and-Add algorithm is improved by using some tricks to save multiplications at each iteration, but it involves right-shift operations. We can replace these operations by left-shift operations.
4 The Elliptic Net Algorithm on the Twisted Curve
The application of the twisted curve brings some significant improvements in Miller’s algorithm. However, if we use the twist trick on the original curve with the Elliptic Net algorithm, then it will not be as portable and intuitive as Miller’s algorithm. In 2010, Costello et al. [9] proposed the Ate pairing entirely on the twisted curve for Miller’s algorithm. Actually, when we use the Elliptic Net algorithm to compute pairings, it will also have a good improvement if the related parameters all on the twisted curve. In this section, we will analyze the Ate pairing and the Optimal Ate pairing on the twisted curve with our method and apply our work to the Elliptic Net algorithm.
4.1 The Ate Pairing on the Twisted Curve
Let be an elliptic curve over , and the related parameters are defined in Section 2.1. Let be the twist of of degree with . Let be the -power Frobenius map on . There exists an isomorphism over , then we can define two groups
Actually, the iterations of the Miller loop can be set as [21]. When we compute the Ate pairing, the operations are all on the original curve. In the following part, we will give a new derivation of the theorem about pairings entirely on the twisted curve.
Theorem 4.1
For , we can define a pairing on if :
Proof
We only need to prove that , for all .
The divisor of is
and since is an isomorphism,
Furthermore, we have , then we have . We compose the formula with on both sides, and obtain:
∎
Remark 3
When we compute pairings on the twisted curves, the operations are always in the field where is located. The final value we need can be obtained by twists. The transformation involved here is very small for Miller’s algorithm. This is because each transformation only needs to be multiplied by a fixed value on . Generally, is sparse. But for the Elliptic Net algorithm, if we adopt the same idea to use this isomorphism, then the value of will be changed as the iterations, which means that the transformation of the value we need will not be a friendly process. Therefore, we choose to compute pairings on the twisted curve for the Elliptic Net algorithm.
4.2 The Optimal Ate Pairing on the Twisted Curve
For the Optimal Ate pairing on the twisted curve, the situation is more complicated than that of the Ate pairing while we can still derive the following theorem easily.
Theorem 4.2
Let with and . Define
and note that , where . There exists a pairing on :
Proof
From Theorem 4.1, we have
Let . Consider the relation between and . From the definition of divisors,
Since is an isomorphism,
Therefore,
Similarly,
∎
Remark 4
For , we have .
Since is an endomorphism and is an isomorphism over , we have
Therefore, we have
Thus, we know that the point in can be mapped to a point in . This also means that the line function on the twisted curve via this result.
Note that the ratio of the cost of inversions to the multiplications over decreases if the size of is larger. When we compute the Ate pairing on the twisted curve, our operations in the first dimension vector centered on are in . Compared with the operations in , it is more necessary to eliminate the inverse operation when the bit is not equal to . Furthermore, we can use the NAF form to ensure that the density is within the effective range to accelerate the IENA.
5 The Elliptic Net Algorithm with Lazy Reduction
Lazy reduction technique can also be applied to speed up the Elliptic Net algorithm. Lazy reduction was presented formally in [20]. It can save the number of modular reductions during the calculation. The main idea of lazy reduction is to put the required modular reductions of some multiplication operations like over to the end. So these multiplication operations only need modular reduction over . Thus it can save the number of modular reductions during the calculation. In this paper, we use Montgomery reduction [24], so the cost of a modular reduction is equal to the cost of one multiplication. Note that each item of without modular reduction should satisfy the upper bound of Montgomery reduction.
When we use the Elliptic Net algorithm to compute pairings, it contains lots of multiplications like , which needs 2 modular reductions normally. But if we use lazy reduction, we can only need one modular reduction. Obviously, we are not concern about violating the upper bound for this situation since we only use the lazy reduction once each time, and we set . The proposed algorithms using lazy reduction are given for the initialization step and Double-and-Add step respectively. We mainly improve the term and at the initialization step. The improvement is not obvious here, so we only give the number of modular reductions of three situations in Table 1.
Algorithm | |||
ENA [31] | 10 | 8 | 6 |
This work | 7 | 6 | 5 |
The explicit updating formulas at the Double-and-Add step are mentioned in Section 2.3. The and functions are combined with the lazy reduction technique, and we adopt the new Double-and-Add step in [7] which needs 10 terms in total. We present the Double-and-Add algorithm based on the IENA in Appendix 0.A. Assume that our terms belong to the finite field . At step [7]-[23] we compute the function. We update 7 terms in the first vector and 3 terms in the second vector that are both centered on . In the ENA, we need 42 modular reductions in each iteration. In contrast, the number of modular reductions decreases to 37 in the IENA. With the help of lazy reduction, the updating process of each term can save one modular reduction, so 10 terms will save 10 modular reductions in total. The function is computed at step [25]-[43]. These steps contain 40 modular reductions originally and the number of modular reductions decreases to 30 with lazy reduction in each iteration. Table 2 shows the number of modular reductions of three Elliptic Net Algorithms at the Double-and-Add step.
6 Implementation and Analysis
In this section, we implement the optimization of the Elliptic Net algorithm for scalar multiplication and pairing computation respectively. Our algorithms are implemented by using the C programming language compiled with the GCC compiler of which the version is 7.4.0. Our code is based on version 0.5.0 of the RELIC toolkit [1] and we use the Intel Core i7-8550U CPU processor operating at 1.80 GHz that runs on a 64-bit Linux. Our implementation will be divided into two parts. One is scalar multiplication, and the other one is pairing computation. We apply lazy reduction technique to both parts. Note that lazy reduction has a good acceleration effect in the Elliptic Net algorithm.
In the firsy part, we will use different methods to compare the efficiency of computing the Optimal Ate pairing on the twisted curve at 128-bit security level and 192-bit security level respectively. Notice that the function is not friendly in the IENA. In general, we will choose the loop length which has a low Hamming weight so that we can use function more frequently in the whole iterations to accelerate the algorithm.
In the second part, we will show the comparison of the efficiency between computing scalar multiplication in [32] and our work. Scalar multiplication algorithm with division polynomials is similar to the ladder algorithm, and this algorithm is easily coded compared to the traditional double-and-add algorithm. It can naturally resist power attacks, but it is slower than the basic double-and-add algorithm. Therefore, we do not compare our algorithms with the state-of-the-art algorithm for standard elliptic curve scalar multiplication algorithm [13]. We choose the NIST P-384 curve and the NIST P-521 curve to compute scalar multiplication respectively [16]. Notice that for the NIST P-384 curve, the prime satisfies . Therefore, we can combine works in [6] with our work to get a further improvement on this curve.
The elliptic curves we choose are the 381-bit BLS12 and 676-bit KSS18 curves. We specify some symbols here to show the amount of operations in this section:
-
•
: the multiplication over , : the square operation over ,
-
•
: the multiplication over , : the square operation over ,
-
•
: the inversion over , : the addition operation over .
6.1 Pairing Computation
In the following part, we will focus on the improvement of pairing computation using the Elliptic Net algorithm.
6.1.1 381-bit BLS12 Curve
The concrete parameters for the 381-bit BLS12 curve with embedding degree are given as follows.
-
•
;
-
•
;
-
•
;
-
•
over ;
-
•
, where ;
-
•
, where ;
-
•
;
-
•
the twisted curve : over .
Recall that and . We apply three techniques discussed in this work to the ENA and the IENA for computing the Optimal Ate pairing. According to Theorem 4.2 in Section 3, the explicit formulas of line functions on the twisted BLS12 curve can be obtained. Therefore, for the BLS12 curve, we only need to calculate
The amount of operations for and in one iteration is and at the Double step in the ENA, respectively. Note that in our implementation, , , and . In the IENA, we need without twist when the bit is not equal to . If we compute pairings on its corresponding twisted curve, the operations can be reduced to . Without considering the influence of delay error, it is not necessary to eliminate the inverse operation if we do not use twists of elliptic curves here. But when the cost of one inversion is greater than the cost of 5 multiplications, eliminating the inverse operation can have a more obvious improvement. Moreover, since is a negative number, we choose to compute and use the relationship to revise the value. Note that in order to make the IENA work well, we choose to expand in the NAF form to reduce the proportion of non-zero digits. Then the non-zero digits density will be smaller than that of the previous one. Although the Elliptic Net algorithm is much slower than Miller’s algorithm, it still counts in milliseconds. Therefore, we cycle the program times and take the average value to ensure the stability and accuracy of our program. The comparison about the efficiency of different methods is provided in Table 3.
Method | Clock Cycle () | Time (ms) |
ENA [31] | 25,524 | 12.81 |
ENA with lazy reduction | 24,599 | 12.35 |
IENA [7] | 23,508 | 11.80 |
IENA with lazy reduction | 22,586 | 11.34 |
IENA (Eliminate Inverse) | 23,554 | 11.82 |
IENA (Eliminate Inverse) with lazy reduction | 22,722 | 11.41 |
ENA (Twist) | 4,890 | 2.45 |
ENA (Twist) with lazy reduction | 4,463 | 2.24 |
IENA(Twist) | 4,749 | 2.38 |
IENA(Twist) with lazy reduction | 4,325 | 2.17 |
IENA(Twist Eliminate Inv) | 4,575 | 2.30 |
IENA(Twist Eliminate Inv) with lazy reduction | 4,315 | 2.16 |
Miller’s algorithm | 3,123 | 1.57 |
From Table 3, we can see that this work speeds up the Elliptic Net algorithm indeed and the efficiency of computing the Optimal Ate pairing on the twisted curve is much quicker than that on the original elliptic curve. The twist technology has a good performance for both algorithms. The efficiency has been increased by about without using lazy reduction in the IENA. Notice that lazy reduction also plays a vital role in the algorithm, which further accelerates the algorithm. Besides, the elimination of the inversion has also been proved to be effective which is up to faster than the IENA. Compared to the ENA, the efficiency of our work on the original and twisted curves increases by around and , respectively.
6.1.2 676-bit KSS18 Curve
Now we give the parameters of the 676-bit KSS18 curve with embedding degree below:
-
•
;
-
•
;
-
•
;
-
•
over ;
-
•
, where ;
-
•
, where ;
-
•
;
-
•
the twisted curve : over .
We need to calculate
or
for computing the Optimal Ate pairing on this curve. In order to make our comparisons more obviously and steadily, we calculate the Optimal Ate pairing times, and take the average value as the final result. Table 4 shows the timings of different methods for computing the Optimal Ate pairing.
Method | Clock Cycle () | Time (ms) |
ENA [31] | 136,542 | 68.54 |
ENA with lazy reduction | 132,700 | 66.61 |
IENA [7] | 122,629 | 61.56 |
IENA with lazy reduction | 119,991 | 60.23 |
IENA (Eliminate Inverse) | 122,681 | 61.59 |
IENA (Eliminate Inverse) with lazy reduction | 120,686 | 60.58 |
ENA (Twist) | 40,949 | 20.56 |
ENA (Twist) with lazy reduction | 39,440 | 19.80 |
IENA(Twist) | 40,676 | 20.42 |
IENA(Twist) with lazy reduction | 39,276 | 19.72 |
IENA(Twist Eliminate Inv) | 40,291 | 20.23 |
IENA(Twist Eliminate Inv) with lazy reduction | 38,904 | 19.53 |
Miller’s algorithm | 17,149 | 8.61 |
On the KSS18 curve, the effect of our modification is similar to the performance on the BLS12 curve. Just comparing the performance of the ENA on the twisted curve and the original curve, the algorithm is faster on the twisted curve. But after eliminating the inverse operation and using lazy reduction technique, the algorithm can be about faster than the IENA on the twisted curve.
From these results, we find that the improvement of lazy reduction on the KSS18 curve is increased. This is mainly because the embedding degree on the KSS18 curve is bigger than that of the BLS12 curve. Besides, we have more iterations of the Miller loop on the KSS18 curve. But the amount of optimization in a single iteration is same. In contrast to our theory, the efficiency of computing the Optimal Ate pairing on the twisted curve is much higher than that on the original curve for the Elliptic Net algorithm. In addition, we can further improve the efficiency of the algorithm by eliminating the inverse operation. Notice that Miller’s algorithm performs well in our implementation with the cost time of on the 381-bit BLS12 curve. Its version in our work is the fastest one implemented by Diego et al. in the Relic toolkit [1], and we test its efficiency in our personal computer. However, compared with the previous work, the gap between the Elliptic Net algorithm and Miller’s algorithm has been greatly shortened, which from the original cost of more than 9 times to the current cost of less than 2 times.
6.2 Scalar Multiplication
Our work based on the scalar multiplication algorithm proposed in [32] is to replace right-shift operations by left-shift operations in each iteration. It seems that this improvement will not work obviously. However, after we use the lazy reduction technique, the efficiency will have a good improvement. We choose two curves which achieve 192-bit security level and 256-bit security level respectively. The equations of these curves over have the form: .
6.2.1 NIST P-521 Curve
In [32], the amount of operations is and right-shift operations at each iteration. Let one subtraction operation or one double operation be equal to one addition operation. The trick in Section 3 is applied to this algorithm, and then we replace right-shift operations by left-shift operations. Table 5 provides the timings of scalar multiplication algorithm in [32] and this work.
Method | Clock Cycle () | Time (ms) |
Algorithm [32] | 5,097 | 2.56 |
Algorithm [32] with lazy reduction | 4,844 | 2.43 |
This work | 4,920 | 2.47 |
This work with lazy reduction | 4,530 | 2.27 |
Our work facilitates an acceleration of around over the algorithm in [32] of scalar multiplication. However, the efficiency of these algorithms is slower than that of the ENA for scalar multiplication except the prime is large enough.
6.2.2 NIST P-384 Curve
We focus on the situation of and combine the work in [6] and [32] to compute scalar multiplication. Let such that . Then the initial values of an elliptic net are given below:
We use these new initial values above to compute scalar multiplication. The amount of operations will be reduced from and right-shift operations to and left-shift operations in each iteration. Table 6 reflects the efficiency of algorithm in [32] and our work for computing scalar multiplication on the NIST P-384 curve. Results shown that we have an improvement based on [32] with .
7 Conclusions
In this work, we improved the Elliptic Net algorithm. Among different versions of the Elliptic Net algorithm, we analyzed their efficiency and presented higher speed records on the computation of the Optimal Ate pairing on a 381-bit BLS12 curve and a 676-bit KSS18 curve by using the Elliptic Net algorithm with several tricks, respectively. We also improved the scalar multiplication algorithm in [32] and implemented our work on a NIST P-384 curve and a NIST P-521 curve, respectively. The scalar multiplication algorithm was increased by up to than the work in [32]. The lazy reduction technique was able to reduce by around of the required modular reductions. Moreover, the application of twist technology helped us reduce the number of multiplications and the improvement was significant. Besides, the improved Elliptic Net algorithm was also further improved, i.e., the inverse operation can be replaced by few multiplications when the bit is equal to or . On the 381-bit BLS12 curve, this work improved the performance of the Optimal Ate pairing by compared with the original version on a 64-bit Linux platform. The implementation on the 676-bit KSS18 curve had shown that this work was faster than the previous ones. Our results shown that the Elliptic Net algorithm can compute pairings efficiently on personal computers while it was still slower than Miller’s algorithm. In the future, we will consider the parallelization of the Elliptic Net algorithm to get a further improvement.
References
- [1] Aranha, D.F., Gouvêa, C.P.L.: RELIC is an Efficient LIbrary for Cryptography. https://github.com/relic-toolkit/relic
- [2] Aranha, D., Karabina, K., Longa, P., Gebotys, C., López, J.: Faster explicit formulas for computing pairings over ordinary curves. In: Paterson, K. (ed.) Advances in Cryptology – EUROCRYPT 2011, Lecture Notes in Computer Science, vol. 6632, pp. 48–68. Springer Berlin Heidelberg (2011)
- [3] Azarderakhsh, R., Fishbein, D., Grewal, G., Hu, S., Jao, D., Longa, P., Verma, R.: Fast software implementations of bilinear pairings. IEEE Transactions on Dependable and Secure Computing 14(6), 605–619 (2017)
- [4] Barbulescu, R., Duquesne, S.: Updating key size estimations for pairings. Journal of Cryptology 32(1), 1–39 (2018)
- [5] Blake, I.F., Seroussi, G., Smart, N.P.: Advances in elliptic curve cryptography. Cambridge University Press (2005)
- [6] Chen, B.L., Hu, C.Q., Zhao, C.A.: A note on scalar multiplication using division polynomials. IET Information Security 11(4), 195–198 (2017)
- [7] Chen, B.L., Zhao, C.A.: An improvement of the elliptic net algorithm. IEEE Transactions on Computers 65, 2903–2909 (2015)
- [8] Chiesa, A., Hu, Y., Maller, M., Mishra, P., Vesely, N., Ward, N.: Marlin: Preprocessing zksnarks with universal and updatable srs. In: Canteaut, A., Ishai, Y. (eds.) Advances in Cryptology – EUROCRYPT 2020. pp. 738–768. Springer International Publishing, Cham (2020)
- [9] Costello, C., Lange, T., Naehrig, M.: Faster pairing computations on curves with high-degree twists. In: International Conference on Practice Theory in Public Key Cryptography (2010)
- [10] Einsiedler, M., Everest, G., Ward, T.: Primes in elliptic divisibility sequences. LMS Journal of Computation and Mathematics 4, 1–13 (2001)
- [11] Galbraith, S.D., Lin, X., Scott, M.: Endomorphisms for faster elliptic curve cryptography on a large class of curves. J. Cryptology 24, 446–469 (2011)
- [12] Granger, R., Hess, F., Oyono, R., Theriault, N., Vercauteren, F.: Ate pairing on hyperelliptic curves. In: Naor, M. (ed.) Advances in Cryptology - EUROCRYPT 2007, Lecture Notes in Computer Science, vol. 4515, pp. 430–447. Springer Berlin / Heidelberg (2007)
- [13] Granger, R., Scott, M.: Faster ecc over . In: Katz, J. (ed.) Public-Key Cryptography – PKC 2015. pp. 539–553. Springer Berlin Heidelberg, Berlin, Heidelberg (2015)
- [14] Groth, J.: On the size of pairing-based non-interactive arguments. In: Fischlin, M., Coron, J.S. (eds.) Advances in Cryptology – EUROCRYPT 2016. pp. 305–326. Springer Berlin Heidelberg, Berlin, Heidelberg (2016)
- [15] H. Silverman, J.: The Arithmetic of Elliptic Curves, vol. 106 (2009)
- [16] Hankerson, D., Menezes, A.: NIST Elliptic Curves, pp. 843–844. Springer US, Boston, MA (2011)
- [17] Hess, F., Smart, N., Vercauteren, F.: The eta pairing revisited. IEEE Transactions on Information Theory 52, 4595–4602 (2006)
- [18] Kanayama, N., Liu, Y., Okamoto, E., Saito, K., Teruya, T., Uchiyama, S.: Implementation of an elliptic curve scalar multiplication method using division polynomials. IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences E97.A(1), 300–302 (2014)
- [19] Lee, E., Lee, H.S., Park, C.M.: Efficient and generalized pairing computation on abelian varieties. IEEE Transactions on Information Theory 55(4), 1793–1803 (2009)
- [20] Lim, C.H., Hwang, H.S.: Fast implementation of elliptic curve arithmetic in (). public key cryptography pp. 405–421 (2000)
- [21] Matsuda, S., Kanayama, N., Hess, F., Okamoto, E.: Optimised versions of the ate and twisted ate pairings. In: Ima International Conference on Cryptography & Coding (2007)
- [22] Miller, V., et al.: Short programs for functions on curves. Unpublished manuscript 97(101-102), 44 (1986)
- [23] Miller, V.S.: The weil pairing, and its efficient calculation. J. Cryptology 17(4), 235–261 (2004)
- [24] Montgomery, P.L.: Modular multiplication without trial division. Mathematics of Computation 44(170), 519–521 (1985)
- [25] Mrabet, N.E., Joye., M.: Guide to Pairing-Based Cryptography. Chapman HallCRC Cryptography and Network Security Series. CRC Press (01 2017)
- [26] Naehrig, M., Renes, J.: Dual isogenies and their application to public-key compression for isogeny-based cryptography. In: Galbraith, S.D., Moriai, S. (eds.) Advances in Cryptology – ASIACRYPT 2019. pp. 243–272. Springer International Publishing, Cham (2019)
- [27] Ogura, N., Kanayama, N., Uchiyama, S., Okamoto, E.: Cryptographic pairings based on elliptic nets. In: Iwata, T., Nishigaki, M. (eds.) Advances in Information and Computer Security. pp. 65–78. Springer Berlin Heidelberg, Berlin, Heidelberg (2011)
- [28] Onuki, H., Teruya, T., Kanayama, N., Uchiyama, S.: Faster Explicit Formulae for Computing Pairings via Elliptic Nets and Their Parallel Computation (2016)
- [29] Scott, M., Costigan, N., Abdulwahab, W.: Implementing cryptographic pairings on smartcards pp. 134–147 (2006)
- [30] Shipsey, R.: Elliptic divisibility sequences. Goldsmiths College (2000)
- [31] Stange, K.E.: The tate pairing via elliptic nets. In: Takagi, T., Okamoto, T., Okamoto, E., Okamoto, T. (eds.) Pairing-Based Cryptography - Pairing 2007, Lecture Notes in Computer Science, vol. 4575, pp. 329–348. Springer Berlin Heidelberg (2007)
- [32] SubramanyaRao, S., Hu, Z., Zhao, C.A.: Division polynomial-based elliptic curve scalar multiplication revisited. IET Information Security 13(6), 614–617 (2019)
- [33] Tang, C., Ni, D., Xu, M., Guo, B., Qi, Y.: Implementing optimized pairings with elliptic nets. Science China Information Sciences 57(5), 1–10 (2014)
- [34] Vercauteren, F.: Optimal pairings. IEEE Transactions on Information Theory 56(1), 455–461 (2009)
- [35] Ward, M.: Memoir on elliptic divisibility sequences. American Journal of Mathematics 70(1), 31 (1948)
- [36] Washington, L.C.: Elliptic Curves Number Theory and Cryptography. Elsevier Science Publishers B. V. (2008)
- [37] Zhao, C.A., Zhang, F.G., Huang, J.W.: All pairings are in a group. IEICE Transactions 91-A(10), 3084–3087 (2008)
- [38] Zhao, C.A., Zhang, F.G., Huang, J.W.: A note on the ate pairing. Int. J. Inf. Sec 7(6), 379–382 (2008)
Appendix 0.A Algorithm in This Work
Algorithm 2 Double-and-Add Algorithm with Lazy Reduction (Eliminate Inversion)