The goal of this blog post is to provide a quick overview of the following talk:
Recent advances in Computing discrete logs in finite fields by Pierrick Gaudry (CNRS, Université de Lorraine, Inria – Nancy, France)
which was recently presented in Summer School on real-world crypto and privacy 2023.
DLP ( Discrete Logorithm Problem)
Consider a cyclic group with \(g\) as a primitive root (i.e., \(G=⟨g⟩\)), In other words, each element of this group is a power of \(g\). Now, the challenging task is whether we can easily derive this power given the element of the group(\(h = g^x\)).
The naive solution is to recursively multiply \(g\) by itself until we reach \(h\); However, this approach requires an exhaustive search with a complexity equal to the cardinality of the cyclic group (\(N\)).
In practice, a large prime value (like 2048 bits), is taken into consideration for constructing a cyclic group. Moreover, this size can be increased such that a countermeasure of any active attacks will be guaranteed. Therefore, it’s not a trivial exercise to derive \(x\), this complexity is a baseline of many encryption protocols.
Application of DLP
Some remarkable applications of DLP are VPNs (virtual private networks), where the IKE protocol internally relies on DLP (although there is a growing shift towards elliptic curves). In TLS, which is commonly used for secure communication such as HTTPS, discrete logarithm plays a significant role. Furthermore, this challenging problem finds application in currently deployed E-Voting systems, where ElGamal encryption is predominantly utilized, often with prime fields. Additionally, the security and anonymity of protocols in blockchain technology heavily depend on pairings.
Is DLP as hard as searching all elements of the cyclic group?
Security of protocols based on discrete logarithms is proven with the assumption of having classic computers, However, an alternative approach, using quantum computers, leverages the quantum Fourier transform, which plays a crucial role in reducing the computation time. This technique involves performing a transform of length \(2^n\) using \(n\) qubits (Shor’s algorithm (1994)). The quantum Fourier transform employs a quadratic number of quantum gates, resulting in a total number of gates that is either quadratic or cubic, depending on the counting method employed.
While the above scenario assumes access to a quantum computer, which is not available currently, it does not exclude the possibility of faster algorithms in the classic world. In this blog post, we will focus on available approaches (algorithms) aimed at mitigating the complexity of the discrete logarithm problem.
Pohlig-Hellman reduction
Consider a group with order of \(N\), \(N = \prod l_i^{e_i}\), representing the prime factorization of \(N\). For any given index \(j\), we can raise both \(g\) and \(h\) to the power of \(\frac{N}{{l_j^{e_j}}}\) to obtain \(g^\prime\) and \(h^\prime\). The discrete logarithm of \(h^\prime\) in the group of order \({l_j^{e_j}}\) is then equivalent to \(x \mod {l_j^{e_j}}\), which presumably is solved faster than the original DLP.
Baby-step giant-step algorithm
The goal is discovering \(x\) such that \(h = g^x\). Let’s rewrite the (unknown) discrete logarithm \(x\) as
\(x = x_0 + \lceil \sqrt{N} \rceil x_1\), where \(0 \leq x_0, x_1 < \lceil \sqrt{N} \rceil\).
Then, in first phase: compute all candidate values for \(h g^{-x_0}\) and store them in an appropriate data structure. Secondly, compute all the \(g^{x_1 \lceil \sqrt{N} \rceil}\) and check if there is a match. If so, reconstruct \(x\) from \(x_0\) and \(x_1\). This task is doable with the complexity of \(\tilde{O}(\sqrt{N})\) in time and space.
A faster solution based on mentioned algorithms
By combining the Pohlig-Hellman algorithm and the Baby-step giant-step algorithm, we can solve the DLP in any group within a polynomial factor of time. Specifically, the DLP can be solved in approximately \(\sqrt{l}\) operations, where \(l\) represents the largest prime factor of the group order.
To achieve this, we can follow the algorithm consisting of three phases:
- In the first phase, we collect relations between “small” elements.
- Using sparse linear algebra techniques, we deduce the logarithms of these small elements.
- Finally, we aim to find a relation between the target element \(h\) and the small elements obtained in the previous phases.
These small elements are sometimes referred to as “smooth” elements. More precisely, an integer is considered B-smooth if all its prime factors are below B. For example, \(10!\) is considered 8-smooth.
A toy example
Let \(p = 107\), and consider DLP in the subgroup \(G\) of order \(\ell = 53\).
We can check that \(g = 3\) is a generator.
Find \(a_i\) such that \(g^{a_i}\) is smooth:
\(g^{24} = 5 \times 7, \quad g^{34} = 2 \times 5, \quad g^{37} = 23 \times 7\)
Taking logarithms, we get the linear system:
\(24 \equiv \log(5) + \log(7) \)
\(34 \equiv \log(2) + \log(5) \)
\(37 \equiv 3\log(2) + \log(7)\)
Solve it modulo \(53\) and get: \(\log(2) = 25\), \(\log(5) = 9\), \(\log(7) = 15\).
The presence of smooth elements offers hope for reducing the DLP. However, one problem lies in the difficulty of obtaining a random number that is smooth. To show how chalenging it can be, we need to explain the below definition.
L function
Let \(N\) be the main parameter (usually the input of the algorithm). For parameters \(\alpha \in [0, 1]\) and \(c > 0\), we define the subexponential L-function by \(L_N(\alpha, c) = \exp \left[ c (\log N)^\alpha (\log \log N)^{1-\alpha} \right]\).
It is proven that an integer less than \(N\) is \(L_N(1/2)\)-smooth with probability in \(1/L_N(1/2)\). Therefore, the algorithm defined for solving DLP has the total time computation of order of \(L_p(1/2, √2 + o(1))\).
What about field extensions?
In this case, the same algorithm, based on the smoothness of polynomials should be followed.
First, we consider that a polynomial in \( F_2[t] \) is \( b\)-smooth if all its irreducible factors have a degree at most\(b\). which is analogies with integers as follows:
- Logarithm \( \longleftrightarrow \) degree.
- Number of irreducible polynomials \( \approx \) number of prime numbers.
- Test of smoothness can be done in polynomial time (no need for complicated algorithms like ECM).
There are different algorithms with different costs to solve DLP, some of which are listed below:
1) DLP in \( F_q \), where \( q = p^n \): Quasi-polynomial algorithms. \((\approx) 2013\)
Well suited for small characteristics (including 2), Complexity can be as low as \( \log(q)O(\log \log(q)) \).
2) Number Field Sieve (NFS), (early 90’s)
Well suited for large characteristics (including prime fields).,and can be adapted for medium characteristics. Complexity in \( L_q(1/3) \).
3) Function Field Sieve (FFS),(90’s)
Still the best for a corner case of medium characteristics. Complexity in \( L_q(1/3) \).
In the rest of this post, we investigate more about NFS and its tower version.
NFS Algorithm
Let \(f(x)\) be a polynomial and \(m\) an integer such that \(f(m) \equiv 0 \pmod{p}\).
NFS is explained based on the below digram. In the process of mapping in the left side, the variable \(x\) is substituted with \(m\) in a polynomial chosen from integer polynomials. Taking the modulus \(p\) of the resulting polynomial yields a number in \(\mathbb{Z}_p\). However, the right side is more tricky. Firstly, a polynomial of typically degree \(6\)is selected and the main polynomial modulo \(f\) computed. Then, it is mapped to the root \( \alpha\) of the polynomial \(f\), followed by mapping it to \(m\), and finally to \(\mathbb{Z}_p\).

