Documentation

CslibFrontier.Crypto.Protocols.VOLE.ScalarMulCheck

Scalar-challenge QuickSilver multiplication checks #

For t multiplication claims, the original QuickSilver arithmetic samples one public scalar chi after the wire values and masks are fixed and weights gate i : Fin t by chi ^ (i.val + 1). The first exponent is one, matching the source convention [t] = {1, ..., t}. The prover's pair is kept in source order: constant coefficient first and linear coefficient second. The verifier checks W = U + V * delta.

QuickSilver types wire values over a base field F_p and MAC masks, tags, and the global key over an extension field F_{p^r}. This API puts x, y, z, every mask and tag, and delta in one field F. It therefore formalizes the source equation after embedding the wire values into the extension field; it does not formalize that embedding, its image, or subfield-membership conditions.

The library's existing batched multiplication check instead samples one independent field element per gate and stores its reply in linear-then-constant order. This module is the convention-preserving bridge between those APIs. A single valid VOLE coordinate also supplies the source mask relation Bstar = A0star + A1star * delta: its v component masks the constant coefficient, its u component masks the linear coefficient, and its w component masks the verifier value.

For a false batch, scalar cancellation occurs with probability at most t / |F|. Conditional on noncancellation, an arbitrary reply chosen after chi passes for at most two values of the independent hidden key. The sequential experiment therefore has error at most (t + 2) / |F|.

This is the multiplication-gate arithmetic and check from [YSWW21], Section 3.1, printed pp. 6--7, and Section 4.2/Figure 5, printed pp. 12--13. The soundness argument immediately after Figure 5, printed p. 14, gives the 2 / p^r hidden-key term, t / p^r scalar-cancellation term, and (t + 2) / p^r union bound. The explanatory check in [BBDdSG+23a], Section 2.3.2, printed pp. 12--13, uses the same scalar powers. The concrete FAEST v2 and v3 verifiers instead use universal hashing [BBB+25]; v3 additionally uses degree-seven constraints and CRT masks [BBB+26c]. This module does not formalize those hashes or masks.

Main definitions #

Main results #

References #

def Cslib.Crypto.Protocols.VOLE.quickSilverWeight {F : Type} {t : ℕ} [Monoid F] (chi : F) (i : Fin t) :
F

The scalar challenge weight of gate i, whose source index is i.val + 1.

def Cslib.Crypto.Protocols.VOLE.quickSilverMulCheckValue {F : Type} {t : ℕ} [CommRing F] (x y z v_x v_y v_z : Fin t → F) (chi delta : F) :
F

The verifier's scalar-weighted multiplication-check value.

def Cslib.Crypto.Protocols.VOLE.quickSilverMulCheckReply {F : Type} {t : ℕ} [CommRing F] (x y v_x v_y v_z : Fin t → F) (chi : F) :
F × F

The honest unmasked reply in QuickSilver source order (constant, linear).

def Cslib.Crypto.Protocols.VOLE.quickSilverMaskedReply {F : Type} {t : ℕ} [CommRing F] (x y v_x v_y v_z : Fin t → F) (chi maskLinear maskConstant : F) :
F × F

The source-order reply masked by A0star and A1star. A valid VOLE coordinate supplies A0star = v 0, A1star = u 0, and Bstar = w 0.

def Cslib.Crypto.Protocols.VOLE.quickSilverMaskedValue {F : Type} {t : ℕ} [CommRing F] (x y z v_x v_y v_z : Fin t → F) (chi delta maskTag : F) :
F

The verifier value masked by the receiver's tag Bstar.

theorem Cslib.Crypto.Protocols.VOLE.quickSilverMulCheck_sub_eq {F : Type} {t : ℕ} [CommRing F] (x y z v_x v_y v_z : Fin t → F) (chi delta : F) :
quickSilverMulCheckValue x y z v_x v_y v_z chi delta = (∑ i : Fin t, quickSilverWeight chi i * (x i * y i - z i)) * delta ^ 2 + (quickSilverMulCheckReply x y v_x v_y v_z chi).2 * delta + (quickSilverMulCheckReply x y v_x v_y v_z chi).1

The scalar-weighted check has leading coefficient equal to the scalar-weighted residual. The remaining coefficients are exactly the source-order reply, reversed when written as a polynomial in delta.

