Documentation

CslibFrontier.Crypto.Protocols.MPC.ProductRelation

Verifying Additive-Share Product Relations (Protocol 23.5 and Lemma 23.1) #

This module formalizes Protocol 23.5 (proving product relations between two parties P₁ and P₂ holding additive triple shares from a dealer D) together with Lemma 23.1 (soundness against a corrupt dealer), polynomial identity (23.8), and completeness for honest D, P₁, P₂ from [BS23], Sections 23.2.4.5–23.2.4.6 (printed pp. 1014–1016).

For m pairs of additive triple shares ((a_{k1}, b_{k1}, c_{k1}), (a_{k2}, b_{k2}, c_{k2})) represented as Cslib.Crypto.Protocols.MPC.Beaver.TripleShare (ZMod q), ProductRelations t₁ t₂ expresses (23.7): (a_{k1} + a_{k2})(b_{k1} + b_{k2}) = c_{k1} + c_{k2} for k = 1, ..., m. This general m-relation problem is posed in Section 23.2.4.5 (p. 1014); the reduction from an authenticated triple in Section 23.2.4.8 and Theorem 23.9 stay outside this module, and the simulators and Fact 23.2 privacy analysis of Section 23.2.4.7 are deferred to ProductRelation.Privacy.

Protocol model and hypotheses #

Main definitions #

Main results #

References #

The product relations (23.7) of [BS23] (§23.2.4.5, printed p. 1014) for m pairs of 2-party triple shares (a_{ki}, b_{ki}, c_{ki}) over ZMod q: (a_{k1} + a_{k2})(b_{k1} + b_{k2}) = c_{k1} + c_{k2} for k = 1, ..., m.

