Documentation

CslibFrontier.Crypto.Protocols.VOLE.MaskedMulCheck

Full honest receiver views of masked VOLE multiplication checks #

One fresh ideal VOLE coordinate blinds both affine reply coefficients. All wire corrections are sent before the verifier's uniform public vector of weights. The mask coordinate receives no correction and is used once. The prover accesses only the sender setup oracle; the receiver's key and tags remain private. The full receiver view includes that private share and every public message, not just the affine reply.

This module specializes the arbitrary-degree QuickSilver protocol qsMaskedCheck from VOLE.HigherDegreeCheck to d = 2 on multiplication-gate constraints maskedMulCheckConstraints, presenting the Fin 2 → F reply vector as the affine pair (slope, const) via qsReplyPairEquiv. The computable formulas maskedMulCheckReply and maskedMulCheckValue are retained and proved equal to their degree-2 HigherDegreeCheck counterparts over every commutative ring; all completeness, simulation, and soundness theorems follow directly from VOLE.HigherDegreeCheck.

This is the masking step in [BBDdSG+23a], §2.3.2, printed pp.12–13, adapted to full-field wires and independent vector weights. The source uses subfield wires and scalar-power batching. The result concerns one honest execution in an ideal correlation world; it does not establish malicious-verifier ZK, VOLE-in-the-head security, or a certified efficient implementation.

Main definitions #

Main results #

The honest-view law needs only a finite commutative ring. Soundness bounds require a field.

References #

@[reducible, inline]

Wire corrections, public weights, then the blinded affine coefficients. This specializes the existing three-round message shape; it does not assert Sigma-protocol security properties.

Equivalence between degree-2 QuickSilver reply vectors indexed by degree (0 constant, 1 linear) and affine pairs (slope, const) representing slope * Δ + const.

Translate a degree-2 qsMaskedCheckSpec transcript into a maskedMulCheckSpec transcript by reindexing its Fin 2 → F reply as (reply 1, reply 0).

noncomputable def Cslib.Crypto.Protocols.VOLE.maskedMulCheckConstraints {F ι : Type} {n : ℕ} [CommRing F] (left right output : ι → Fin n) :
ι → MvPolynomial (Fin n) F

Degree-2 multivariate polynomial constraints X (left i) * X (right i) - X (output i) for a family of multiplication gates.

theorem Cslib.Crypto.Protocols.VOLE.totalDegree_maskedMulCheckConstraints_le {F ι : Type} {n : ℕ} [CommRing F] (left right output : ι → Fin n) (i : ι) :
(maskedMulCheckConstraints left right output i).totalDegree ≤ 2

Every multiplication-gate constraint has total degree at most 2.

theorem Cslib.Crypto.Protocols.VOLE.eval_maskedMulCheckConstraints_eq_zero_iff {F ι : Type} {n : ℕ} [CommRing F] (left right output : ι → Fin n) (w : Fin n → F) (i : ι) :
(MvPolynomial.eval w) (maskedMulCheckConstraints left right output i) = 0 ↔ w (left i) * w (right i) = w (output i)

A wire assignment vanishes on a multiplication-gate constraint iff the gate equation holds.

def Cslib.Crypto.Protocols.VOLE.maskedMulCheckReply {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] (left right output : ι → Fin n) (w : Fin n → F) (u v : Fin (n + 1) → F) (r : ι → F) :
F × F

Honest reply, using the final setup coordinate only as a fresh affine mask. The public index maps identify the two inputs and output of each multiplication gate.

def Cslib.Crypto.Protocols.VOLE.maskedMulCheckValue {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] (left right output : ι → Fin n) (delta : F) (q : Fin (n + 1) → F) (d : Fin n → F) (r : ι → F) :
F

The receiver's weighted check, including the tag of the fresh mask coordinate.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.VOLE.MaskedMulCheckAccepts {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] (left right output : ι → Fin n) :
F × (Fin (n + 1) → F) → (maskedMulCheckSpec F ι n).Transcript → Prop

