Abstract

Pollard's rho method and its parallelized variant are at present known as the best generic algorithms for computing discrete logarithms. However, when we compute discrete logarithms in cyclic groups of large orders using Pollard's rho method, collision detection is always a high time and space consumer. In this paper, we present a new efficient collision detection algorithm for Pollard's rho method. The new algorithm is more efficient than the previous distinguished point method and can be easily adapted to other applications. However, the new algorithm does not work with the parallelized rho method, but it can be parallelized with Pollard's lambda method. Besides the theoretical analysis, we also compare the performances of the new algorithm with the distinguished point method in experiments with elliptic curve groups. The experiments show that the new algorithm can reduce the expected number of iterations before reaching a match from 1.309√|𝐺| to 1.295√|𝐺| under the same space requirements for the single rho method.

1. Introduction

One of the most important assumptions in modern cryptography is the hardness of the discrete logarithm problem (DLP). Many popular cryptosystems base their security on DLP. Such cryptosystems are, for example, the Diffie-Hellman key agreement protocol [1], the ElGamal signature and encryption schemes [2], the US Government Digital Signature Algorithm (DSA) [3], and the Schnorr signature scheme [4]. Originally, they worked with multiplicative groups of finite prime fields. Once elliptic curve cryptosystems were proposed by Koblitz [5] and Miller [6], analogous practical systems based on the DLP in groups of points of elliptic curves over finite fields were designed [7]. Recall the following two definitions.

Definition 1.1 (discrete logarithm problem, DLP). Let 𝐺 be a cyclic group of prime order 𝑝, and let π‘”βˆˆπΊ be generator of 𝐺. Given 𝑔,β„ŽβˆˆπΊ, determine the integer 0β‰€π‘˜<𝑝 such that β„Ž=π‘”π‘˜.

Definition 1.2 (elliptic curve discrete logarithm problem, ECDLP). Let 𝐸 be an elliptic curve defined over finite field π”½π‘ž. Let π‘ƒβˆˆπΈ be a point of prime order 𝑛, and let 𝐺 be the subgroup of 𝐸 generated by 𝑃. Given π‘„βˆˆπΊ, determine the integer 0β‰€π‘˜<𝑛 such that 𝑄=π‘˜π‘ƒ.

For DLP on a multiplicative subgroup 𝐺 of prime order 𝑝 of finite field π”½π‘ž, the index calculus method determines the size of π‘ž, which is a subexponential time algorithm, while the size of 𝑝 is set by Pollard's rho method [8].

Furthermore, for ECDLP, Pollard's rho method and its modifications by Gallant et al. [9] and Wiener and Zuccherato [10] are to date known as the most efficient general algorithms. van Oorschot and Wiener [11] showed that the modified Pollard's rho method can be parallelized with linear speedup.

Pollard's rho method is a randomized algorithm for computing discrete logarithms. Generally, an iteration function πΉβˆΆπΊβ†’πΊ is used to define a pseudorandom sequence π‘Œπ‘– by π‘Œπ‘–+1=𝐹(π‘Œπ‘–) for 𝑖=0,1,2,…, with some initial value π‘Œ0. The sequence π‘Œ0,π‘Œ1,π‘Œ2,… represents a walk in the group 𝐺. The basic assumption is that the walk π‘Œπ‘– behaves as a random walk. Because the order of the group is finite, the sequence will ultimately reach an element that has occurred before. This is called a collision or a match. The advantage of this method is that the space requirements are small if one uses a clever method of detecting a collision. The problem of efficient collision detection of a pseudo-random walk in Pollard's rho method is the central topic of this paper.

There are several collision detection algorithms for a random walk in the group 𝐺. These algorithms in general do not exploit the group structure of 𝐺. As a result, the algorithms discussed in this paper in fact apply to any set 𝐺 on which an iterated function 𝐹 is used to make random walks, and their utilization goes beyond discrete logarithm computation.

A simple approach to detecting a collision with Pollard's rho method is to use Floyd's cycle-finding algorithm [8], which shows that it suffices to compare π‘Œπ‘– and π‘Œ2𝑖 for all 𝑖 to find a collision. Floyd's algorithm uses only a small constant amount of storage, but needs roughly three times more work than is necessary. Brent [12] improved this approach by using an auxiliary variable. Nivasch designed an algorithm [13] for detecting periodicity in sequences using a single pointer and a small stack. This stack algorithm halts at a uniformly random point in the second loop through the sequence's cycle.

In finding DES collisions [14, 15], Quisquater and Delescaille took a different approach based on storing distinguished points, an idea noted earlier by Rivest to reduce the search time in Hellman time-memory tradeoff [16]. A distinguished point is one that has some easily checked property such as having a fixed number of leading zero bits. During the pseudo-random walk, points that satisfy the distinguishing property are stored. Collision can be detected when a distinguished point is encountered a second time. This technique can be efficiently applied to find collisions among multiple processors [11].

In this paper, we describe a new efficient collision detection algorithm for computing discrete logarithm with Pollard's rho method. It is a probabilistic algorithm and more efficient than the previous methods. With this algorithm, we can significantly reduce the space requirements and provide a better time-space trade-off approach. We also compare their performances in experiments with elliptic curve groups, and our experimental results confirmed the theoretical analysis.

The remainder of this paper is organized as follows. In Section 2, we recall Pollard's rho method for discrete logarithm computation and discuss several previous methods for collision detection. We describe and analyze the new algorithm in Section 3 and discuss its applications in Section 4. We present our experiments in Section 5 and conclude the paper in Section 6.

2. Preliminary

