Documentation

CslibFrontier.Crypto.Protocols.SecretSharing.AccessStructure.Basic

Secret Sharing over General Monotone Access Structures and Source Classes #

This module generalizes Cslib.Crypto.Protocols.SecretSharing.Scheme beyond threshold, finite-key Definition 2.1 of [Agg26] in two orthogonal directions:

  1. First-class monotone access structures (AccessStructure): monotone upward-closed families of authorized coalitions Finset Party, supporting threshold structures (AccessStructure.threshold), all-party sharing (AccessStructure.all), upward closures (AccessStructure.ofSets), preimages under share assignments (AccessStructure.pullback), lattice operations (AccessStructure.inter, AccessStructure.union), duals (AccessStructure.dual), and minimal authorized sets (AccessStructure.IsMinimalAuthorized).
  2. Source-class secret sharing (SourceClass, AccessScheme): deterministic sharing and reconstruction maps paired with a class SourceClass Key := Set (PMF Key) of allowed key distributions, generalizing [Agg26], Definition 2.1 (stated there for threshold structures and finite key spaces) to general monotone access structures, arbitrary Key types, and party-indexed share types Share : Party → Type*. A scheme is perfectly correct for every key and perfectly private for every distribution in sources, while marginal view distributions may vary across sources in the class.

Bridges to and from upstream Cslib.Crypto.Protocols.SecretSharing.Scheme are provided via AccessScheme.ofCslibScheme and AccessScheme.toCslibScheme, along with key-source pullbacks (AccessScheme.comapKey), secret restrictions (AccessScheme.restrictSecret), share relabelings (AccessScheme.mapShare), and party relabelings (AccessScheme.relabelParty).

Main definitions #

Main results #

References #

A monotone access structure on party type Party, specifying which coalitions are authorized to reconstruct the secret.

  • authorized : Finset Party → Prop

    Predicate characterizing authorized coalitions.

  • mono : Monotone self.authorized

    Every superset of an authorized coalition is authorized.

theorem Cslib.Crypto.Protocols.SecretSharing.AccessStructure.not_authorized_of_subset {Party : Type u_1} (A : AccessStructure Party) {s t : Finset Party} (hst : s ⊆ t) (ht : ¬A.authorized t) :

Any sub-coalition of an unauthorized coalition is unauthorized.

A coalition is minimally authorized when it is authorized and no proper subset is.

An access structure is nontrivial when the empty coalition is unauthorized and the full party set is authorized.

Every authorized coalition contains a minimally authorized sub-coalition.

The t-threshold access structure: coalitions of size at least t are authorized.

The all-party access structure: a coalition is authorized iff it contains every party.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessStructure.all_authorized_iff (Party : Type u_2) (s : Finset Party) :
(all Party).authorized s ↔ ∀ (i : Party), i ∈ s

