Documentation

CslibFrontier.Crypto.Protocols.VOLE.AdaptiveMulCheck

Masked VOLE views against adaptive receivers #

One fixed correction/challenge/reply execution uses a fresh ideal correlation. The receiver may choose weights using its private setup share, the corrections and private coins, and may retain state and query its cached share after the reply. The simulator runs those same continuations. This is an exact view experiment in the existing ideal world, without a new ZK predicate or an efficiency, reset, concurrent-session or VOLE-in-the-head claim.

This module specializes the arbitrary-degree adaptive-receiver simulation qsMaskedCheckReceiverView / qsMaskedCheckReceiverSimulate from VOLE.HigherDegreeCheck to d = 2 on maskedMulCheckConstraints by lifting maskedMulCheckSpec receiver strategies via maskedToQsReceiver.

Main definitions #

Main results #

This is an original semantic extension of the fresh-mask argument in the preceding module. The source uses scalar-power weights and subfield wires; this full-ring version permits arbitrary receiver-selected vector weights. The honest masking construction is described in [BBDdSG+23a], Section 2.3.2, printed pages 12–13. Its compiled security theorem is not claimed.

Adapt a maskedMulCheckSpec receiver strategy to qsMaskedCheckSpec F ι n 2 by converting the degree-2 Fin 2 → F reply to its affine pair (reply 1, reply 0).

noncomputable def Cslib.Crypto.Protocols.VOLE.maskedMulCheckReceiverView {F ι Aux View : Type} {n : ℕ} [CommRing F] [Fintype F] [DecidableEq F] [Fintype ι] [DecidableEq ι] (left right output : ι → Fin n) (V : Aux → ProbOracleComp (voleReceiverSpec F (n + 1)) (Interactive.VerifierStrategy (ProbOracleComp (voleReceiverSpec F (n + 1))) (maskedMulCheckSpec F ι n) View)) (w : Fin n → F) (z : Aux) :
PMF ((F × (Fin (n + 1) → F)) × (maskedMulCheckSpec F ι n).Transcript × View)

The full receiver view in one actual interaction, specializing qsMaskedCheckReceiverView 2 via maskedToQsReceiver and qsTranscriptToMasked. Receiver initialization runs after its setup share has been cached and before prover initialization; later effects run in protocol order. Only the role-local sender interface is supplied to the honest prover. Auxiliary input is fixed before this fresh setup is sampled.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckReceiverView_eq_run {F ι Aux View : Type} {n : ℕ} [CommRing F] [Fintype F] [DecidableEq F] [Fintype ι] [DecidableEq ι] (left right output : ι → Fin n) (V : Aux → ProbOracleComp (voleReceiverSpec F (n + 1)) (Interactive.VerifierStrategy (ProbOracleComp (voleReceiverSpec F (n + 1))) (maskedMulCheckSpec F ι n) View)) (w : Fin n → F) (z : Aux) :
maskedMulCheckReceiverView left right output V w z = (voleWorld F (n + 1)).eval do let share ← ProbOracleComp.query (Sum.inr ()) let v ← Interactive.liftVerifier (V z) let p ← Interactive.liftProver ((maskedMulCheck left right output).prover () w) let __x ← Interactive.runAgainst (maskedMulCheckSpec F ι n) (Interactive.ProverStrategy.hoist (fun {γ : Type} => Interactive.liftProver) (maskedMulCheckSpec F ι n) p) (Interactive.VerifierStrategy.hoist (fun {γ : Type} => Interactive.liftVerifier) (maskedMulCheckSpec F ι n) v) match __x with | (transcript, fst, view) => pure (share, transcript, view)

maskedMulCheckReceiverView matches running (maskedMulCheck left right output).prover directly against V z via runAgainst in voleWorld F (n + 1).