The receiver's masked verification equation on its private share (delta, q) and a transcript (d, r, (a, b), ()) of corrections, weights and reply: maskedMulCheckValue left right output delta q d r = a * delta + b.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckValue_eq_qsMaskedCheckValue {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] (left right output : ι → Fin n) (delta : F) (q : Fin (n + 1) → F) (d : Fin n → F) (r : ι → F) :
maskedMulCheckValue left right output delta q d r = qsMaskedCheckValue 2 (maskedMulCheckConstraints left right output) delta q d r

maskedMulCheckValue coincides with qsMaskedCheckValue 2 on maskedMulCheckConstraints.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckReply_eq_qsMaskedCheckReply {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] (left right output : ι → Fin n) (w : Fin n → F) (u v : Fin (n + 1) → F) (r : ι → F) :
maskedMulCheckReply left right output w u v r = qsReplyPairEquiv (qsMaskedCheckReply 2 (maskedMulCheckConstraints left right output) w u v r)

maskedMulCheckReply coincides with qsReplyPairEquiv applied to qsMaskedCheckReply 2 on maskedMulCheckConstraints.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckAccepts_iff_qsMaskedCheckAccepts {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] (left right output : ι → Fin n) (share : F × (Fin (n + 1) → F)) (t : (qsMaskedCheckSpec F ι n 2).Transcript) :
MaskedMulCheckAccepts left right output share (qsTranscriptToMasked t) ↔ QSMaskedCheckAccepts 2 (maskedMulCheckConstraints left right output) share t

Verification acceptance for maskedMulCheck matches QSMaskedCheckAccepts 2 under qsTranscriptToMasked.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckReply_correct {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] (left right output : ι → Fin n) (w : Fin n → F) (c : VOLECorrelation F (n + 1)) (hc : c.Valid) (r : ι → F) (h : ∀ (i : ι), w (left i) * w (right i) = w (output i)) :
maskedMulCheckValue left right output c.delta c.w (voleCommitWitness w (Fin.init c.u)) r = (maskedMulCheckReply left right output w c.u c.v r).1 * c.delta + (maskedMulCheckReply left right output w c.u c.v r).2

Adding the fresh VOLE mask preserves honest completeness at every receiver key, directly specializing qsMaskedCheckReply_correct at d = 2.

noncomputable def Cslib.Crypto.Protocols.VOLE.maskedMulCheck {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) :

The actual public-coin reduction, obtained by specializing qsMaskedCheck 2 to maskedMulCheckConstraints and reindexing the final Fin 2 → F reply via qsReplyPairEquiv.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheck_output {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) (t : (maskedMulCheckSpec F ι n).Transcript) :
(maskedMulCheck left right output).verifier.output () t = do let __x ← ProbOracleComp.query (Sum.inr ()) match __x with | (delta, q) => pure (if MaskedMulCheckAccepts left right output (delta, q) t then some () else none)

The reduction's actual verifier reads its private setup share and applies the masked check to the two prover messages and the public challenge.

noncomputable def Cslib.Crypto.Protocols.VOLE.maskedMulCheckView {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) (w : Fin n → F) :
PMF ((F × (Fin (n + 1) → F)) × (maskedMulCheckSpec F ι n).Transcript)

Full honest receiver view, directly specializing qsMaskedCheckView 2 via qsTranscriptToMasked. See maskedMulCheckView_eq_run for equality with direct execution of maskedMulCheck in voleWorld.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckView_eq_run {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) (w : Fin n → F) :
maskedMulCheckView left right output w = (voleWorld F (n + 1)).eval do let receiver ← ProbOracleComp.query (Sum.inr ()) let result ← (maskedMulCheck left right output).run () w pure (receiver, result.1)

maskedMulCheckView matches running maskedMulCheck directly in voleWorld F (n + 1).

noncomputable def Cslib.Crypto.Protocols.VOLE.maskedMulCheckSimulate {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq ι] (left right output : ι → Fin n) :
ProbComp ((F × (Fin (n + 1) → F)) × (maskedMulCheckSpec F ι n).Transcript)

