Documentation

CslibFrontier.Crypto.Computational.Commitment.Guessing

Guessing a committed bit #

This module derives guessing guarantees from chosen-pair hiding. In the single-bit protocol of [Nao91], Section 3, the receiver sends a challenge before seeing the commitment to a fair bit. Its private coins may influence both that challenge and its later guess. The auxiliary-input remark of [Nao91], Section 2, p. 3 of the author's copy, compares the receiver's chance of guessing a bit after the commit stage with its chance given prior information alone. Here the prior is any joint distribution on a bit and an auxiliary word. It may be biased and correlated, and it need not have an efficient sampler.

Main results #

theorem Cslib.Crypto.PseudorandomGenerator.naorCommit_guessing_and_binding {generator : List Bool → List Bool} (hG : PseudorandomGenerator generator fun (n : ℕ) => max 1 (3 * n)) :
(∀ (receiver : ℕ → TwoStage Unit (List Bool) (List Bool) Bool (List Bool)), TwoStage.IsPPT Turing.MultiTapeTM.encUnit Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBool Turing.MultiTapeTM.encBits receiver → Negligible fun (n : ℕ) => Game.guessingAdvantage (ProbComp.eval (Experiment.guessBit fun (bit : Bool) => do let __x ← (receiver n).choose () match __x with | (r, state) => do let seed ← BitString.sampleList n (receiver n).guess state (naorCommit generator r bit seed)))) ∧ ∀ (n : ℕ), 0 < n → naorBindingProb generator (fun (k : ℕ) => 3 * k) n < (1 / 2) ^ n

The single-bit protocol of [Nao91], Section 3, Theorem 3.1, p. 6 of the author's copy. Here generator produces the requested prefix of the pseudorandom stream: 3 * n bits at every positive security parameter, and one bit at zero to preserve strict expansion. For an arbitrary expanding finite-output generator this prefix length is available by truncating to one extra bit and applying PseudorandomGenerator.amplify as in Section 2, p. 4.

A uniform strict-PPT receiver chooses its challenge and saves its state before seeing the commitment. Its absolute deviation from success probability one half in guessing the fair committed bit is negligible. For an honest uniform challenge of length 3 * n, the probability that some commitment has accepted openings to both bits is strictly below 2⁻ⁿ for every positive n. In the reveal stage the sender discloses the seed. Acceptance for the asserted bit is naorVerify, which checks the seed length and the recomputed commitment.

theorem Cslib.Crypto.StatefulHiding.exists_priorPredictor {commit : List Bool → Bool → List Bool → List Bool} (hhide : StatefulHiding commit) (hcommit : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : List Bool × Bool × List Bool) => match x with | (r, b, seed) => commit r b seed) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits encBitOpening) Turing.MultiTapeTM.encBits) {receiver : CommitmentReceiver} (hR : receiver.IsPPT) :
∃ (predict : ℕ → List Bool → ProbComp Bool), Probability.IsPPT Turing.MultiTapeTM.encBool predict ∧ ∀ (prior : ℕ → PMF (Bool × List Bool)) (bound : ℕ → ℕ), PolynomiallyBounded bound → (∀ (n : ℕ), ∀ x ∈ (prior n).support, x.2.length ≤ bound n) → Negligible fun (n : ℕ) => Game.advantage (do let __x ← prior n match __x with | (bit, aux) => do let guess ← (commitmentHidingGame commit receiver aux bit n).eval pure (guess == bit)) (predictionExperiment (prior n) Prod.snd Prod.fst fun (aux : List Bool) => (predict n aux).eval)

For every efficient commitment receiver, there is an efficient predictor using only the auxiliary input whose success probability differs negligibly from the receiver's. The predictor is fixed before the joint law of the secret selector and the auxiliary word, whose supported lengths have one polynomial bound. To predict the committed bit itself, the receiver chooses (false, true) as its challenge pair.

The predictor runs the receiver with a locally generated commitment to its first choice. This is an original formulation of the prior-information comparison in [Nao91], Section 2, p. 3 (author's copy), for a single-bit, two-message commitment with polynomial-length auxiliary inputs.