Documentation

CslibFrontier.Crypto.Protocols.SecretSharing.AccessStructure.Linear

Linear Secret Sharing from Monotone Span Programs #

This module formalizes the linear secret-sharing scheme derived from a monotone span program P : MonotoneSpanProgram F Party ([BS23], Construction 22.2, Definition 22.22 and Remark 22.15, pp. 978–982), with its correctness and privacy identities. These identities are a step toward Theorem 22.13 (p. 980), not that theorem. Theorem 22.13 says that Construction 22.2 is a secret sharing scheme in the sense of Definition 22.19 (p. 975), whose sharing and combining algorithms are efficient. Here the combiner linearReconstruct picks its row weights with Classical.choose, and no efficiency certificate for sharing or combining is proved (#5293).

In [BS23] (Definition 22.21, p. 978), P recognizes an access structure A iff P.accessStructure = A.

Given key k : Fin P.tailDim → F and secret : F, linearShare P k secret i evaluates P.matrix i *ᵥ Fin.cons secret k. Any coalition row-weight vector w satisfying ∑ i : s, vecMul (w i) (P.matrix i.1) = P.target reconstructs secret as ∑ i : s, dotProduct (w i) (linearShare P k secret i.1) (sum_dotProduct_linearShare_eq_secret). The total function linearReconstruct selects one such w via Classical.choose when P.Accepts s and outputs 0 otherwise; it supplies the deterministic reconstruct field of AccessScheme and carries no algorithmic or efficiency claim. For parties Fin N over a field with decidable equality, Cslib.Circuits.MonotoneSpanProgram.recombination computes such a w by elimination, and Cslib.Circuits.Synthesis.full_recombination bounds its circuits.

Privacy (linearView_eq_of_not_accepts) holds for every translation-invariant key distribution Q ∈ SourceClass.translationInvariant (LinearKey P). Note that when F is infinite and P.tailDim ≥ 1, no translation-invariant PMF on Fin P.tailDim → F exists (SourceClass.translationInvariant (LinearKey P) = ∅), so linearAccessScheme P has vacuous privacy over infinite fields while correctness still holds for every key; use linearUniformAccessScheme P over finite fields.

Main definitions #

Main results #

References #

The monotone access structure recognized by a monotone span program P ([BS23], Definition 22.21, p. 978). P recognizes A iff P.accessStructure = A.

@[reducible, inline]

Randomness (key) type for Construction 22.2: the auxiliary vector ρ = (ρ₂, …, ρ_d) : Fin P.tailDim → F ([BS23], Construction 22.2, p. 979).

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.SecretSharing.LinearShare {F : Type u_1} {Party : Type u_2} (P : Circuits.MonotoneSpanProgram F Party) (i : Party) :
Type u_1

Share type for party i in Construction 22.2: a column vector α_i ∈ F^{d_i} ([BS23], Construction 22.2, p. 979).

def Cslib.Crypto.Protocols.SecretSharing.linearShare {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) (k : LinearKey P) (secret : F) (i : Party) :

Sharing map G(α) of Construction 22.2 ([BS23], p. 979): forms r = Fin.cons secret k and assigns P.matrix i *ᵥ r to party i.

theorem Cslib.Crypto.Protocols.SecretSharing.sum_dotProduct_linearShare_eq_secret {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) (k : LinearKey P) (secret : F) {s : Finset Party} (w : (i : ↥s) → Fin (P.rowDim ↑i) → F) (hw : ∑ i : ↥s, Matrix.vecMul (w i) (P.matrix ↑i) = P.target) :
∑ i : ↥s, w i ⬝ᵥ linearShare P k secret ↑i = secret

Explicit reconstruction identity for Construction 22.2 ([BS23], pp. 979–980): any row-weight family w satisfying ∑ i : s, Matrix.vecMul (w i) (P.matrix i.1) = P.target recombines the shares {linearShare P k secret i.1}_{i ∈ s} to secret.

noncomputable def Cslib.Crypto.Protocols.SecretSharing.linearReconstruct {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) (s : Finset Party) (v : (i : ↥s) → LinearShare P ↑i) :
F

Deterministic reconstruction map C(J, {α_j}_{j ∈ J}) of Construction 22.2 ([BS23], pp. 979–980). When P.Accepts s, it selects a valid row-weight family via Classical.choose and outputs its dot product with the shares; otherwise it outputs 0. This choice-based wrapper carries no efficiency claim.

theorem Cslib.Crypto.Protocols.SecretSharing.linearReconstruct_linearShare {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) (k : LinearKey P) (secret : F) {s : Finset Party} (hs : P.Accepts s) :
(linearReconstruct P s fun (i : ↥s) => linearShare P k secret ↑i) = secret

Correctness of linearReconstruct ([BS23], Construction 22.2, p. 980): every accepted coalition s reconstructs secret for every key k.

theorem Cslib.Crypto.Protocols.SecretSharing.linearShare_add {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) (k₁ k₂ : LinearKey P) (secret₁ secret₂ : F) (i : Party) :
linearShare P (k₁ + k₂) (secret₁ + secret₂) i = linearShare P k₁ secret₁ i + linearShare P k₂ secret₂ i

Additive homomorphism of Construction 22.2 sharing (Remark 22.15, [BS23], p. 982).

theorem Cslib.Crypto.Protocols.SecretSharing.linearShare_smul {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) (c : F) (k : LinearKey P) (secret : F) (i : Party) :
linearShare P (c • k) (c * secret) i = c • linearShare P k secret i

Scalar multiplication homomorphism of Construction 22.2 sharing (not in [BS23]; Remark 22.15 states sums only).

theorem Cslib.Crypto.Protocols.SecretSharing.linearReconstruct_linearShare_add {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) (k₁ k₂ : LinearKey P) (secret₁ secret₂ : F) {s : Finset Party} (hs : P.Accepts s) :
(linearReconstruct P s fun (i : ↥s) => linearShare P k₁ secret₁ ↑i + linearShare P k₂ secret₂ ↑i) = secret₁ + secret₂

Reconstructing the pointwise sum of two Construction 22.2 sharings over an accepted coalition s recovers secret₁ + secret₂ (Remark 22.15, [BS23], p. 982).

theorem Cslib.Crypto.Protocols.SecretSharing.linearView_eq_of_not_accepts {F : Type u_1} {Party : Type u_2} [Field F] (P : Circuits.MonotoneSpanProgram F Party) {Q : PMF (LinearKey P)} (hQ : Q ∈ SourceClass.translationInvariant (LinearKey P)) {s : Finset Party} (hs : ¬P.Accepts s) (secret₀ secret₁ : F) :

The privacy identity of Construction 22.2, a step toward [BS23], Theorem 22.13 (p. 980), not that theorem: under any translation-invariant key distribution Q ∈ SourceClass.translationInvariant (LinearKey P), every unauthorized coalition's view distribution is independent of the secret, the condition of Definition 22.20 (p. 976). Theorem 22.13 also says that Construction 22.2 is a secret sharing scheme in the sense of Definition 22.19 (p. 975), whose sharing and combining algorithms are efficient. Here the combiner linearReconstruct picks its row weights with Classical.choose, and no efficiency certificate for sharing or combining is proved (#5293).

The linear secret-sharing scheme derived from a monotone span program P ([BS23], Construction 22.2 and Definition 22.22, pp. 979–980), over SourceClass.translationInvariant (LinearKey P). It bundles the correctness and privacy identities, a step toward Theorem 22.13 (p. 980): its combiner linearReconstruct picks its row weights with Classical.choose and carries no efficiency claim (#5293). When F is infinite and P.tailDim ≥ 1, SourceClass.translationInvariant (LinearKey P) = ∅, so privacy is vacuous (only universal correctness holds nontrivially); use linearUniformAccessScheme for finite fields.

Canonical finite-field linear secret-sharing scheme derived from P with uniform randomness.