theorem Cslib.Crypto.Protocols.VOLE.quickSilverMulCheck_complete {F : Type} {t : ℕ} [CommRing F] (x y z v_x v_y v_z : Fin t → F) (chi delta : F) (htrue : ∀ (i : Fin t), x i * y i = z i) :
quickSilverMulCheckValue x y z v_x v_y v_z chi delta = (quickSilverMulCheckReply x y v_x v_y v_z chi).1 + (quickSilverMulCheckReply x y v_x v_y v_z chi).2 * delta

Honest multiplication claims satisfy the unmasked source equation W = U + V * delta.

theorem Cslib.Crypto.Protocols.VOLE.quickSilverMaskedReply_correct {F : Type} {t : ℕ} [CommRing F] (x y z v_x v_y v_z : Fin t → F) (chi : F) (mask : VOLECorrelation F 1) (hmask : mask.Valid) (htrue : ∀ (i : Fin t), x i * y i = z i) :
quickSilverMaskedValue x y z v_x v_y v_z chi mask.delta (mask.w 0) = (quickSilverMaskedReply x y v_x v_y v_z chi (mask.u 0) (mask.v 0)).1 + (quickSilverMaskedReply x y v_x v_y v_z chi (mask.u 0) (mask.v 0)).2 * mask.delta

A valid fresh VOLE coordinate preserves the masked source equation. The sender-side components u 0 and v 0 enter the reply, while the receiver-side component w 0 enters the verifier value.

theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_quickSilverWeight_sum_eq_zero_le {F : Type} {t : ℕ} [Field F] [Fintype F] (residual : Fin t → F) (hne : ∃ (i : Fin t), residual i ≠ 0) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {chi : F | ∑ i : Fin t, quickSilverWeight chi i * residual i = 0} ≤ ↑t / ↑(Fintype.card F)

If at least one fixed residual is nonzero, the scalar-power weighted sum vanishes for a uniform challenge with probability at most t / |F|. The residuals are fixed before chi is sampled. The bound includes the unavoidable cancellation at chi = 0 for every nonempty batch.

theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_quickSilverMulCheck_key_le {F : Type} {t : ℕ} [Field F] [Fintype F] (x y z v_x v_y v_z : Fin t → F) (chi : F) (reply : F × F) (hne : ∑ i : Fin t, quickSilverWeight chi i * (x i * y i - z i) ≠ 0) :
(Probability.PMF.uniformOfFintype F).toOuterMeasure {delta : F | quickSilverMulCheckValue x y z v_x v_y v_z chi delta = reply.1 + reply.2 * delta} ≤ 2 / ↑(Fintype.card F)

Conditional on a nonzero scalar-weighted residual, an arbitrary source-order affine reply passes the multiplication check for an independent uniform hidden key with probability at most 2 / |F|.

theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_quickSilverMulCheck_le {F : Type} {t : ℕ} [Field F] [DecidableEq F] [Fintype F] (x y z v_x v_y v_z : Fin t → F) (reply : F → PMF (F × F)) (hfalse : ∃ (i : Fin t), x i * y i ≠ z i) :
(do let chi ← Probability.PMF.uniformOfFintype F let uv ← reply chi let delta ← Probability.PMF.uniformOfFintype F pure (decide (quickSilverMulCheckValue x y z v_x v_y v_z chi delta = uv.1 + uv.2 * delta))).toOuterMeasure {true} ≤ ↑(t + 2) / ↑(Fintype.card F)

A false fixed batch, followed by a uniform scalar challenge, an arbitrary randomized reply depending on that challenge, and an independent uniform hidden key, accepts with probability at most (t + 2) / |F|. The two summands are the scalar-cancellation and hidden-key failures.

theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_quickSilverMulCheck_bind_le {F : Type} {t : ℕ} [Field F] [DecidableEq F] [Fintype F] {S : Type} (sender : PMF S) (x y z v_x v_y v_z : S → Fin t → F) (reply : S → F → PMF (F × F)) :
(do let s ← sender let chi ← Probability.PMF.uniformOfFintype F let uv ← reply s chi let delta ← Probability.PMF.uniformOfFintype F pure (decide ((∃ (i : Fin t), x s i * y s i ≠ z s i) ∧ quickSilverMulCheckValue (x s) (y s) (z s) (v_x s) (v_y s) (v_z s) chi delta = uv.1 + uv.2 * delta))).toOuterMeasure {true} ≤ ↑(t + 2) / ↑(Fintype.card F)

An arbitrary randomized sender fixes all wires and masks before the scalar challenge. Its reply may depend on its state and on chi, but not on the subsequently sampled hidden key. The bad event includes a false multiplication claim, so it is empty for t = 0.