Documentation

QedShare.Shamir.Secrecy

Perfect secrecy #

Claim. Fix any set T of at most k − 1 nonzero share indices, and any two secrets s, s' of the same length. There is a bijection σ on the randomness such that the shares at T made from (s, r) are exactly the shares at T made from (s', σ r).

So every possible view of k − 1 shares is produced by the same number of random choices for s as for s'. With uniform randomness, the shares are equally likely whatever the secret is: they reveal nothing about it.

Construction. Let g = vanishing T = 1 + x·gₜ(x). Then g(0) = 1 and g(t) = 0 for t ∈ T, so t·gₜ(t) = 1 on T. For each secret byte, σ adds (s + s')·gₜ to the random coefficients r. The byte's polynomial becomes s' + x·r(x) + (s + s')·x·gₜ(x). At any t ∈ T that is s' + t·r(t) + (s + s') = s + t·r(t), the old value. Adding the same thing twice cancels (characteristic 2), so σ ∘ σ = id: σ is its own inverse.

The non-constant part gₜ of the vanishing polynomial g = 1 + x·gₜ.

Equations
Instances For
    def QedShare.Shamir.shift (T s s' : List GF256) (rand : List Poly) :

    The randomness bijection of the secrecy proof: add (sᵦ + s'ᵦ)·gₜ to byte b's coefficients.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The key identity: t · gₜ(t) = 1 on T #

      theorem QedShare.Shamir.vanishing_eq_cons (T : List GF256) (hT : ∀ (t : GF256), t ∈ T → t ≠ 0) :

      The vanishing polynomial has constant term 1: it is 1 followed by vanishingTail.

      theorem QedShare.Shamir.mul_eval_vanishingTail (T : List GF256) (hT : ∀ (t : GF256), t ∈ T → t ≠ 0) (t : GF256) (ht : t ∈ T) :
      t * (vanishingTail T).eval t = 1

      At each t ∈ T, t · vanishingTail(t) = 1 (because vanishing(t) = 0).

      theorem QedShare.Shamir.eval_shift_byte (T : List GF256) (hT : ∀ (t : GF256), t ∈ T → t ≠ 0) (t : GF256) (ht : t ∈ T) (s s' : GF256) (r : Poly) :
      Poly.eval (s' :: r.add (Poly.smul (s + s') (vanishingTail T))) t = Poly.eval (s :: r) t

      One secret byte: shifting the coefficients does not change the value at a point of T.

      Shape and involution #

      vanishingTail T has one coefficient per element of T.

      theorem QedShare.Shamir.add_add_cancel (r q : Poly) (h : List.length q ≤ List.length r) :
      (r.add q).add q = r

      Adding the same polynomial twice cancels (characteristic 2).

      theorem QedShare.Shamir.length_shift (T s s' : List GF256) (rand : List Poly) :
      (shift T s s' rand).length = min (min s.length s'.length) rand.length

      shift keeps one random polynomial per secret byte.

      theorem QedShare.Shamir.shift_valid (p : Params) (T : List GF256) (hk : T.length ≤ p.k - 1) (s s' : List GF256) (hs : s.length = s'.length) (rand : List Poly) (hr : ValidRand p s.length rand) :
      ValidRand p s.length (shift T s s' rand)

      shift turns valid randomness into valid randomness (right count, right lengths).

      theorem QedShare.Shamir.shift_shift (p : Params) (T : List GF256) (hk : T.length ≤ p.k - 1) (s s' : List GF256) (rand : List Poly) (hr : ValidRand p s.length rand) (hs : s.length = s'.length) :
      shift T s s' (shift T s s' rand) = rand

      shift is its own inverse, so it is a bijection on randomness.

      theorem QedShare.Shamir.view_shift (T : List GF256) (hT : ∀ (t : GF256), t ∈ T → t ≠ 0) (s s' : List GF256) (hs : s.length = s'.length) (rand : List Poly) :
      List.map (shareAt s rand) T = List.map (shareAt s' (shift T s s' rand)) T

      The shares at T are the same for (s, r) and (s', shift r).

      theorem QedShare.Shamir.perfect_secrecy (p : Params) (T : List GF256) (hT : ∀ (t : GF256), t ∈ T → t ≠ 0) (hk : T.length ≤ p.k - 1) (s s' : List GF256) (hs : s.length = s'.length) :
      (∀ (r : List Poly), ValidRand p s.length r → ValidRand p s.length (shift T s s' r)) ∧ (∀ (r : List Poly), ValidRand p s.length r → shift T s s' (shift T s s' r) = r) ∧ ∀ (r : List Poly), List.map (shareAt s r) T = List.map (shareAt s' (shift T s s' r)) T

      Perfect secrecy. For any set T of at most k − 1 nonzero share indices and any two secrets s, s' of the same length, the map σ = shift T s s' on randomness

      1. maps valid randomness to valid randomness,
      2. is its own inverse (so it is a bijection), and
      3. makes the shares at T for secret s with randomness r equal to the shares at T for secret s' with randomness σ r.

      Hence every view of k − 1 shares is equally consistent with every secret.