In this section, we describe Pollard's rho method for discrete logarithm computation and then discuss several collision detection algorithms and their performances.

2.1. Pollard's Rho Method

Pollard [8] proposed an elegant algorithm for the discrete logarithms based on a Monte Carlo idea and called it the rho method. The rho method works by first defining a sequence of elements that will be periodically recurrent, then looking for a match in the sequence. The match will lead to a solution of the discrete logarithm problem with high probability. The two key ideas involved are the iteration function for generating the sequence and the cycle-finding algorithm for detecting a match.

If 𝐷 is any finite set and πΉβˆΆπ·β†’π· is a mapping and the sequence (𝑋𝑖) in 𝐷 is defined by the rule: 𝑋0∈𝐷,𝑋𝑖+1𝑋=𝐹𝑖,(2.1) this sequence is ultimately periodic. Hence, there exist unique integers πœ‡β‰₯0 and πœ†β‰₯1 such that 𝑋0,…,π‘‹πœ‡+πœ†βˆ’1 are all distinct, but 𝑋𝑖=𝑋𝑖+πœ† for all 𝑖β‰₯πœ‡. A pair (𝑋𝑖,𝑋𝑗) of two elements of the sequence is called a match if 𝑋𝑖=𝑋𝑗 where, 𝑖≠𝑗. For the expected values of πœ‡ and πœ†, we have the following theorem.

Theorem 2.1 (see [17]). Under the assumption that an iteration function πΉβˆΆπ·β†’π· behaves like a truly random mapping and the initial value 𝑋0 is a randomly chosen group element, the expected values for πœ‡ and πœ† are βˆšπœ‹|𝐷|/8. The expected number of evaluations before a match appears is √𝐸(πœ‡+πœ†)=βˆšπœ‹|𝐷|/2β‰ˆ1.25|𝐷|.

Now we explain how the rho method for computing discrete logarithms works. Let 𝐺 be a cyclic group of prime order 𝑝, and let π‘”βˆˆπΊ be generator of 𝐺 and β„ŽβˆˆπΊ. The discrete logarithm problem is to compute π‘₯ satisfying 𝑔π‘₯β‰‘β„Ž. Pollard defined the iteration function πΉβˆΆπΊβ†’πΊ as follows: ⎧βŽͺ⎨βŽͺ⎩𝐹(π‘Œ)=π‘”β‹…π‘Œπ‘Œβˆˆπ‘†1,π‘Œ2π‘Œβˆˆπ‘†2,β„Žβ‹…π‘Œπ‘Œβˆˆπ‘†3.(2.2)

Let the initial value π‘Œ0=1. In each iteration of π‘Œπ‘–+1=𝐹(π‘Œπ‘–), the function uses one of three rules depending on the value of π‘Œπ‘–. The group 𝐺 is partitioned into three subsets 𝑆1, 𝑆2, 𝑆3 of roughly equal size. Each π‘Œπ‘– has the form π‘”π‘Žπ‘–β„Žπ‘π‘–. The sequence (π‘Žπ‘–) (and similarly for (𝑏𝑖)) can be computed as follows: π‘Žπ‘–+1=⎧βŽͺ⎨βŽͺβŽ©π‘Žπ‘–+1(mod𝑝)π‘Œiβˆˆπ‘†1,2π‘Žπ‘–(mod𝑝)π‘Œπ‘–βˆˆπ‘†2,π‘Žπ‘–π‘Œ(mod𝑝)iβˆˆπ‘†3.(2.3)

As soon as we have a match (π‘Œπ‘–,π‘Œπ‘—), we have the equation π‘”π‘Žπ‘–βˆ—β„Žπ‘π‘–=π‘”π‘Žπ‘—βˆ—β„Žπ‘π‘—.

Since β„Ž=𝑔π‘₯, this gives π‘Žπ‘–+𝑏𝑖π‘₯β‰‘π‘Žπ‘—+𝑏𝑗π‘₯mod𝑝.(2.4) Now, if gcd(π‘π‘–βˆ’π‘π‘—,𝑝)=1, we get that π‘₯=(π‘Žπ‘—βˆ’π‘Žπ‘–)(π‘π‘–βˆ’π‘π‘—)βˆ’1mod𝑝. Due to the method of Pohlig and Hellman [18], in practice applications the group order 𝑝 is prime, so that it is very unlikely that gcd(π‘π‘–βˆ’π‘π‘—,𝑝)>1 if 𝑝 is large.

Theorem 2.1 makes the assumption of true randomness. However, it has been shown empirically that this assumption does not hold exactly for Pollard's iteration function [19]. The actual performance is worse than the expected value given in Theorem 2.1.

Teske [19] proposed better iteration functions by applying more arbitrary multipliers. Assume that we are using π‘Ÿ partitions (multipliers). We generate 2π‘Ÿ random numbers,π‘šπ‘–,π‘›π‘–βˆˆπ‘…{0,1,…,π‘βˆ’1},for𝑖=1,2,…,π‘Ÿ.(2.5) Then we precompute π‘Ÿ multipliers 𝑀1,𝑀2,…,π‘€π‘Ÿ, where 𝑀𝑖=π‘”π‘šπ‘–β‹…β„Žπ‘›π‘–, for 𝑖=1,2,…,π‘Ÿ. Define a hash function, π‘£βˆΆπΊβŸΆ{1,2,…,π‘Ÿ}.(2.6) Then the iteration function πΉβˆΆπΊβ†’πΊ defined as 𝐹(π‘Œ)=π‘Œβ‹…π‘€π‘£(π‘Œ),where𝑣(π‘Œ)∈{1,2,…,π‘Ÿ}.(2.7) The indices are update by π‘Žπ‘–+1=π‘Žπ‘–+π‘šπ‘£(π‘Œπ‘–),𝑏𝑖+1=𝑏𝑖+𝑛𝑣(π‘Œπ‘–).(2.8)

