Algorithm Search⌘K

Proofs: Index calculus

These are the human proofs of Index calculus, at full length.

Correctness of index calculus full

This proof shows: correctness, termination.

Let pp be prime, g∈(Z/pZ)∗g \in (\mathbb{Z}/p\mathbb{Z})^* of order nn, and h∈(Z/pZ)∗h \in (\mathbb{Z}/p\mathbb{Z})^*. Let γ\gamma be the generator of line L3 and L(y)∈Z/(p−1)ZL(y) \in \mathbb{Z}/(p - 1)\mathbb{Z} the logarithm of yy to base γ\gamma, so L(y1y2)=L(y1)+L(y2)L(y_1 y_2) = L(y_1) + L(y_2). Let ℓ=∏qf\ell = \prod q^f over the prime powers qf∥p−1q^f \parallel p - 1 with q∣nq \mid n. Since n∣p−1n \mid p - 1, every prime power qe∥nq^e \parallel n satisfies e≤fe \le f, so n∣ℓn \mid \ell. For termination we treat the exponents kk of lines L6 and L11 as independent and uniform on {0,…,p−2}\{0, \dots, p - 2\}.

Lemma 1 (membership and the trivial target). Line L1 returns NONE exactly when h∉⟨g⟩h \notin \langle g \rangle, and line L2 is correct.

Proof. (Z/pZ)∗(\mathbb{Z}/p\mathbb{Z})^* is cyclic, so its only subgroup of order nn is {y:yn=1}\{y : y^n = 1\}, which is ⟨g⟩\langle g \rangle. If h=1h = 1, then x=0x = 0. □\square

From now on h=gx∗h = g^{x^*} with 0≤x∗<n0 \le x^* < n, unique because gg has order nn, and h≠1h \ne 1, so n≥2n \ge 2.

Lemma 2 (relations). Every pair (e,k)(e, k) in RR satisfies ∑s∈SesL(s)≡k(modp−1)\sum_{s \in S} e_s L(s) \equiv k \pmod{p - 1}.

Proof. Line L7 appends (e,k)(e, k) only if γk≡∏sses(modp)\gamma^k \equiv \prod_s s^{e_s} \pmod p. Every s∈Ss \in S is a prime below pp, so s∈(Z/pZ)∗s \in (\mathbb{Z}/p\mathbb{Z})^*, and applying LL gives k≡∑sesL(s)k \equiv \sum_s e_s L(s). □\square

Lemma 3 (SOLVE). Let m=qfm = q^f with qq prime. If SOLVE(R,q,m)(R, q, m) returns a vector λ\lambda, then λs≡L(s)(modm)\lambda_s \equiv L(s) \pmod m for every s∈Ss \in S.

Proof. By Lemma 2 the vector X=(L(s) mod m)sX = (L(s) \bmod m)_s satisfies every row modulo mm, because m∣p−1m \mid p - 1. Lines L15 and L16 swap two rows, multiply a row by a unit modulo mm (an entry not divisible by qq is coprime to mm), or subtract a multiple of one row from another. Each operation is invertible, so the set of solutions modulo mm of the system is unchanged, and XX is still a solution afterwards. After the column jj has been processed, row jj has a 11 in column jj and every other row has 00 there, and later steps keep this, since they add multiples of rows whose entry in column jj is 00. When all columns are processed, row jj reads Xj≡(right side of row j)(modm)X_j \equiv \text{(right side of row } j) \pmod m. So the returned λj\lambda_j equals XjX_j. □\square

Lemma 4 (individual logarithms). After lines L9 and L12, λs≡L(s)(modℓ)\lambda_s \equiv L(s) \pmod \ell for every ss, and L(y)L(y) of line L12 is the true L(y) mod ℓL(y) \bmod \ell for y∈{g,h}y \in \{g, h\}.

Proof. Line L9 is reached only when every SOLVE succeeded, so by Lemma 3, λ(q)≡L(s)(modqf)\lambda^{(q)} \equiv L(s) \pmod{q^f} for each qf∥ℓq^f \parallel \ell. These moduli are pairwise coprime, and the Chinese remainder theorem gives a unique residue modulo ℓ\ell with these reductions, which is L(s) mod ℓL(s) \bmod \ell. At line L11, yγk≡∏sdsy \gamma^k \equiv \prod s^{d_s}, so L(y)+k≡∑dsL(s)(modp−1)L(y) + k \equiv \sum d_s L(s) \pmod{p - 1}, and reducing modulo ℓ∣p−1\ell \mid p - 1 gives line L12. □\square

Lemma 5 (conversion). With c=ℓ/nc = \ell / n, the residue L(g) mod ℓL(g) \bmod \ell is cuc u for an integer uu coprime to nn, the residue L(h) mod ℓL(h) \bmod \ell is divisible by cc, and (L(h)/c)u−1≡x∗(modn)(L(h)/c) u^{-1} \equiv x^* \pmod n.

Proof. Since gg has order nn and γ\gamma has order p−1p - 1, gcd⁡(L(g),p−1)=(p−1)/n\gcd(L(g), p - 1) = (p - 1)/n. For each prime q∣nq \mid n with qe∥nq^e \parallel n and qf∥p−1q^f \parallel p - 1, the qq-adic valuation of L(g)L(g), taken as an integer in [0,p−2][0, p - 2], is exactly f−ef - e, which is also the valuation of cc at qq; and cc has no other prime factors, since ℓ\ell has only primes dividing nn. Reducing modulo ℓ\ell does not change the valuation at qq when it is below ff, so L(g) mod ℓ=cuL(g) \bmod \ell = c u with uu prime to every q∣nq \mid n, that is, coprime to nn. Next, h=gx∗h = g^{x^*} gives L(h)≡x∗L(g)≡x∗cu(modℓ)L(h) \equiv x^* L(g) \equiv x^* c u \pmod \ell, which is divisible by cc, and dividing by cc gives L(h)/c≡x∗u(modℓ/c)L(h)/c \equiv x^* u \pmod{\ell / c}, that is, modulo nn. Multiplying by u−1u^{-1} modulo nn gives x∗x^*. □\square

Correctness. By Lemmas 4 and 5, line L14 returns x∗ mod n=x∗x^* \bmod n = x^*. With Lemma 1, the algorithm returns x∗x^* if h∈⟨g⟩h \in \langle g \rangle and NONE otherwise.

Termination. The descent of line L11 stops with probability 11: for each trial, yγky \gamma^k is uniform in (Z/pZ)∗(\mathbb{Z}/p\mathbb{Z})^* and equals 11, which is smooth, with probability 1/(p−1)1/(p - 1). For the loop of lines L5 to L9, fix s∈Ss \in S. Each trial has γk=s\gamma^k = s with probability 1/(p−1)1/(p - 1), and then line L7 appends the row with es=1e_s = 1, all other entries 00, and right side L(s)L(s). With probability 11, every s∈Ss \in S eventually contributes such a row. Once the relations include the unit vectors for all ss, every SOLVE succeeds: before column jj is processed, the row that started as the unit vector for column jj has been changed only by subtracting multiples of earlier pivot rows, which subtracts multiples of its entries in earlier columns, all 00, so it still has entry 11 in column jj, which is a unit. The attempts at line L8 happen every 55 new relations, so a successful attempt occurs. Hence the algorithm stops with probability 11. ■\blacksquare

Back to Index calculus