Documentation

CslibFrontier.Crypto.Computational.Factoring

The integer factoring experiment and assumption #

The modulus-only integer factoring experiment modulusFactoringGame and hardness assumption ModulusFactoringHard ([KL20], Section 9.2.3, Definition 9.45), parameterized by an arbitrary modulus distribution modGen : ℕ → PMF ℕ.

Also provides the shared challenge-input encoding encModulusChallengeInput ((1^n, (N, y))) used by modulus-parameterized assumptions (QuadraticResiduosityHard, DCR, RabinOneWay) and their reductions to integer factoring, together with the semiprime unique-factorization lemma mul_eq_mul_primes_cases.

Main definitions #

Main results #

References #

@[reducible, inline]

Canonical input encoding (1^n, (N, y)) for a security parameter n in unary and a modulus N and challenge element y in binary.

noncomputable def Cslib.Crypto.modulusFactoringGame (modGen : ℕ → PMF ℕ) (A : ℕ → ℕ → ProbComp (ℕ × ℕ)) (n : ℕ) :

The modulus-only integer factoring experiment ([KL20], Section 9.2.3, Definition 9.45): sample N ← modGen n, run A n N, and accept when A returns a nontrivial factorization 1 < a, 1 < b, a * b = N.

The integer factoring assumption for a modulus distribution family modGen : ℕ → PMF ℕ ([KL20], Section 9.2.3, Definition 9.45): every uniform PPT factoring algorithm succeeds with negligible probability. In place of the source's GenModulus, modGen is any law on ℕ, which need not be efficiently samplable or supported on products of two primes.

theorem Cslib.Crypto.ModulusFactoringHard.congr {modGen₁ modGen₂ : ℕ → PMF ℕ} (h : ModulusFactoringHard modGen₁) (heq : ∀ (n : ℕ), modGen₁ n = modGen₂ n) :

Transfer ModulusFactoringHard along pointwise equality of modulus distributions.

theorem Cslib.Crypto.mul_eq_mul_primes_cases {p q a b : ℕ} (hp : Nat.Prime p) (hq : Nat.Prime q) (ha : 1 < a) (hb : 1 < b) (hab : a * b = p * q) :
a = p ∧ b = q ∨ a = q ∧ b = p

Every nontrivial factorization a * b = p * q of a product of two primes p and q permutes (p, q).