Discrete-logarithm extraction from two linear relations #
Several discrete-logarithm reductions end the same way: two answers give two linear relations
z = w + c * x and z' = w + c' * x modulo the prime group order q with c ≠ c', and the
reduction outputs the witness x = (c - c')⁻¹ (z - z'). Schnorr's extractor
([BS23], Example 19.2) reads c, c' as the two challenges and z, z' as the two
responses. Two Pedersen openings (m₀, r₀) ≠ (m₁, r₁) of one commitment under h = α • g satisfy
m₀ + r₀ * α = m₁ + r₁ * α, so α = extractNat q r₁ m₀ r₀ m₁ ([Ped92], Section 3,
Theorem 3.1; [BS23], Section 10.6.1, Fact 10.3); the discrete-logarithm hash of
[KL20], Theorem 9.79, reuses that extraction.
extractNat computes the witness on natural numbers, inverting by Fermat's little theorem as a
(q - 2)nd power, so a polynomial-time machine can output it.
Main definitions #
Cslib.Crypto.PrimeOrderGroupFamily.extractNat: the witness(c - c')⁻¹ (z - z')moduloq.
Main results #
Cslib.Crypto.PrimeOrderGroupFamily.extractNat_cast: modulo a primeq,extractNatis(c - c')⁻¹ (z - z')whenevercandc'are distinct moduloq.Cslib.Crypto.PrimeOrderGroupFamily.extractNat_zmod_val: canonicalZMod qform ofextractNat_castforc ≠ c'.Cslib.Crypto.PrimeOrderGroupFamily.computableInPolyTime_extractNat: the witness is computable in polynomial time from the group description and the four binary numbers.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Example 19.2 and Section 10.6.1.
- T. P. Pedersen, Non-Interactive and Information-Theoretic Secure Verifiable Secret Sharing, Section 3, Theorem 3.1.
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd ed., Theorem 9.79.
The witness (c - c')⁻¹ (z - z') modulo q, computed on natural numbers with the inverse as a
(q - 2)nd power.
Fermat's little theorem gives the inverse in extractNat: modulo a prime q, it is
(c - c')⁻¹ (z - z') whenever c and c' are distinct modulo q.
Modulo a prime q, extractNat on canonical ZMod q representatives computes
(c - c')⁻¹ * (z - z') whenever c ≠ c'.
The witness extractNat is computable in polynomial time from the group description and the
four binary numbers.