Usually \(a-bx\) is chosen as a polynomial from \(\mathbb{Z}[x]\),

In this case, if both sides are smooth, there exists a linear relation between logarithms in \(\mathbb{Z}/p\mathbb{Z}^*\).
Remark: It is enough to have smooth “norms”: \(f(a/b) \cdot b^{\deg f} \equiv a \pmod{m}\).
In a nutshell
- Polynomial selection: choice of \(f\) and \(m\).
- Collecting relations: find \((a, b)\)-pairs such that both sides are smooth.
- Prepare the matrix
- Linear algebra: get a kernel vector modulo \(\ell|p – 1\).
- Individual log: rewrite the log of the target in terms of logs of factor base elements.
Complexity : (L_p(1/3, (64/9)1/3))
TowerNFS and recent approches
Tower Number Field Sieve (TNFS) is an extension of the Number Field Sieve algorithm used for factoring integers. In TNFS, a tower of NFS instances is constructed, with each level representing an extension of the field. This approach involves utilizing multiple arrows, creating a tower structure to handle larger and more complex number fields.
Various approaches have been explored to improve the efficiency and scalability of TNFS. Gremy’s approach, proposed in 2017, aimed to mimic the successful algorithm developed by Franke-Kleinjung for dimension 2, but it faced challenges when applied to higher dimensions, such as dimension 3 or 4.
In 2020, McGuire and Robinson introduced an approach based on rectangular search spaces, which incorporated better search techniques and identified advantageous directions. While it showed promising results for dimensions 3 and 4, its scalability to higher dimensions remains a concern.
Another approach, presented by DeMicheli, G., and Pierrot in 2021, utilized classical lattice tools, specifically enumeration in an L2-sphere. This method performed well in dimension 6 and demonstrated potential for scaling to higher dimensions.
Furthermore, H. Al Aswad, C. Pierrot, and E. Thomé are currently working on a preprint that explores the Factory idea, which proves to be highly effective for TNFS. This approach has shown great potential for improving the efficiency and success rate of TNFS.
Conclusion
The security of the Discrete Logarithm Problem (DLP) depends on the specific parameters used and the computational capabilities of potential attackers. In certain groups, such as large prime order elliptic curve groups, the DLP is believed to be computationally difficult, making it a viable basis for cryptographic protocols like Diffie-Hellman key exchange and digital signatures. However, the security of the DLP relies on the absence of efficient algorithms that can solve it in polynomial time. If a breakthrough were to occur, such as the development of a quantum computer capable of performing Shor’s algorithm, it could potentially break the DLP and compromise the security of systems relying on it. Therefore, while the DLP is currently considered secure, it is important to monitor advancements in computational capabilities and potential attacks that could threaten its security in the future.
Mahdi Rahimi
Jun 6 2023, Vodice, Croatia



