← LibrarySubexponential Discrete Logarithm AlgorithmsEngineering · MathematicsLesson 131/385← PrevNext →
ArticlePublished 7 Aug 20263 min readBy Kevin Jogin

Engineering  /  Mathematics  — Discrete Logarithms and Factoring

Subexponential Discrete Logarithm Algorithms

Index calculus for discrete logarithms in Z_p*, its two phases, and the precomputation asymmetry it creates.

Page KV-MATH-0403Reading time 3 minReviewed 2026-08-07Author Kevin Jogin

Executive summary

Index calculus computes discrete logarithms in subexponential time by finding the logarithms of a small factor base first, then expressing an arbitrary target in terms of them.

The expensive first phase depends only on the group, not on the target, so it can be precomputed once and reused against every subsequent target in that group.

Learning objectives

  1. State the two phases of index calculus.
  2. Explain why it beats the generic square-root bound.
  3. Identify the precomputation asymmetry and its consequences.

01The two phases

  1. Choose a factor base

    All primes up to a smoothness bound y.

  2. Collect relations

    Compute γ^k mod p for random k; keep those results that are y-smooth, each giving a linear relation among the factor base logarithms.

  3. Solve the system

    With enough relations, solve the linear system modulo the group order to obtain the logarithm of every factor base element.

  4. Solve for the target

    Compute α · γ^s mod p for random s until the result is smooth; then the target's logarithm follows from the known factor base logarithms.

γ^k ≡ ∏ pᵢ^{eᵢ}  ⇒  k ≡ Σ eᵢ · log_γ(pᵢ) (mod q)

Each smooth power gives one linear equation in the unknown factor base logarithms. Collecting slightly more equations than unknowns determines them all.

02Why it beats the generic bound

Generic algorithms treat the group as a black box and are limited to O(√q). Index calculus uses the fact that elements of Z_p* are integers with factorisations — structure the black-box model forbids.

Structure and attack cost
GroupStructure availableBest known attack
Z_p*Integer factorisation of representativesIndex calculus, L(1/3)
Small-characteristic finite fieldsRich; quasi-polynomial methods knownEffectively broken for cryptography
General elliptic curvesNone exploitableGeneric square root only

03The precomputation asymmetry

This matters because standardised parameters are shared across an enormous number of deployments. A single precomputation against a common 1024-bit group would compromise every connection using it, and the per-connection cost after that is small.

  1. PrecomputationL(1/3), very largeOnce per group; reusable indefinitely
  2. Individual logarithmMuch cheaperPer target, after precomputation

The practical responses are to use groups large enough that even the precomputation is infeasible, to avoid widely shared standardised small groups, and to prefer elliptic curves where no such precomputation exists. This reasoning drove the deprecation of 1024-bit finite-field Diffie-Hellman.

04Frequently asked questions

Why collect relations from random powers rather than systematically?

Because smoothness is essentially unpredictable, so random sampling is as good as any strategy and keeps the analysis tractable. The sieving variants generate candidates more efficiently but the principle is the same.

Is the linear algebra step a bottleneck?

Yes, and it is why the smoothness bound cannot simply be raised. The matrix is large and sparse, so specialised sparse solvers over finite fields are used rather than dense Gaussian elimination.

Does the precomputation attack apply to elliptic curves?

No, because there is no index calculus phase to precompute. Each elliptic curve discrete logarithm must be attacked individually at full generic cost, which is a significant structural advantage.

Sources and method

Structural reference: Victor Shoup, A Computational Introduction to Number Theory and Algebra, Version 1, Cambridge University Press, 2005 — book pages 337-344.

This page carries the durable method layer only: definitions, constructions, algorithms, complexity results and selection criteria, authored originally for KEVOS. No text is transcribed or paraphrased from the source, and no numeric tables or benchmark data are reproduced — these are routed to live authoritative sources instead.

Author: Kevin Jogin. Last reviewed 2026-08-07.

Continue learning

Smooth NumbersArticle · MathematicsNEXT LESSON →Subexponential Integer FactoringArticle · MathematicsThe Diffie-Hellman Key Establishment ProtocolArticle · MathematicsBetter Smoothness Density EstimatesArticle · Mathematics