Proofs: Coppersmith's algorithm for discrete logarithms in GF(2^n)
These are the human proofs of Coppersmith's algorithm for discrete logarithms in GF(2^n), at full length.
Correctness of Coppersmith's algorithm full
This proof shows: correctness, termination.
Let be irreducible over , so is the field with elements and is cyclic of order . Let have order and let . Let be the generator of line L3 and the logarithm of to base , so . A polynomial with has a nonzero image in , and we write for the logarithm of that image. Let over the prime powers with ; then , and is odd since is odd. For termination we treat the exponents of lines L9 and L13 as independent and uniform on .
Lemma 1 (membership and the trivial target). Line L1 returns NONE exactly when , and line L2 is correct.
Proof. is cyclic, so its only subgroup of order is , which is . If , then .
From now on with , unique because has order , and , so .
Lemma 2 (the Frobenius identity). For all and , with , the polynomial satisfies .
Proof. In a commutative ring of characteristic , , and by induction and . For with , this gives . So . Since , we have , and .
Lemma 3 (relations). Every pair in satisfies .
Proof. Every has degree at most , so and is defined. A row from line L7 comes from a pair with , and in . By Lemma 2, , which is nonzero in since is. Applying gives , that is, , which is the row . Line L4 takes , so and Lemma 2 applies. A row from line L9 has , and applying gives .
Lemma 4 (SOLVE). Let with prime and . If SOLVE returns a vector , then for every .
Proof. By Lemma 3, the vector satisfies every row modulo , because . Lines L19 and L20 swap two rows, multiply a row by a unit modulo (an entry not divisible by is coprime to ), or subtract a multiple of one row from another. Each operation is invertible, so the set of solutions modulo is unchanged, and is still a solution afterwards. After column has been processed, row has a in column and every other row has there, and later steps keep this, since they add multiples of rows whose entry in column is . When all columns are processed, row reads (right side of row ) , so the returned equals .
Lemma 5 (scale). After line L11, for every .
Proof. Line L11 is passed only when every SOLVE succeeded, so by Lemma 4, for each . These moduli are pairwise coprime, and the Chinese remainder theorem gives a unique residue modulo with these reductions, which is .
Lemma 6 (medium polynomials). If line L14 assigns a value to , the value is the true .
Proof. Every has degree at most , so and is defined. Line L14 accepts only if , with , and . By Lemma 2 and the argument of Lemma 3, , and so modulo . Since is odd, is a unit modulo , and is a unit by the test. Solving, , and by Lemma 5 the may replace the .
Lemma 7 (individual logarithms). For , the value of line L16 is the true .
Proof. Line L15 is passed only when equals in and every got a value. Then . Reducing modulo and using Lemmas 5 and 6 gives line L16.
Lemma 8 (conversion). With , the residue is for an integer coprime to , the residue is divisible by , and .
Proof. Since has order and has order , . For each prime with and , the -adic valuation of , taken as an integer in , is exactly , which is also the valuation of at ; and has no other prime factors, since has only primes dividing . Reducing modulo does not change the valuation at when it is below , so with prime to every , that is, coprime to . Next, gives , which is divisible by , and dividing by gives , that is, modulo . Multiplying by modulo gives .
Correctness. By Lemmas 7 and 8, line L18 returns . With Lemma 1, the algorithm returns if and NONE otherwise.
Termination. The loop of lines L5 to L7 runs over a finite set of pairs. For the loop of lines L8 to L11, fix . Each trial has with probability , and then line L9 appends the row with , all other entries , and right side . With probability , every eventually contributes such a row, and eventually has at least rows. Once the rows include the unit vectors for all , every SOLVE succeeds. Indeed, the row that started as the unit vector for column has entry in every earlier column, so it is never chosen as a pivot for an earlier column and is never changed by the clearing steps, which subtract a multiple of a pivot row only from rows with a nonzero entry in the pivot column. A swap at column moves only rows at positions at least , so this row stays at a position at least until column is processed, and then its entry is a unit pivot. The implementation retries SOLVE after each new row of line L9, so a successful attempt occurs. For the loop of lines L13 to L15, each trial has with probability ; then is the empty product, there are no , and line L15 is passed. Each search of line L14 is over a finite set. Hence the algorithm stops with probability .
Back to Coppersmith's algorithm for discrete logarithms in GF(2^n)