Documentation

Complexity.Crypto.Protocols.SigmaProtocol.Lyubashevsky.NativeExtract

A uniform serialized Lyubashevsky extractor #

The extractor needs only runtime dimensions m,k, two bit challenges and two optional integer responses. It computes the response difference followed by the signed reversed challenge difference. Dimensions are unary resources; integer magnitudes are binary. Every input word has a total interpretation: missing vector entries are zero, missing challenge bits are false, and surplus coordinates are ignored. The optional-vector default is the zero vector.

The same word program handles all dimensions; no parameter-family claim is inferred from a certificate for one fixed finite vector type. This is a deterministic operation certificate, not a rewinding, knowledge-soundness or cryptographic security theorem.

Main definitions #

Main results #

@[reducible, inline]

Dimensions followed by two challenge/optional-response pairs.

Instances For

    Unary dimensions, raw challenges and framed optional lists of binary signed integers.

    Instances For

      Parse every input word with the existing framing conventions; malformed fields have total zero/default interpretations.

      Instances For

        Compute z-z′ first, then the SIGNED challenge difference c′-c. The unary dimensions control both output segments; optional responses default to zero coordinatewise.

        Instances For
          @[simp]

          Extraction always writes the two declared segments, even on malformed-length inputs.

          theorem Cslib.Crypto.Protocols.SigmaProtocol.lyubashevskyExtractList_ofFn {m k : ℕ} (c : Fin k → Bool) (z : Option (Fin m → ℤ)) (c' : Fin k → Bool) (z' : Option (Fin m → ℤ)) :
          lyubashevskyExtractList ((m, k), (List.ofFn c, Option.map List.ofFn z), List.ofFn c', Option.map List.ofFn z') = List.ofFn (Fin.append (fun (i : Fin m) => z.getD 0 i - z'.getD 0 i) fun (i : Fin k) => (if c' i = true then 1 else 0) - if c i = true then 1 else 0)

          Canonical typed vectors give exactly the ordered response difference and signed reversed challenge difference. This formula is independent of statement matrices and the modulus.

          The complete serialized program: parse, extract, and frame every signed output coordinate.

          Instances For
            theorem Cslib.Crypto.Protocols.SigmaProtocol.lyubashevskyExtractList_eq_extract (n m k q : ℕ) (y : Matrix (Fin n) (Fin m) (ZMod q) × Matrix (Fin n) (Fin k) (ZMod q)) (w : Fin n → ZMod q) (c : BitString k) (z : Option (Fin m → ℤ)) (c' : BitString k) (z' : Option (Fin m → ℤ)) :

            Canonical vectors realize the actual typed extractor for every statement and commitment. The ignored statement dimensions and modulus do not need to be supplied to the word program.

            The complete word program agrees exactly with the named typed extractor, including absent responses and zero dimensions, without assuming acceptance of either conversation.