Three-copy masked-3SAT commitment protocol for GMW zero-knowledge #
This module defines the two-round interactive protocol used to prove Goldreich, Micali, and
Wigderson's theorem [GMW91] that every language in NP has a computational
zero-knowledge interactive proof system from one-way functions (via Naor's bit commitment scheme
[Nao91] and ThreeSAT_npHard).
Rather than GMW's original 3-coloring protocol, we formalize a direct 3-copy masked-3SAT
truth-table commitment protocol: in each of 3 parallel copies, the prover samples a random mask m
for the variables of the 3CNF formula φ and commits (via naorCommit) to copyLen φ bits
consisting of m, the XOR-masked assignment v = w ⊕ m, and the 8-bit truth table of each clause
under inputs t ⊕ m. A 3-bit challenge ch selects for each copy whether to open m and the full
clause truth tables (ch[j] = false) or v and the active truth-table entries (ch[j] = true).
Main definitions #
Cslib.Crypto.GMW.realBits,Cslib.Crypto.GMW.simBits,Cslib.Crypto.GMW.allOpenFlags: committed bit layouts and selective-opening masks across the three protocol copies.Cslib.Crypto.GMW.proverReply1,Cslib.Crypto.GMW.proverReply2,Cslib.Crypto.GMW.verifyTranscript: prover round functions and verifier transcript predicate.Cslib.Crypto.GMW.TwoRoundState,Cslib.Crypto.GMW.runTwoRound: the round counter and recorded challenge of one execution, and the two-round deterministic oracle handler inProbComp.Cslib.Crypto.GMW.acceptGuess: the accept step of a simulation attempt, keeping the output when the recorded challenge equals the guessed one.Cslib.Crypto.GMW.ProverCoins: the committed bits and commitment seeds of one execution.Cslib.Crypto.GMW.gmwProver,Cslib.Crypto.GMW.gmwInteract: honest prover strategy and itsProbComprealization.Cslib.Crypto.GMW.gmwVerifier: honest two-round GMW verifier.
Main results #
Cslib.Crypto.GMW.naorMaskBits_realBits: selectively opening the honest committed bits under any challengechand valid witnesswyieldssimBits.Cslib.Crypto.GMW.run_gmwProver_fst,Cslib.Crypto.GMW.eval_gmwInteract: running a verifier againstgmwProvercoincides withgmwInteract.
References #
Masked 3SAT truth-table gadgets #
Pack three literal-variable bits into an active truth-table row index in 0..7.
Evaluate a clause of length at most 3 given the truth values of its first three literals' variables.
Look up the bit for variable v in vec at its first occurrence in φ.vars, returning
false when v ∉ φ.vars.
The 8-bit masked truth table of clause c under variable mask m.
The 8-bit indicator of the active row of clause c under masked assignment v.
The 8 * φ.length-bit concatenation of all clause truth tables of φ under mask m.
The 8 * φ.length-bit concatenation of all active-row indicators of φ under v.
Single-copy and three-copy bit layouts #
Number of committed bits in one copy of the masked 3SAT gadget:
φ.vars.length mask bits, φ.vars.length masked assignment bits, and 8 * φ.length table bits.
Number of committed bits across all three parallel copies.
Extract the m segment (first φ.vars.length bits) of a copy.
Extract the v segment (second φ.vars.length bits) of a copy.
Extract the truth-table segment (8 * φ.length bits) of a copy.
Honest committed bits for one copy given witness w and mask m.
Simulated (and selectively opened) bits for one copy given challenge bit b and random word
rand of length φ.vars.length.
Selective-opening flags for one copy under challenge bit b.
Check the opened bits of one copy against challenge bit b.
Three-copy protocol messages and verification #
Extract copy 0 (copyLen φ bits) from a 3-copy GMW bit vector.
Extract copy 1 (copyLen φ bits) from a 3-copy GMW bit vector.
Extract copy 2 (copyLen φ bits) from a 3-copy GMW bit vector.
Honest committed bits across all three copies.
Simulated (and selectively opened) bits across all three copies.
Selective-opening flags across all three copies under challenge word ch.
Two-round deterministic state handler, honest prover, and honest verifier #
The state before the first query: no round answered and a placeholder 3-bit challenge.
Deterministic two-round state transition answering the first query with reply1 q, the second
query with reply2 (BitString.listRow 3 0 q) while recording the 3-bit challenge in the state, and
subsequent queries with [].
Run a WordOracleComp Unit program against twoRoundStep inside ProbComp.
The accept step of a simulation attempt that guessed the challenge ch_guess: keep the output
of a two-round execution when its recorded challenge equals the guess, and fail otherwise.
Sample the honest prover's random masks and commitment seeds.
Honest first-round reply function for pre-sampled coins.
Honest second-round reply function for pre-sampled coins.
The honest GMW prover for a 3SAT formula φ and witness w. It samples its masks and
commitment seeds on the first query and answers the two rounds via honestReply1 and
honestReply2.