Shamir t-out-of-n Secret Sharing: Reconstruction and Perfect Privacy #
Shamir's secret-sharing scheme over the finite field ZMod p (p prime): a
secret s is shared by sampling a uniformly random polynomial f of degree
< t with f(0) = s, and handing party i the point f(xᵢ) at a distinct,
nonzero evaluation point xᵢ. Reconstruction from any t shares is Lagrange
interpolation; perfect privacy says any t-1 shares are jointly uniform and
independent of s.
We model a degree-< t polynomial by its constant coefficient s (the secret)
together with d := t-1 free coefficients a : Fin d → ZMod p (the
coefficients of X¹, …, X^d). Sharing at a point q is then
shareVal s a q = s + ∑ᵢ aᵢ · q^{i+1}, which is exactly the evaluation of the
polynomial build s a = C s + ∑ᵢ C aᵢ · X^{i+1} at q (shareVal_eq_eval).
Main definitions #
shareVal/build— the field-level share and the underlying polynomial.PrivGame/PrivAdv— the(t-1)-share privacy game and its advantage.
Main results #
shamir_reconstruct— reconstruction: for anyt = d+1distinct evaluation points, Lagrange interpolation through the shares recovers the secretf(0) = s. Generalt-out-of-n.shamir_perfect_privacy— perfect privacy: for anyt-1nonzero evaluation points, any two secretss₀, s₁, and any adversaryA, the(t-1)-share privacy advantage is exactly0. Generalt-out-of-n.
The privacy coupling avoids inverting a Vandermonde matrix: the difference of the
two secrets is absorbed by translating the free-coefficient vector by the free
coefficients of (s₁ - s₀) · L, where L is the degree-< t polynomial that is
1 at 0 and 0 at every revealed point (vanishPoly). Since translation is a
bijection of the sampling space, advantage_zero_of_rHoare collapses the
advantage to 0. This mirrors the poly_bij construction of the SSProve-Rocq
proof, adapted to a coefficient-vector coupling.
References #
- [Rosulek, The Joy of Cryptography, §3.13 (Shamir secret sharing)]
- [Shamir, How to Share a Secret, CACM 1979]
The scheme #
The underlying polynomial C s + ∑ᵢ C aᵢ · X^{i+1}.
Equations
- CatCrypt.Examples.ShamirSecretSharing.build s a = Polynomial.C s + ∑ i : Fin d, Polynomial.C (a i) * Polynomial.X ^ (↑i + 1)
Instances For
Reconstruction (general t-out-of-n) #
Reconstruction. For any t = d+1 distinct evaluation points x, Lagrange
interpolation through the shares shareVal s a (x j) recovers the secret
s = f(0). This is the correctness of Shamir reconstruction from any t
shares.
The vanishing polynomial for the privacy coupling #
L: the degree-< t polynomial equal to 1 at 0 and 0 at every revealed
point rp j. Built as (∏ⱼ (0 - rp j))⁻¹ · ∏ⱼ (X - rp j).
Equations
- CatCrypt.Examples.ShamirSecretSharing.vanishPoly rp = Polynomial.C (∏ j : Fin d, (0 - rp j))⁻¹ * ∏ j : Fin d, (Polynomial.X - Polynomial.C (rp j))
Instances For
The free-coefficient sum identity #
For a polynomial of degree ≤ d, the "free-coefficient sum"
∑ᵢ f.coeff (i+1) · q^{i+1} equals f(q) - f.coeff 0.
The translation vector and the share-equality identity #
The free-coefficient translation absorbing the secret difference s₁ - s₀.
Equations
- CatCrypt.Examples.ShamirSecretSharing.transVec rp s0 s1 i = (s1 - s0) * (CatCrypt.Examples.ShamirSecretSharing.vanishPoly rp).coeff (↑i + 1)
Instances For
The privacy game #
The (t-1)-share privacy game. The corrupted parties hold their shares at the
d = t-1 revealed points rp of one of two secrets:
PrivGame rp s₀ s₁ true shares s₀, PrivGame rp s₀ s₁ false shares s₁.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Privacy advantage: the corrupted parties' distinguishing probability between
(t-1) shares of s₀ and of s₁.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Coupling: for any t-1 nonzero revealed points, the two privacy games are
equidistributed. Translating the uniformly sampled free-coefficient vector by
transVec (a bijection of the sampling space) keeps every revealed share
fixed while switching the secret from s₀ to s₁.
Shamir (t-1)-share perfect privacy. For any t-1 nonzero evaluation
points, any two secrets s₀, s₁, and any adversary A, the privacy advantage
is exactly 0: any t-1 shares are uniform and independent of the secret.
Reflection into the Package / UC Stack #
The shallow shamir_perfect_privacy bounds a single distinguisher applied to the
two privacy-game bodies. This section lifts it to a composable statement about deep
nominal packages linked with an arbitrary adversary package, following the stack
shallow game → rawCode% → NomPackage.ofOracle → DeepNomAdvantage → sdist → UC
via the shared CatCryptCore.Deep.ReflectUCHelpers combinators. The privacy game
samples a free-coefficient vector then returns the revealed shares (heap-independent),
so the shallow coupling priv_coupling (for nonzero revealed points hrp) upgrades
to a full SPComp equality of the two reflected bodies
(spcomp_eq_of_isPure_coupling), and the whole stack follows with no purity bridge
on the adversary.
The reflected (t-1)-share privacy-game body for bit b: sample a uniform
free-coefficient vector a and reveal the shares at the corrupted points.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The two reflected bodies (shares of s0 vs. s1) have equal evaluations: for
nonzero revealed points the coupling priv_coupling upgrades to SPComp
equality.
Real privacy game as an oracle-exporting nominal package (shares s0).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Ideal privacy game as an oracle-exporting nominal package (shares s1).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Statistical distance zero between the two linked-game families.
Package-level perfect privacy (NomPkgSecure).
Perfect UC emulation of the linked-game families over the trivial-leak
interface (out = Bool, leak = Empty) with the identity simulator
(composition plumbing).