noncomputable def Cslib.Crypto.Protocols.VOLE.maskedMulCheckReceiverSimulate {F ι Aux View : Type} {n : ℕ} [CommRing F] [Fintype F] [Fintype ι] (left right output : ι → Fin n) (V : Aux → ProbOracleComp (voleReceiverSpec F (n + 1)) (Interactive.VerifierStrategy (ProbOracleComp (voleReceiverSpec F (n + 1))) (maskedMulCheckSpec F ι n) View)) (z : Aux) :
ProbComp ((F × (Fin (n + 1) → F)) × (maskedMulCheckSpec F ι n).Transcript × View)

Simulate the private share and full public transcript, directly specializing qsMaskedCheckReceiverSimulate 2 via maskedToQsReceiver and qsTranscriptToMasked.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckReceiverSimulate_eval_eq {F ι Aux View : Type} {n : ℕ} [CommRing F] [Fintype F] [Fintype ι] (left right output : ι → Fin n) (V : Aux → ProbOracleComp (voleReceiverSpec F (n + 1)) (Interactive.VerifierStrategy (ProbOracleComp (voleReceiverSpec F (n + 1))) (maskedMulCheckSpec F ι n) View)) (z : Aux) :
(maskedMulCheckReceiverSimulate left right output V z).eval = do let delta ← Probability.PMF.uniformOfFintype F let q ← Probability.PMF.uniformOfFintype (Fin (n + 1) → F) have run : {α : Type} → ProbOracleComp (voleReceiverSpec F (n + 1)) α → PMF α := fun {α : Type} (program : ProbOracleComp (voleReceiverSpec F (n + 1)) α) => OracleComp.interpret (OracleComp.sumHandler ProbComp.unifOracle fun (x : Unit) => PMF.pure (delta, q)) program let v ← run (V z) let d ← Probability.PMF.uniformOfFintype (Fin n → F) let challenge ← run (v d) let __x ← run challenge match __x with | (r, continuation) => do let a ← Probability.PMF.uniformOfFintype F have reply : F × F := (a, maskedMulCheckValue left right output delta q d r - a * delta) let terminal ← run (continuation reply) let view ← run terminal pure ((delta, q), (d, r, reply, ()), view)

Evaluating maskedMulCheckReceiverSimulate agrees with sampling a single uniform slope a : F and computing the constant term via maskedMulCheckValue.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckReceiverView_eq_simulate {F ι Aux View : Type} {n : ℕ} [CommRing F] [Fintype F] [DecidableEq F] [Fintype ι] [DecidableEq ι] (left right output : ι → Fin n) (V : Aux → ProbOracleComp (voleReceiverSpec F (n + 1)) (Interactive.VerifierStrategy (ProbOracleComp (voleReceiverSpec F (n + 1))) (maskedMulCheckSpec F ι n) View)) (w : Fin n → F) (z : Aux) (h : ∀ (i : ι), w (left i) * w (right i) = w (output i)) :
maskedMulCheckReceiverView left right output V w z = (maskedMulCheckReceiverSimulate left right output V z).eval

Exact simulation against every receiver strategy in the fixed three-message schedule. The equality retains its private setup share, full transcript and arbitrary terminal view, including state captured before the challenge and effects after the reply. The witness must satisfy every selected gate. The setup is trusted and uniform, and the affine mask is fresh for this execution; no reset, concurrent-session, runtime or plain-model ZK conclusion is asserted.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckReceiverSimulate_accepts {F ι Aux View : Type} {n : ℕ} [CommRing F] [Fintype F] [Fintype ι] (left right output : ι → Fin n) (V : Aux → ProbOracleComp (voleReceiverSpec F (n + 1)) (Interactive.VerifierStrategy (ProbOracleComp (voleReceiverSpec F (n + 1))) (maskedMulCheckSpec F ι n) View)) (z : Aux) {share : F × (Fin (n + 1) → F)} {transcript : (maskedMulCheckSpec F ι n).Transcript} {view : View} (hv : (share, transcript, view) ∈ (maskedMulCheckReceiverSimulate left right output V z).eval.support) :
MaskedMulCheckAccepts left right output share transcript

Every simulated transcript satisfies the masked equation, even when its weights were chosen adaptively. This concerns the equation, not an arbitrary receiver's terminal decision.