The difference in performance between Pollard's original walk and Teske’s π‘Ÿ-adding walk has been studied in [19, 20]. We summarize the results as follows. In prime order subgroups of β„€βˆ—π‘, the value of 𝐸(πœ‡+πœ†) for Pollard's original walk and Teske's π‘Ÿ-adding walk is √1.55|𝐺| and √1.27|𝐺|, while in groups of points of elliptic curves over finite fields, the value is √1.60|𝐺| and √1.29|𝐺|, respectively.

2.2. Previous Methods for Collision Detection

To find the collision in the pseudo-random walk, it always needs much storage. In order to minimize the storage requirements, a collision detection algorithm can be applied with a small penalty in the running time.

Floyd's Cycle-Finding Algorithm
In Pollard's paper, Floyd's algorithm is applied. To find π‘Œπ‘–=π‘Œπ‘—, the algorithm calculates (π‘Œπ‘–,π‘Žπ‘–,𝑏𝑖,π‘Œ2𝑖,π‘Ž2𝑖,𝑏2𝑖) until π‘Œπ‘–=π‘Œ2𝑖. For each iteration, we compute π‘Œπ‘–+1=𝐹(π‘Œπ‘–) and π‘Œ2(𝑖+1)=𝐹(𝐹(π‘Œ2𝑖)), which means that this algorithm requires negligible storage. Floyd's algorithm is based on the following idea.

Theorem 2.2 (see [25]). For a periodic sequence π‘Œ0,π‘Œ1,π‘Œ2,…, there exists an 𝑖>0 such that π‘Œπ‘–=π‘Œ2𝑖 and the smallest such 𝑖 lies in the range πœ‡β‰€π‘–β‰€πœ‡+πœ†.

The best running time requires πœ‡ iterations and the worst takes πœ‡+πœ† iterations. Under the assumption that πΉβˆΆπΊβ†’πΊ behaves like a truly random mapping, the expected number of iterations before reaching a match is βˆšπœ‹5√|𝐺|/288β‰ˆ1.03|𝐺| [20]. The key point for this algorithm is that we need three group operations and one comparison for each iteration, which makes it inefficient.

Brent's Algorithm
Brent proposed an algorithm [12] which is generally 25% faster than Floyd's method. It uses an auxiliary variable, say 𝑀, which at each stage of the algorithm holds π‘Œπ‘™(𝑖)βˆ’1, where 𝑙(𝑖)=2⌊logπ‘–βŒ‹. 𝑀 is compared with π‘Œπ‘– for each iteration and is updated by 𝑀=π‘Œπ‘– when 𝑖=2π‘˜βˆ’1 for π‘˜=1,2,…. The correctness of this algorithm depends on the following fact.

Theorem 2.3 (see [20]). For a periodic sequence π‘Œ0,π‘Œ1,π‘Œ2,…, there exists an 𝑖>0 such that π‘Œπ‘–=π‘Œπ‘™(𝑖)βˆ’1 and 𝑙(𝑖)≀𝑖<2𝑙(𝑖). The smallest such 𝑖 is 2⌈logmax(πœ‡+1,πœ†)βŒ‰+πœ†βˆ’1.

Under the assumption that πΉβˆΆπΊβ†’πΊ is a random mapping, with Brent's algorithm the first match is expected to occur after √1.98|𝐺| iterations [12]. The algorithm needs one group operation and one comparison for each iteration, which makes it 25%–30% faster than Floyd's algorithm. Variations of Brent's algorithm requiring slightly more storage and comparisons but less iterations can be found in [21, 22].

Stack Algorithm
In 2004, Nivasch proposed an interesting algorithm that uses logarithmic storage space and can be adapted with tradeoff for storage space versus speed. This algorithm requires that a total ordering < be defined on the set 𝐺, and it works as follows. Keep a stack of pairs (π‘Œπ‘–,𝑖), where, at all times, both the 𝑖's and the π‘Œπ‘–'s in the stack form strictly increasing sequences. The stack is initially empty. At each step 𝑗, pop from the stack all entries (π‘Œπ‘–,𝑖), where π‘Œπ‘–>π‘Œπ‘—. If a match π‘Œπ‘–=π‘Œπ‘— is found with an element in the stack, the algorithm terminates successfully. Otherwise, push (π‘Œπ‘—,𝑗) on top of the stack and continue. The stack algorithm depends on the following fact.

Theorem 2.4 (see [13]). The stack algorithm always halts on the smallest value of the sequence's cycle, at some time in [πœ‡+πœ†,πœ‡+2πœ†).

Under the assumption that πΉβˆΆπΊβ†’πΊ is a random mapping, the expected number of iterations before finding a match is √5/2βˆšπœ‹|𝐺|/8β‰ˆ1.57|𝐺| [13]. The algorithm needs a little bit more than one group operation and one comparison for each iteration. Under the same assumption, Nivasch proves also that the expected size of the stack is ln β„Ž+𝑂(1). Therefore, the algorithm only requires a logarithmic amount of memory.