Upward closure of a collection B of generating coalitions.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessStructure.ofSets_authorized_iff {Party : Type u_1} (B : Set (Finset Party)) (s : Finset Party) :
(ofSets B).authorized s ↔ ∃ b ∈ B, b ⊆ s
def Cslib.Crypto.Protocols.SecretSharing.AccessStructure.pullback {Party : Type u_1} {Party' : Type u_2} [DecidableEq Party'] (assign : Party → Finset Party') (A' : AccessStructure Party') :

Pullback of an access structure A' along a share-assignment map assign : Party → Finset Party': a coalition s is authorized iff s.biUnion assign is authorized in A'.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessStructure.pullback_authorized_iff {Party : Type u_1} {Party' : Type u_2} [DecidableEq Party'] (assign : Party → Finset Party') (A' : AccessStructure Party') (s : Finset Party) :
(pullback assign A').authorized s ↔ A'.authorized (s.biUnion assign)

Intersection of two access structures: authorized coalitions must be authorized in both.

Union of two access structures: authorized coalitions are authorized in at least one.

Dual of a finite access structure: s is dual-authorized iff Finset.univ \ s is not authorized in A.

noncomputable def Cslib.Crypto.Protocols.SecretSharing.AccessStructure.viewDistOf {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (source : PMF Key) (share : Key → Secret → (i : Party) → Share i) (s : Finset Party) (secret : Secret) :
PMF ((i : ↥s) → Share ↑i)

The coalition view distribution induced by a key source source, sharing map share, coalition s, and secret, supporting party-indexed share types.

@[reducible, inline]

A class of allowed key / randomness distributions on Key ([Agg26], Definition 2.1).

@[reducible, inline]

The singleton source class containing a single fixed distribution.

noncomputable def Cslib.Crypto.Protocols.SecretSharing.SourceClass.map {Key : Type u_1} {Key' : Type u_2} (f : Key → Key') (S : SourceClass Key) :

Pushforward of a source class along a key transformation f : Key → Key'.

The class of all flat distributions (uniform on nonempty finite subsets of Key).

structure Cslib.Crypto.Protocols.SecretSharing.AccessScheme (Secret : Type u_1) (Key : Type u_2) (Party : Type u_3) (Share : Party → Type u_4) :
Type (max (max (max u_1 u_2) u_3) u_4)

A secret-sharing scheme over a general monotone access structure access, relative to a class sources of allowed key distributions (an original generalization of the threshold, finite-key Definition 2.1 in [Agg26] to general AccessStructure Party and arbitrary Key).

Correctness is universal over keys k : Key: every authorized coalition deterministically reconstructs the secret. Privacy is relative to sources: for every source P ∈ sources and every unauthorized coalition s, the induced view distribution does not depend on the secret (though it may vary with P).

  • access : AccessStructure Party

    The monotone access structure specifying authorized coalitions.

  • sources : SourceClass Key

    The class of allowed key distributions.

  • share : Key → Secret → (i : Party) → Share i

    Sharing algorithm mapping a key, a secret, and a party to that party's share.

  • reconstruct (s : Finset Party) : ((i : ↥s) → Share ↑i) → Secret

    Reconstruction algorithm from a coalition's observed shares.

  • correct (k : Key) (secret : Secret) (s : Finset Party) : self.access.authorized s → (self.reconstruct s fun (i : ↥s) => self.share k secret ↑i) = secret

    Every authorized coalition reconstructs the secret for every key.

  • view_indist (P : PMF Key) : P ∈ self.sources → ∀ (s : Finset Party), ¬self.access.authorized s → ∀ (secret₀ secret₁ : Secret), AccessStructure.viewDistOf P self.share s secret₀ = AccessStructure.viewDistOf P self.share s secret₁

    For every allowed key source, unauthorized coalitions receive secret-independent views.

def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.view {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) (s : Finset Party) (k : Key) (secret : Secret) (i : ↥s) :
Share ↑i

The restricted shares observed by coalition s.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.view_apply {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) (s : Finset Party) (k : Key) (secret : Secret) (i : ↥s) :
scheme.view s k secret i = scheme.share k secret ↑i
noncomputable def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.shareDist {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) (P : PMF Key) (secret : Secret) :
PMF ((i : Party) → Share i)

The full share distribution for a fixed key source P and secret.

noncomputable def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.viewDist {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) (P : PMF Key) (s : Finset Party) (secret : Secret) :
PMF ((i : ↥s) → Share ↑i)

The coalition view distribution induced by key source P on coalition s.

theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.reconstruct_view_eq_secret {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) (k : Key) (secret : Secret) {s : Finset Party} (hs : scheme.access.authorized s) :
scheme.reconstruct s (scheme.view s k secret) = secret

Authorized coalitions reconstruct the secret from their view.

theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.viewDist_eq_of_not_authorized {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) {P : PMF Key} (hP : P ∈ scheme.sources) {s : Finset Party} (hs : ¬scheme.access.authorized s) (secret₀ secret₁ : Secret) :
scheme.viewDist P s secret₀ = scheme.viewDist P s secret₁

Unauthorized coalitions receive secret-independent view distributions under any allowed source.

theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.not_authorized_of_subset {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) {s t : Finset Party} (hst : s ⊆ t) (ht : ¬scheme.access.authorized t) :

Any sub-coalition of an unauthorized coalition is unauthorized.

def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.monoSources {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) {S' : SourceClass Key} (hsub : S' ⊆ scheme.sources) :
AccessScheme Secret Key Party Share

Restrict a scheme to a smaller source class S' ⊆ scheme.sources.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.monoSources_access {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) {S' : SourceClass Key} (hsub : S' ⊆ scheme.sources) :
(scheme.monoSources hsub).access = scheme.access
@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.monoSources_sources {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} (scheme : AccessScheme Secret Key Party Share) {S' : SourceClass Key} (hsub : S' ⊆ scheme.sources) :
(scheme.monoSources hsub).sources = S'
def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.comapKey {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} {Key' : Type u_5} (scheme : AccessScheme Secret Key Party Share) (f : Key' → Key) (S' : SourceClass Key') (hf : ∀ P' ∈ S', PMF.map f P' ∈ scheme.sources) :
AccessScheme Secret Key' Party Share

Pull back a scheme's key space along f : Key' → Key for any source class S' whose pushforward under f lies in scheme.sources.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.comapKey_access {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} {Key' : Type u_5} (scheme : AccessScheme Secret Key Party Share) (f : Key' → Key) (S' : SourceClass Key') (hf : ∀ P' ∈ S', PMF.map f P' ∈ scheme.sources) :
(scheme.comapKey f S' hf).access = scheme.access
@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.comapKey_sources {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} {Key' : Type u_5} (scheme : AccessScheme Secret Key Party Share) (f : Key' → Key) (S' : SourceClass Key') (hf : ∀ P' ∈ S', PMF.map f P' ∈ scheme.sources) :
(scheme.comapKey f S' hf).sources = S'
def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.restrictSecret {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} {Secret' : Type u_5} (scheme : AccessScheme Secret Key Party Share) (enc : Secret' → Secret) (dec : Secret → Secret') (hinv : Function.LeftInverse dec enc) :
AccessScheme Secret' Key Party Share

Restrict the secret space via an encoding enc : Secret' → Secret with left inverse dec.

def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.mapShare {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} {Share' : Party → Type u_5} (scheme : AccessScheme Secret Key Party Share) (e : (i : Party) → Share i ≃ Share' i) :
AccessScheme Secret Key Party Share'

Relabel each party's share alphabet by an equivalence e : ∀ i, Share i ≃ Share' i.

def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.relabelParty {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {Share : Party → Type u_4} {Party' : Type u_5} (scheme : AccessScheme Secret Key Party Share) (e : Party' ≃ Party) :
AccessScheme Secret Key Party' fun (i' : Party') => Share (e i')

Relabel the party type along an equivalence e : Party' ≃ Party.

def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.ofCslibScheme {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {S : Type u_4} (scheme : Scheme Secret Key Party S) :
AccessScheme Secret Key Party fun (x : Party) => S

Lift an upstream Cslib.Crypto.Protocols.SecretSharing.Scheme into an AccessScheme over the singleton source class {scheme.gen}.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.ofCslibScheme_authorized_iff {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {S : Type u_4} (scheme : Scheme Secret Key Party S) (s : Finset Party) :
@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.ofCslibScheme_sources {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {S : Type u_4} (scheme : Scheme Secret Key Party S) :
(ofCslibScheme scheme).sources = {scheme.gen}
def Cslib.Crypto.Protocols.SecretSharing.AccessScheme.toCslibScheme {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {S : Type u_4} (scheme : AccessScheme Secret Key Party fun (x : Party) => S) {P : PMF Key} (hP : P ∈ scheme.sources) :
Scheme Secret Key Party S

Project an AccessScheme with uniform share type S and an allowed source P ∈ sources back to an upstream Cslib.Crypto.Protocols.SecretSharing.Scheme.

@[simp]
theorem Cslib.Crypto.Protocols.SecretSharing.AccessScheme.toCslibScheme_gen {Secret : Type u_1} {Key : Type u_2} {Party : Type u_3} {S : Type u_4} (scheme : AccessScheme Secret Key Party fun (x : Party) => S) {P : PMF Key} (hP : P ∈ scheme.sources) :
(scheme.toCslibScheme hP).gen = P