Documentation

CslibFrontier.Crypto.Computational.RSAUnitInversion.Converse

Converse reduction from unit RSA to full RSA (Exercises 10.25–10.26) #

In [BS23], §10.11 (printed p. 431), Exercises 10.25 and 10.26 ask for the converse of Theorem 10.5: when the modulus N = p * q is the product of two distinct ℓ-bit primes (ℓ ≤ p.size and ℓ ≤ q.size), uniform residues in ZMod N and uniform units in (ZMod N)ˣ have statistical distance strictly less than 4 / 2 ^ ℓ (which equals 2 ^ -(ℓ - 2) for ℓ ≥ 2). Here dist_uniformOfFintype_zmod_units_lt derives < 4 / 2 ^ ℓ from the exact non-unit fraction Cslib.Crypto.dist_uniformOfFintype_zmod_units and Cslib.Crypto.sub_totient_div_lt. The book's Exercise 10.26 inequality names an adversary B that it does not introduce; here the full-RSA inverter A itself runs in rsaUnitInversionGame (so no new reduction is defined), giving RSAadv[A] ≤ uRSAadv[A] + 4 / 2 ^ ℓ.

Main results #

References #

theorem Cslib.Crypto.dist_uniformOfFintype_zmod_units_lt {p q ℓ : ℕ} [NeZero (p * q)] (hp : Nat.Prime p) (hq : Nat.Prime q) (hpq : p ≠ q) (hpn : ℓ ≤ p.size) (hqn : ℓ ≤ q.size) :

Boneh–Shoup Exercise 10.25 (§10.11, printed p. 431): for distinct primes p ≠ q with ℓ ≤ p.size and ℓ ≤ q.size, uniform residues modulo p * q and uniform units in (ZMod (p * q))ˣ have statistical distance strictly less than 4 / 2 ^ ℓ (2 ^ -(ℓ - 2) for ℓ ≥ 2), reusing dist_uniformOfFintype_zmod_units and sub_totient_div_lt.

Per-parameter converse bound from rsaUnitInversionGame to rsaInversionGame: running the same inverter A directly in both games (no new reduction is defined), when every key in (gen n).support has non-unit fraction (N - φ(N)) / N ≤ δ, rsaInversionGame succeeds with probability at most that of rsaUnitInversionGame plus δ.

theorem Cslib.Crypto.succProbability_rsaInversionGame_le_of_size (gen : RSAGen) (A : RSAInverter) {n ℓ : ℕ} (hsize : ∀ desc ∈ (gen n).support, ℓ ≤ desc.p.size ∧ ℓ ≤ desc.q.size) :

Boneh–Shoup Exercise 10.26 (§10.11, printed p. 431): running the same inverter A in both games (no new reduction is defined), if every key in (gen n).support has primes satisfying ℓ ≤ p.size and ℓ ≤ q.size, then rsaInversionGame succeeds with probability at most that of rsaUnitInversionGame plus 4 / 2 ^ ℓ (2 ^ -(ℓ - 2) for ℓ ≥ 2).

theorem Cslib.Crypto.RSAUnitOneWay.rsaOneWay_of_nonUnitFrac_le {gen : RSAGen} {δ : ℕ → NNReal} (hδ : Negligible δ) (hbound : ∀ᶠ (n : ℕ) in Filter.atTop, ∀ desc ∈ (gen n).support, ↑(desc.modulus - desc.modulus.totient) / ↑desc.modulus ≤ δ n) (h : RSAUnitOneWay gen) :

Asymptotic converse of Theorem 10.5 (RSAOneWay.rsaUnitOneWay): RSAUnitOneWay gen implies RSAOneWay gen whenever the non-unit fraction (N - φ(N)) / N on (gen n).support is eventually bounded by a negligible function δ, running A directly in both games (no new reduction is defined).

theorem Cslib.Crypto.RSAUnitOneWay.rsaOneWay {gen : RSAGen} (hsize : ∀ᶠ (n : ℕ) in Filter.atTop, ∀ desc ∈ (gen n).support, n ≤ desc.p.size ∧ n ≤ desc.q.size) (h : RSAUnitOneWay gen) :

Asymptotic converse of Theorem 10.5 (RSAOneWay.rsaUnitOneWay): RSAUnitOneWay gen implies RSAOneWay gen whenever n ≤ desc.p.size ∧ n ≤ desc.q.size holds eventually on (gen n).support (Boneh–Shoup §10.11, Exercise 10.26, p. 431, running A directly in both games).

theorem Cslib.Crypto.rsaOneWay_iff_rsaUnitOneWay {gen : RSAGen} (hsize : ∀ᶠ (n : ℕ) in Filter.atTop, ∀ desc ∈ (gen n).support, n ≤ desc.p.size ∧ n ≤ desc.q.size) :

Under n-bit primes (n ≤ desc.p.size ∧ n ≤ desc.q.size) eventually on (gen n).support, full-domain RSA one-wayness and unit-domain RSA one-wayness are equivalent.