Distinguished Point
The idea of the distinguished point method is to search for a match not among all terms of the sequence, but only among a small subset of terms that satisfy a certain distinguishing property. It works as follows. One defines a set 𝐷, a subset of 𝐺, that consists of all group elements that satisfy a certain distinguishing property. During the pseudo-random walk, points that satisfy the distinguishing property are stored. Collision can be detected when a distinguished point is encountered a second time.
Currently, the distinguished point method is the most efficient algorithm to detect collisions in pseudo-random walk when |𝐺| is large. A popular way of defining 𝐷 is to fix an integer π‘˜ and to define that π‘€βˆˆπ· if and only if the π‘˜ least significant bits in the representation of 𝑀 as a binary string are zero. To break ECC2K-130, it [23] defines the distinguishing property as the Hamming weight of normal-basis representation of π‘₯-coordinate of the point less than or equal to 34. Notice that this kind of definitions allows a fast check for the distinguishing property to hold, and the size of 𝐷 can be easily monitored as well. Obviously, we have the following theorem.

Theorem 2.5 (see [11]). Let πœƒ be the proportion of points in 𝐺 which satisfy the distinguishing property, that is, πœƒ=|𝐷|/|𝐺|. Under the assumption that πΉβˆΆπΊβ†’πΊ is a random mapping and 𝐷 is a uniform distribution in 𝐺, the expected number of iterations before finding a match is βˆšπœ‹|𝐺|/2+1/πœƒ.

3. The New Algorithm

We are motivated by the fact that, in distinguished point method, the distinguished points may be not uniformly distributed in the pseudo-random walk, also the points in subset 𝐷 may be not uniformly distributed in 𝐺, which always results in more iteration requirements. We are trying to design an algorithm which leads to a uniform distribution and also to provide a better way for time-space tradeoff rather than distinguishing property.

3.1. The Basic Algorithm

To find a collision in pseudo-random walk, which is produced by the iteration function πΉβˆΆπΊβ†’πΊ, assuming 𝐹 is a random mapping on 𝐺, our basic algorithm works as follows. We fix an integer 𝑁 and use an auxiliary variable, say 𝑀, which at each 𝑁 iterations keep the minimum value of 𝑁 successive values produced by the iteration function 𝐹. Once getting the minimum value 𝑀 from 𝑁 successive values, we check whether this value has occurred before in the stored sequence, if so, we find the match and we are done. Otherwise, store this value 𝑀 to the sequence. Then continue to compute the next 𝑁 new values and repeat the previous procedures. Choose the integer 𝑁 properly, we will find the match among the newly generated minimum value and stored minimum values.

More precisely, to find a collision in pseudo-random sequence π‘Œ0,π‘Œ1,π‘Œ2,…, which is produced by the iteration function πΉβˆΆπΊβ†’πΊ, we have Algorithm 1.

Input: Initial value π‘Œ 0 , iteration function 𝐹 ∢ 𝐺 β†’ 𝐺 , fixed integer 𝑁
Output: π‘š and 𝑛 , such that π‘Œ π‘š = π‘Œ 𝑛
(1) 𝑀 ← π‘Œ 0 , π‘š ← 0 , 𝑛 ← 0
(2) for 𝑖 = 1 to ⌈ | 𝐺 | / 𝑁 βŒ‰   do
(3)  for 𝑗 = ( 𝑖 βˆ’ 1 ) 𝑁 + 1 to 𝑖 𝑁 βˆ’ 1   do
(4)    π‘Œ 𝑗 ← 𝐹 ( π‘Œ 𝑗 βˆ’ 1 )
(5)   if π‘Œ 𝑗 < 𝑀 then
(6)     𝑀 ← π‘Œ 𝑗 , 𝑛 ← 𝑗
(7)   else if π‘Œ 𝑗 = 𝑀   then
(8)     π‘š ← 𝑗
(9)    return   π‘š , 𝑛
(10)    end if
(11)   end for
(12)
(13)   for π‘˜ = 1 to 𝑖 βˆ’ 1   do
(14)     if 𝑒 π‘˜ = 𝑀   then
(15)      π‘š ← 𝑣 π‘˜
(16)     return   π‘š , 𝑛
(17)     end if
(18)    end for
(19)    𝑒 𝑖 ← 𝑀 , 𝑣 𝑖 ← 𝑛
(20)    𝑀 ← 𝐹 ( π‘Œ 𝑖 𝑁 βˆ’ 1 ) , 𝑛 ← 𝑖 𝑁
(21) end for

It is obvious that the algorithm can be considered as two parts. In the first part, that is from step (3) to step (11), we seek the minimum value 𝑀 from 𝑁 successive values in the pseudo-random walk. The operation is very simple; if the current value π‘Œπ‘— is smaller than 𝑀, then just update 𝑀 with the current value and continue the next iteration. Notice that steps (7), (8), and (9) can be omitted, since it is unlikely that there is a match within 𝑁 iterations. Even if it happened, the algorithm ensures that we can find a match within the next 𝑁 iterations. As a result, there is only one group operation and one comparison in the first part, which consist the main operations of the algorithm.

In the second part, that is from step (13) to step (19), once we get a minimum value 𝑀, we check whether 𝑀 has appeared before in the previous stored values (π‘’π‘˜), which is empty at the beginning. If this is the case, the algorithm will return the corresponding indices and we are done. Otherwise, save the value 𝑀 to the sequence (π‘’π‘˜) of the minimum values, and the second part is finished, continue the next 𝑁 iterations. It is clear that the second part can be speeded up by using a hash table. And, more important, the second part can be independent to the first part, which means the stored sequence of minimum values can be off line; that is, the first part is response for generating minimum values along the random walk, while the second part searches the collision among stored minimum values independently.

3.2. Analysis