Witness-free simulation of the receiver's complete private share and public transcript, directly specializing qsMaskedCheckSimulate 2 via qsTranscriptToMasked.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckSimulate_accepts {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq ι] (left right output : ι → Fin n) {view : (F × (Fin (n + 1) → F)) × (maskedMulCheckSpec F ι n).Transcript} (hv : view ∈ (maskedMulCheckSimulate left right output).eval.support) :
MaskedMulCheckAccepts left right output view.1 view.2

Every simulated view satisfies the receiver's masked verification equation.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheck_complete {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) :
Interactive.Reduction.Complete (voleWorld F (n + 1)) (maskedMulCheck left right output) (fun (x : Unit) (w : Fin n → F) => ∀ (i : ι), w (left i) * w (right i) = w (output i)) Interactive.Accept 0

The actual honest execution accepts every satisfying wire assignment, in the same ideal world used for the full-view simulation.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckView_eq {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) (w : Fin n → F) :
maskedMulCheckView left right output w = do let c ← voleIdealDist F (n + 1) let r ← Probability.PMF.uniformOfFintype (ι → F) pure (c.receiverView, voleCommitWitness w (Fin.init c.u), r, maskedMulCheckReply left right output w c.u c.v r, ())

Expanding the actual role-separated execution exposes exactly one ideal setup sample and one subsequent public challenge. No sender-private data is included in the output view.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckView_eq_simulate {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) (w : Fin n → F) (h : ∀ (i : ι), w (left i) * w (right i) = w (output i)) :
maskedMulCheckView left right output w = (maskedMulCheckSimulate left right output).eval

Perfect simulation of the full honest receiver view in the cached ideal VOLE world. Every selected multiplication constraint must hold. Public parameters are the wire count, gate index type and three index maps; the simulator receives no witness. The equality includes the receiver's private key and raw tags, all public corrections, the public weights and both reply coefficients. This is an exact semantic view law, not a plain-model or malicious-verifier ZK claim.

theorem Cslib.Crypto.Protocols.VOLE.maskedMulCheckView_closeTo_simulate {F ι : Type} {n : ℕ} [CommRing F] [Fintype ι] [Fintype F] [DecidableEq F] [DecidableEq ι] (left right output : ι → Fin n) (w : Fin n → F) (h : ∀ (i : ι), w (left i) * w (right i) = w (output i)) :
Probability.CloseTo (maskedMulCheckView left right output w) (maskedMulCheckSimulate left right output).eval 0

No event on the complete receiver view distinguishes the honest execution from simulation.

theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_maskedMulCheckValue_le {F ι : Type} {n : ℕ} [Field F] [Fintype F] [DecidableEq F] [Fintype ι] [DecidableEq ι] {C : Type} [Fintype C] [Nonempty C] (ι_C : C ↪ F) (left right output : ι → Fin n) (u v : Fin (n + 1) → F) (d : Fin n → F) (hfalse : ∃ (i : ι), (Fin.init u + d) (left i) * (Fin.init u + d) (right i) ≠ (Fin.init u + d) (output i)) (a : (ι → F) → PMF (F × F)) :
(do let r ← Probability.PMF.uniformOfFintype (ι → F) let ab ← a r let c ← Probability.PMF.uniformOfFintype C have q : Fin (n + 1) → F := fun (j : Fin (n + 1)) => u j * ι_C c + v j pure (decide (maskedMulCheckValue left right output (ι_C c) q d r = ab.1 * ι_C c + ab.2))).toOuterMeasure {true} ≤ (↑(Fintype.card F))⁻¹ + (1 - (↑(Fintype.card F))⁻¹) * (2 / ↑(Fintype.card C))

Single-shot independent-weight soundness of maskedMulCheckValue over any challenge embedding ι_C : C ↪ F, directly specializing toOuterMeasure_qsMaskedCheckValue_le at d = 2.