Instances For

    The full message sent by the dealer D to party P_i in Protocol 23.5 Step 1(e) ([BS23], printed p. 1015): (a_{ki}, b_{ki})_{k=0}^m and (c_{ki})_{k=0}^{2m}.

    • a : Fin (m + 1) → ZMod q

      The values (a_{0i}, ..., a_{mi}): a_{0i} is the extra value of Step 1(a) and a_{1i}, ..., a_{mi} are the shares in (23.7).

    • b : Fin (m + 1) → ZMod q

      The values (b_{0i}, ..., b_{mi}), in the same layout.

    • c : Fin (2 * m + 1) → ZMod q

      The values (c_{0i}, ..., c_{2m,i}): c_{0i} of Step 1(a), the shares c_{1i}, ..., c_{mi} in (23.7), then c_{m+1,i}, ..., c_{2m,i} of Step 1(d).

    theorem Cslib.Crypto.Protocols.MPC.ProductRelation.PartyDeal.ext {q m : ℕ} {x y : PartyDeal q m} (a : x.a = y.a) (b : x.b = y.b) (c : x.c = y.c) :
    x = y

    The m target triple shares (a_{ki}, b_{ki}, c_{ki})_{k=1}^m carried by PartyDeal.

    Auxiliary random values chosen by an honest dealer for party P_i in Protocol 23.5 Steps 1(a) and 1(d): blinding share (a_{0i}, b_{0i}, c_{0i}) and tail shares (c_{m+1,i}, ..., c_{2m,i}).

    • a0 : ZMod q

      Blinding share a_{0i} at evaluation node 0.

    • b0 : ZMod q

      Blinding share b_{0i} at evaluation node 0.

    • c0 : ZMod q

      Blinding product share c_{0i} at evaluation node 0.

    • cTail : Fin m → ZMod q

      Tail product shares (c_{m+1,i}, ..., c_{2m,i}) at nodes m + 1, ..., 2m.

    Instances For
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.DealerExtra.ext {q m : ℕ} {x y : DealerExtra q m} (a0 : x.a0 = y.a0) (b0 : x.b0 = y.b0) (c0 : x.c0 = y.c0) (cTail : x.cTail = y.cTail) :
      x = y

      Assemble party P_i's full PartyDeal from its target triples t and dealer randomness e.

      @[simp]
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.DealerExtra.toDeal_a {q m : ℕ} (t : Fin m → Beaver.TripleShare (ZMod q)) (e : DealerExtra q m) :
      (toDeal t e).a = Fin.cons e.a0 fun (k : Fin m) => (t k).a
      @[simp]
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.DealerExtra.toDeal_b {q m : ℕ} (t : Fin m → Beaver.TripleShare (ZMod q)) (e : DealerExtra q m) :
      (toDeal t e).b = Fin.cons e.b0 fun (k : Fin m) => (t k).b
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.DealerExtra.toDeal_c_of_le {q m : ℕ} (t : Fin m → Beaver.TripleShare (ZMod q)) (e : DealerExtra q m) {k : Fin (2 * m + 1)} (hk0 : ↑k ≠ 0) (hk1 : ↑k ≤ m) :
      (toDeal t e).c k = (t ⟨↑k - 1, ⋯⟩).c
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.DealerExtra.toDeal_c_of_lt {q m : ℕ} (t : Fin m → Beaver.TripleShare (ZMod q)) (e : DealerExtra q m) {k : Fin (2 * m + 1)} (hk1 : m < ↑k) :
      (toDeal t e).c k = e.cTail ⟨↑k - (m + 1), ⋯⟩

      Evaluation nodes k ↦ (k : ZMod q) for Fin n.

      noncomputable def Cslib.Crypto.Protocols.MPC.ProductRelation.interpPoly {q : ℕ} [Fact (Nat.Prime q)] {n : ℕ} (v : Fin (n + 1) → ZMod q) :

      Lagrange interpolant of v : Fin (n + 1) → ZMod q at nodes 0, ..., n in ZMod q.

      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.eval_interpPoly {q : ℕ} [Fact (Nat.Prime q)] {n : ℕ} (v : Fin (n + 1) → ZMod q) (hn : n + 1 ≤ q) (k : Fin (n + 1)) :
      Polynomial.eval (↑↑k) (interpPoly v) = v k

      Interpolated polynomial A_i(X) of degree ≤ m from d.a on {0, ..., m}.

      Interpolated polynomial B_i(X) of degree ≤ m from d.b on {0, ..., m}.

      Interpolated polynomial C_i(X) of degree ≤ 2m from d.c on {0, ..., 2m}.

      The discrepancy polynomial (A₁ + A₂)(B₁ + B₂) - (C₁ + C₂) appearing in (23.8) and Lemma 23.1.

      @[reducible, inline]

      Challenge set ℤ_q \ {0, ..., m} in Protocol 23.5 Steps 3–4 ([BS23], printed p. 1015).

      noncomputable def Cslib.Crypto.Protocols.MPC.ProductRelation.verifyPair {q m : ℕ} [Fact (Nat.Prime q)] (d₁ d₂ : PartyDeal q m) (r : ZMod q) :

      Honest party verification check on dealer messages d₁, d₂ and challenge r : ZMod q, returning (P₁ accepts, P₂ accepts) as in Protocol 23.5 Steps 4 and 6.

      noncomputable def Cslib.Crypto.Protocols.MPC.ProductRelation.honestPartiesRun (q m : ℕ) [Fact (Nat.Prime q)] (hm : 2 * m < q) (d₁ d₂ : PartyDeal q m) :

      Honest execution of Protocol 23.5 Steps 3–6 against dealer messages (d₁, d₂) when both P₁ and P₂ are honest (P₁ samples r uniformly from ℤ_q \ {0, ..., m}).

      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.eval_honestPartiesRun_accept_le {q m : ℕ} [Fact (Nat.Prime q)] (hm : 2 * m < q) {d₁ d₂ : PartyDeal q m} (hnot : ¬ProductRelations d₁.triples d₂.triples) :
      (honestPartiesRun q m hm d₁ d₂).eval.toOuterMeasure {res : Bool × Bool | res.1 = true ∨ res.2 = true} ≤ 2 * ↑m / ↑(q - m - 1)

      Lemma 23.1 ([BS23], §23.2.4.6, printed p. 1016): if D is corrupt (d₁, d₂ arbitrary) and both P₁ and P₂ are honest, and relation (23.7) does not hold on their triple shares, then the probability that either P₁ or P₂ finishes without aborting is at most 2m / (q - m - 1). Adds hm : 2 * m < q so the interpolation nodes in ZMod q are distinct and the challenge set Challenge q m is nonempty.

      Honest Dealer, Polynomial Identity (23.8), and Completeness #

      noncomputable def Cslib.Crypto.Protocols.MPC.ProductRelation.honestC2 {q m : ℕ} [Fact (Nat.Prime q)] (t₁ t₂ : Fin m → Beaver.TripleShare (ZMod q)) (e₁ : DealerExtra q m) (a02 b02 : ZMod q) :

      Auxiliary dealer values computed for P₂ from (t₁, t₂, e₁, a02, b02) in Protocol 23.5 Step 1(a)-(d) ([BS23], printed p. 1015).

      @[simp]
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.honestC2_a0 {q m : ℕ} [Fact (Nat.Prime q)] (t₁ t₂ : Fin m → Beaver.TripleShare (ZMod q)) (e₁ : DealerExtra q m) (a02 b02 : ZMod q) :
      (honestC2 t₁ t₂ e₁ a02 b02).a0 = a02
      @[simp]
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.honestC2_b0 {q m : ℕ} [Fact (Nat.Prime q)] (t₁ t₂ : Fin m → Beaver.TripleShare (ZMod q)) (e₁ : DealerExtra q m) (a02 b02 : ZMod q) :
      (honestC2 t₁ t₂ e₁ a02 b02).b0 = b02
      @[simp]
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.honestC2_c0 {q m : ℕ} [Fact (Nat.Prime q)] (t₁ t₂ : Fin m → Beaver.TripleShare (ZMod q)) (e₁ : DealerExtra q m) (a02 b02 : ZMod q) :
      (honestC2 t₁ t₂ e₁ a02 b02).c0 = (e₁.a0 + a02) * (e₁.b0 + b02) - e₁.c0
      @[simp]
      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.honestC2_cTail {q m : ℕ} [Fact (Nat.Prime q)] (t₁ t₂ : Fin m → Beaver.TripleShare (ZMod q)) (e₁ : DealerExtra q m) (a02 b02 : ZMod q) (k : Fin m) :
      (honestC2 t₁ t₂ e₁ a02 b02).cTail k = Polynomial.eval (↑(m + 1 + ↑k)) (((DealerExtra.toDeal t₁ e₁).polyA + interpPoly (Fin.cons a02 fun (j : Fin m) => (t₂ j).a)) * ((DealerExtra.toDeal t₁ e₁).polyB + interpPoly (Fin.cons b02 fun (j : Fin m) => (t₂ j).b))) - e₁.cTail k

      Protocol 23.5 Step 1 (honest dealer D) on target triple shares (t₁, t₂).

      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.discrepancyPoly_eq_zero_of_productRelations {q m : ℕ} [Fact (Nat.Prime q)] (hm : 2 * m < q) {t₁ t₂ : Fin m → Beaver.TripleShare (ZMod q)} (hrel : ProductRelations t₁ t₂) (e₁ : DealerExtra q m) (a02 b02 : ZMod q) :
      discrepancyPoly (DealerExtra.toDeal t₁ e₁) (DealerExtra.toDeal t₂ (honestC2 t₁ t₂ e₁ a02 b02)) = 0

      Polynomial identity (23.8) ([BS23], printed p. 1015): for an honest dealer's outputs (d₁, d₂) on inputs (t₁, t₂) satisfying (23.7) with 2 * m < q, (A₁ + A₂)(B₁ + B₂) - (C₁ + C₂) = 0.

      theorem Cslib.Crypto.Protocols.MPC.ProductRelation.eval_honestProtocol_eq_pure {q m : ℕ} [Fact (Nat.Prime q)] (hm : 2 * m < q) {t₁ t₂ : Fin m → Beaver.TripleShare (ZMod q)} (hrel : ProductRelations t₁ t₂) :
      (do let dd ← deal t₁ t₂ honestPartiesRun q m hm dd.1 dd.2).eval = PMF.pure (true, true)

      The consequence of (23.8) ([BS23], printed p. 1015) that when D, P₁, P₂ are honest and (t₁, t₂) satisfies (23.7) with 2 * m < q, both P₁ and P₂ accept with probability 1.