For further analysis of the algorithm, we assume that the iteration function πΉβˆΆπΊβ†’πΊ behaves like a truly random mapping. According to Theorem 2.1, the expected number of iterations before reaching a match is βˆšπœ‹|𝐺|/2. Let us look at some simple cases for the new algorithm. For 𝑁=1, which means we store all the values in the sequence before reaching a match, and the match can be found once it appears. For 𝑁=2, we need to store half of the values in the sequence before reaching a match, and always the match can be found once it appears. Obviously, the bigger the integer 𝑁, the less values we need to store. As a result, with the integer 𝑁 increasing, there is a probability that we cannot detect the collision immediately when it happens. So, the new algorithm is a probabilistic algorithm. However, with high probability, the algorithm will halt close to the beginning of the second loop. More precisely, we have the following theorem.

Theorem 3.1. Under the assumption that an iteration function πΉβˆΆπΊβ†’πΊ behaves like a truly random mapping and the initial value π‘Œ0 is a randomly chosen group element, for Algorithm 1, the expected number of iterations before finding a match is βˆšπœ‹|𝐺|/2+(π‘˜+1/2)𝑁 with probability 1βˆ’(2/3)(π‘˜βˆ’1)/2, where π‘˜=0,1,2,….

Proof. Let 𝐼𝑖 be the set that consists of the 𝑖th 𝑁 successive values generated by iteration function 𝐹; that is, 𝐼𝑖=ξ€½π‘Œπ‘—ξ€Ύξ›||𝐺||ξœβˆ£π‘–π‘β‰€π‘—β‰€(𝑖+1)π‘βˆ’1,𝑗β‰₯0,for𝑖=0,1,2,…,/π‘βˆ’1.(3.1) For finite group 𝐺, the sequence produced by 𝐹 is eventually period; that is, for any fixed 𝐹 and π‘Œ0, there exist certain integers π‘š and 𝑛, such that πΌπ‘šξ™πΌπ‘›πΌβ‰ βˆ…,π‘š<𝑛,𝑖𝐼𝑗=βˆ…,for0≀𝑖,𝑗<𝑛,𝑖≠𝑗,(3.2) and also πΌπ‘š+𝑖𝐼𝑛+π‘–β‰ βˆ…,for𝑖β‰₯0.(3.3)
To prove the theorem, we divide it into two cases, that is, π‘˜=0 and π‘˜=1,2,…. For π‘˜=0, let minπ‘š and min𝑛 be the minimum values of πΌπ‘š and 𝐼𝑛, thenξ‚΅Prminπ‘š=min𝑛=1π‘π‘βˆ’1𝑖=0ξ‚€1𝑁+2𝑁+β‹―+π‘βˆ’π‘–π‘ξ‚1=π‘π‘βˆ’π‘–2+3𝑁+34𝑁2β‰ˆ14,(3.4) that is, the probability of successfully detecting the collision within the first two intersection sets is 1/4.
For each of π‘˜=1,2,…, we notice that, for two (intersected) sets 𝐼𝑖 and 𝐼𝑗, let min𝑖 and min𝑗 be the minimum values of 𝐼𝑖 and 𝐼𝑗, respectively, we have ξ‚΅Prmin𝑖=min𝑗=||𝐼𝑖⋂𝐼𝑗||2𝑁2||𝐼,where𝑖𝐼𝑗||denotesthecardinalityof𝐼𝑖𝐼𝑗.(3.5) Therefore, we have ξ‚΅Prminπ‘š+π‘˜=min𝑛+π‘˜ξ‚Ά=1𝑁1𝑁2+22𝑁2+β‹―+(π‘βˆ’1)2𝑁2ξ‚Ά=2𝑁2βˆ’3𝑁+16𝑁2β‰ˆ13.(3.6) Under the assumption that the iteration function πΉβˆΆπΊβ†’πΊ is a random mapping, according to Theorem 2.1, the expected number of evaluations before a match appears is βˆšπœ‹|𝐷|/2. Combining the above two cases, using Algorithm 1, the expected number of iterations before reaching a match among minimum values is βˆšπœ‹|𝐺|/2+(π‘˜+1/2)𝑁 with probability 1βˆ’(2/3)(π‘˜βˆ’1)/2, where π‘˜=0,1,2,….

Remark 3.2. According to the above theorem, we need to store βˆšπœ‹|𝐺|/2/𝑁+π‘˜ terms to find the match with the probability 1βˆ’(2/3)(π‘˜βˆ’1)/2, where π‘˜ can be 0,1,2,…; that is, by setting parameter 𝑁, we can balance the expected number of iterations and the expected space requirements. Therefore, Algorithm 1 is a time-space trade-off algorithm.

Remark 3.3. Algorithm 1 is a probabilistic algorithm. There is a probability that we cannot detect the collision immediately when it happens. However, with high probability, the algorithm will halt close to the beginning of the second loop. For example, the probability of successfully detecting the collision 1βˆ’(2/3)(π‘˜βˆ’1)/2 is 0.90 with π‘˜=5.

Notice that, compared to the distinguished point method, the new algorithm has two advantages. First, the distinguished point method depends on the assumption that the distinguished points are uniformly distributed in the pseudo-random walk, and also the points in subset 𝐷 are uniformly distributed in 𝐺. However, in practice this may not be the case, which generally results in more iterations requirement, while, for the new algorithm, each stored minimum value represents 𝑁 successive values and the performance of the new algorithm independent of such assumption. Because the distinguished point method is currently the most efficient algorithm, we compare the actual performances of the new algorithm with the distinguished point method under the same expected storage requirement in experiments with elliptic curve groups in Section 5.

Second, using distinguished point method, it is possible for a random walk to fall into a loop which contains no distinguished point [11]. Then, the processor cannot find new distinguished point any more on the path. Left undetected, the processor would cease to contribute to the collision search. In this case, we can restart the random walk by choosing a different initial point. However, those points calculated by previous walk do not help for the collision search, while the new algorithm can avoid such problem, because it can always find the collision among minimum values whenever it falls into a loop.

4. Applications

The new algorithm can be combined with other algorithms, such as Pollard's lambda method, and can be adapted to a wide range of problems which can be reduced to finding collisions, such as in Pollard's rho method for factorization [24] and in studying the behavior of random number generators [25]. In this section, we will address some of these issues.

4.1. Pollard's Lambda Method

It is clear that the new algorithm can be applied to Pollard's lambda method (also called the kangaroo method). The lambda method computes a discrete logarithm in an arbitrary cyclic group, given that the value is known to lie in a certain interval, that is, β„Ž=π‘”π‘˜, where π‘˜βˆˆ[π‘Ž,𝑏] but unknown.

Generally, we have two kangaroos, one tame and one wild. Their positions are represented by group elements, the tame kangaroo 𝑇 with starting point 𝑑0=π‘”βŒŠ(π‘Ž+𝑏)/2βŒ‹ and the wild kangaroo π‘Š with starting point 𝑀0=β„Ž, and they travel in the cyclic group 𝐺=βŸ¨π‘”βŸ©. In terms of the exponents of 𝑔, 𝑇 starts at the middle of the interval [π‘Ž,𝑏], while π‘Š starts at π‘₯. Since we do not know π‘˜, we do not know the exact location of the wild kangaroo, and that is why it is called wild. The two kangaroos produce two different pseudo-random walks with the same walking rules. It is obvious that, at all times, the point of tame kangaroo has the form 𝑔𝑖 and the point of wild kangaroo has the form β„Žβˆ—π‘”π‘— for some known integers 𝑖 and 𝑗. The purpose is to provoke a collision between the tame and the wild kangaroos, from which we can deduce the wild kangaroo's starting point, that is, π‘˜=(π‘–βˆ’π‘—)mod|𝐺|.

Similar to the case of Pollard's rho method, the new algorithm can be applied in this case to efficiently detect the collision. The advantage of the new algorithm is that we can achieve uniform distributions of minimum values in the pseudo-random walks both for the tame kangaroos and the wild kangaroos. The different performances of the new algorithm and distinguished point method in this case can refer to the case of Pollard's rho method.

4.2. Parallelization

As we have mentioned above, during the random walk, finding the minimum value from 𝑁 iterations and comparing the minimum value 𝑀 to all previously stored values can be separated. This feature makes the new algorithm suit for distributed computation.

However, Pollard's rho method is inherently serial in nature; one must wait for the current iteration of the function 𝐹 to complete before the next can begin. Each value in the sequence totally depends on the previous value and the iteration rules. In discussing the rho method for factorization, Brent considered running many processors in parallel each producing an independent sequence and noted that β€œUnfortunately, parallel implementation of the β€œrho” method does not give linear speedup” [26]. Analogous comments apply to the rho method for computing logarithms and the generalized rho method for collision search. Notice that here each parallel processor is producing its own sequence of points independently of the others and each particular processor does not increase the probability of success of any other processor. For the corresponding picture, with high probability, each processor draws a different β€œrho” that never intersect with each other. There is a little chance that different processors may intersect with each other.

van Oorschot and Wiener [11] showed that the expected speedup of the direct parallelization of Pollard's rho method, using π‘š processors, is only a factor of βˆšπ‘š. This is a very inefficient use of parallelization. They provided a modified version of Pollard's rho method and claimed that it can be linearly parallelized with the distinguished point method; that is, the expected running time of the modified version, using π‘š processors, is roughly βˆšπœ‹|𝐺|/2/π‘š group operations.

In the modified version, to perform a parallel collision search each processor proceeds as follows. Select a random starting point π‘Œ0∈𝐺, and produce the trail of points π‘Œπ‘–+1=𝐹(π‘Œπ‘–), for 𝑖=0,1,2,…, until a distinguished point π‘Œπ‘‘ is reached based on some easily testable distinguished property. Store distinguished point, and start producing a new trail from a new random starting point. Unfortunately, the new algorithm is not efficient for the parallelized modified version of Pollard's rho method. The key point is that there is a probability that the new algorithm fails to detect the collision while it actually happened, which cannot be efficiently solved like the serial version.

However, for Pollard's lambda method, the new algorithm can be efficiently parallelized with linear speedup. We present here a modified version of parallelized Pollard's lambda method from [11]. Assume we have π‘š processors with π‘š even. Then, instead of one tame and one wild kangaroo, we work with two herds of kangaroos, one herd of π‘š/2 tame kangaroos and one herd of π‘š/2 wild kangaroos, with one kangaroo on each processor. Each kangaroo starts from a different point, stores a minimum value every 𝑁 iterations, just like the serial version. A center server collects all the minimums, and tries to find a collision between the tame kangaroo minimums and the wild kangaroo minimums By choosing a reasonable integer 𝑁, the new algorithm provides an optimal time-space trade-off method for collision detection.

5. Experiments

We implemented Pollard's rho method with elliptic curve groups over prime fields using SAGE [27], which is an open source computer algebra software. Obviously, such experiments can also be done for DLP on a multiplicative subgroup 𝐺 of finite field π”½π‘ž. We compared the different performances between distinguished point method and the new algorithm. In this section, we describe these experiments and analyse the results.

For our experiments, we briefly introduce the elliptic curve groups over prime fields and the notation we use in the following. Let π‘ž be a prime, and let π”½π‘ž denote the field β„€π‘ž of integers modulo π‘ž. Let π‘Ž,π‘βˆˆπ”½π‘ž such that 4π‘Ž3+27𝑏2β‰ 0. Then the elliptic curve πΈπ‘Ž,𝑏 over π”½π‘ž is defined through the equation πΈπ‘Ž,π‘βˆΆπ‘¦2=π‘₯3+π‘Žπ‘₯+𝑏.(5.1) The set of all solutions (π‘₯,𝑦)βˆˆπ”½π‘žΓ—π”½π‘ž of this equation, together with the element π’ͺ called the β€œpoint at infinity,” forms a finite abelian group which we denote by πΈπ‘Ž,𝑏(π”½π‘ž). Usually, this group is written additively. Let π‘ƒβˆˆπΈπ‘Ž,𝑏(π”½π‘ž) be a point of prime order 𝑛, and let 𝐺 denote the subgroup of 𝐸 generated by 𝑃. Given π‘„βˆˆπΊ, determine the integer 0β‰€π‘˜<𝑛 such that 𝑄=π‘˜π‘ƒ.

For the iteration function, we use Teske's π‘Ÿ-adding walk and set π‘Ÿ=20; that is, we divide the group 𝐺 into 20 subsets: 𝑆1,𝑆2,…,𝑆20. Define the iteration function as follows: πΉξ€·π‘š(π‘Œ)=π‘Œ+𝑖𝑃+𝑛𝑖𝑄forπ‘Œβˆˆπ‘†π‘–[],π‘–βˆˆ1,20,(5.2) where π‘šπ‘– and 𝑛𝑖 randomly chosen from [0,π‘›βˆ’1] and (π‘šπ‘–π‘ƒ+𝑛𝑖𝑄) can be precomputed for 𝑖=1,2,…,20. This means it only needs one group operation for each iteration.

Let π‘Š=(π‘₯,𝑦) be any point of 𝐺; we define the partition of 𝐺 into π‘Ÿ subsets 𝑆1,𝑆2,…,π‘†π‘Ÿ as follows. First we compute a rational approximation 𝐴 of the golden ratio (√5βˆ’1)/2, with a precision of 2+⌊log10(π‘žπ‘Ÿ)βŒ‹ decimal places. Let π‘’βˆ—[ξ‚»βˆΆπΊβŸΆ0,1),(π‘₯,𝑦)⟢𝐴π‘₯βˆ’βŒŠπ΄π‘₯βŒ‹ifπ‘Šβ‰ π’ͺ,0ifπ‘Š=π’ͺ,(5.3) where 𝐴π‘₯βˆ’βŒŠπ΄π‘₯βŒ‹ is the nonnegative fraction part of 𝐴π‘₯. Then let π‘’βˆΆπΊβŸΆ{1,2,…,π‘Ÿ},𝑒(π‘Š)=βŒŠπ‘’βˆ—π‘†(π‘Š)β‹…π‘ŸβŒ‹+1,𝑖={π‘ŠβˆˆπΊβˆΆπ‘’(π‘Š)=𝑖}.(5.4) This method is originally from Knuth's multiplicative hash function [28] and suggested by Teske [29]. From the theory of multiplicative hash functions, we know that, among all numbers between 0 and 1, choosing 𝐴 as a rational approximation of (√5βˆ’1)/2 with a sufficiently large precision leads to the most uniformly distributed hash values, even for nonrandom inputs.

The purpose of our experiments is to evaluate the expected numbers of steps until a match is found with different collision detection methods, that is, distinguished point method and the new algorithm, under the same expected space requirement. Generally, we randomly choose a big prime number π‘ž, where π‘ž is in certain range. Then we randomly choose the parameters π‘Ž and 𝑏, where π‘Ž,π‘βˆˆπ”½π‘ž, which determine the unique elliptic curve πΈπ‘Ž,𝑏 over π”½π‘ž. We will check whether the order of group πΈπ‘Ž,𝑏(π”½π‘ž) has large prime factor 𝑛 in certain range. If not, repeat the above procedures until we get a prime order subgroup 𝐺 of πΈπ‘Ž,𝑏(π”½π‘ž). Then we set the generator 𝑃 of 𝐺 and choose a random point 𝑄 of 𝐺. When using Pollard's rho method to compute this discrete logarithm, we count the number of steps we performed until a match is found with different collision detection methods on the same case. Then we determine the ratio 𝑅 of the number of steps and βˆšπ‘›. We repeat it a couple of times with the same 𝑃 but several randomly chosen 𝑄’s. Furthermore, for practical reasons, we do the above procedures with a couple of groups, where the group order 𝑝 is between 231 and 236. We have Algorithm 2.

Input: Iteration function 𝐹 ∢ 𝐺 β†’ 𝐺
Output: The average ratio √ ( n u m b e r o f s t e p s ) / 𝑛 ∢ 𝑅 𝑖 1 and 𝑅 𝑖 2 for distinguished point method and the new algorithm, respectively
(1) for 𝑖 = 3 1 to 36  do
(2)  for 𝑗 = 1 to 20  do
(3)   repeat
(4)    Choose a random prime number π‘ž ∈ [ 2 𝑖 + 1 , 2 𝑖 + 3 ]
(5)    Choose two random numbers π‘Ž , 𝑏 ∈ 𝔽 q, where 4 π‘Ž 3 + 2 7 𝑏 2 β‰  0
(6)    𝑛 ← the largest prime factor of # 𝐸 π‘Ž , 𝑏
(7)   until 2 𝑖 ≀ 𝑛 ≀ 2 𝑖 + 1
(8)   Choose a random point π‘Š ∈ 𝐸 π‘Ž , 𝑏 , where the order of π‘Š equal to # 𝐸 π‘Ž , 𝑏
(9)    𝑃 ← ( # 𝐸 π‘Ž , 𝑏 / 𝑛 ) βˆ— π‘Š (the generator of 𝐺 )
(10)   for 𝑙 = 1 to 3 2 0 0 / 2 𝑖 βˆ’ 3 1   do
(11)    Choose a random number 𝑐 ∈ [ 0 , 𝑛 βˆ’ 1 ] , 𝑄 ← 𝑐 βˆ— 𝑃
(12)    Choose a random point in 𝐺 be the initial point π‘Œ 0
(13)     π‘˜ ← 1
(14)    repeat
(15)      π‘Œ π‘˜ ← 𝐹 ( π‘Œ π‘˜ βˆ’ 1 )
(16)     Check whether the Hamming weight of π‘Œ π‘˜ less than certain value
(17)     Check whether the π‘₯ -coordinate of π‘Œ π‘˜ is a minimum value
(18)     if there is a match among distinguished points  then
(19)       π‘˜ 1 ← π‘˜
(20)     end if
(21)     if there is a match among minimum values  then
(22)       π‘˜ 2 ← π‘˜
(23)     end if
(24)    until  Both of two methods have found the match
(25)     𝑅 𝑙 1 ← π‘˜ 1 / √ 𝑛 for distinguished point method
(26)     𝑅 𝑙 2 ← π‘˜ 2 / √ 𝑛 for the new algorithm
(27)    end for
(28)    𝑅 𝑗 1 βˆ‘ 𝑅 ← ( 𝑙 1 ) / 3 2 0 0 / 2 𝑖 βˆ’ 3 1 for distinguished point method
(29)    𝑅 𝑗 2 βˆ‘ 𝑅 ← ( 𝑙 2 ) / 3 2 0 0 / 2 𝑖 βˆ’ 3 1 for the new algorithm
(30)  end for
(31)   𝑅 𝑖 1 βˆ‘ 𝑅 ← ( 𝑗 1 ) / 2 0 for distinguished point method
(32)  𝑅 𝑖 2 βˆ‘ 𝑅 ← ( 𝑗 2 ) / 2 0 for the new algorithm
(33) end for

More precisely, for each π‘–βˆˆ[31,36], we generate 20 elliptic curves, where each of them has a subgroup 𝐺 of prime order 𝑛, such that π‘›βˆˆ[2𝑖,2𝑖+1]. Then for, each group 𝐺, we generate 100 to 3200 DLPs with the same generator 𝑃 but randomly generated 𝑄. The number of elliptic curves and instances of DLPs computed is given in Table 1. For each DLP, we use Teske's π‘Ÿ-adding walk for iteration function and find the match using distinguished point method and the new algorithm simultaneously. Once reaching a match, we compute the ratio 𝑅𝑙 as (the number of steps until match is found)/βˆšπ‘›. Then we compute the average ratio 𝑅𝑗 of all DLPs over the same elliptic curve. Finally, we count the average ratio 𝑅𝑖 of all DLPs with the same 𝑖, where π‘–βˆˆ[31,36] and π‘›βˆˆ[2𝑖,2𝑖+1].

Now, let us explain the parameters for distinguishing property and the new algorithm in more detail. In our experiments, we compute the average ratio of √(numberofstepsuntilmatchisfound)/𝑛 under the same space requirement. To do this, generally we first define the distinguishing property and then compute the expected storage requirements. With the same storage requirements, we can deduce the parameter 𝑁 for the new algorithm.

For example, if 𝑖=36, which means 𝑛, the order of 𝐺 is a 36-bit prime number. According to [19], we are expected to take √1.292𝑛 iterations before reaching a match. We define the distinguishing property as the Hamming weight of normal-basis representation of π‘₯-coordinate of the point less than or equal to 9. Each point has probability almost exactly (ξ€·936ξ€Έ+ξ€·836ξ€Έ+ξ€·736ξ€Έ+β‹―)/236β‰ˆ2βˆ’8.99 of being a distinguished point, that is, πœƒ=2βˆ’8.99; that is, to find a collision it is expected to compute 1.292βˆ—2βˆ’8.99βˆšπ‘› distinguished points. To keep the same storage requirements, we set 𝑁=1/πœƒ=28.99β‰ˆ508 for the new algorithm.

The experimental results are given in Table 2. It shows that on average using the new algorithm for collision detection can reduce the number of iterations until a match is found from √1.309|𝐺| to √1.295|𝐺| under the same space requirements for the single rho method.

Under the same expected storage requirements, the main reason for the different performances of the distinguished point method and the new algorithm is that the distinguished points may be not uniformly distributed in the pseudo-random walk, also the points in subset 𝐷 may be not uniformly distributed in 𝐺, which always results in more iterations requirement. while, for the new algorithm, each stored minimum value represents 𝑁 successive values, which leads to an equal-interval distribution.

6. Conclusion

In this paper, we proposed an optimal time-space trade-off method for collision detection in the pseudo-random walk when computing discrete logarithms with Pollard's rho method. We discussed the new algorithm both in theoretical analysis and in practical experiments. By comparison to other methods, it shows that the new algorithm is more efficient than previous methods. Unfortunately, the only practical application of the new idea is with the parallelized lambda method and it does not work with the parallelized rho method. As a further work, we would like to explore the performances of the new algorithm in other applications.

Acknowledgments

This work is partially supported by the National Natural Science Foundation of China (no. 61070168). The authors would like to thank the reviewers for their helpful comments and suggestions.