Documentation

CatCryptCore.Crypto.AGM

Algebraic Group Model (AGM) #

This file formalizes the Algebraic Group Model, where adversaries must provide algebraic representations of all group elements they output.

Main definitions #

Main results #

Overview #

In the AGM, any group element output by the adversary must be accompanied by a vector of exponents showing how it was computed from the input group elements. For KZG, the input is the SRS [g₁, g₁^α, ..., g₁^(αᵗ)], and the output commitment C comes with [c₀, ..., cₜ]. A representation is valid for the SRS srs when C = ∏ srs[i]^cᵢ. Validity is relative to the SRS the game supplies: the game checks it and counts an invalid representation as a loss for the adversary (Fuchsbauer–Kiltz–Loss, Definition 2.1).

A valid representation means the adversary "knows" a polynomial φ(X) = ∑ cᵢ Xⁱ such that C = g₁^(φ(α)), enabling knowledge extraction.

References #

AGM Representation #

A group element of G₁ together with a claimed algebraic representation with respect to a basis of size t + 1: a vector of exponents [c₀, ..., cₜ] in ZMod p. Whether the exponents represent the element depends on the basis and is the proposition AGMRepr.Valid.

Instances For
    def CatCrypt.Crypto.AGMRepr.Valid (P : PairingGroup) (t : ℕ) (repr : AGMRepr P t) (pk : Fin (t + 1) → PairingGroup.G₁) :

    The representation equation against the basis pk: element = ∏ᵢ pk[i]^coeffs[i].

    Equations
    Instances For
      @[instance_reducible]
      noncomputable instance CatCrypt.Crypto.AGMRepr.instDecidableValid (P : PairingGroup) (t : ℕ) (repr : AGMRepr P t) (pk : Fin (t + 1) → PairingGroup.G₁) :
      Decidable (Valid P t repr pk)
      Equations
      noncomputable def CatCrypt.Crypto.AGMRepr.ofCoeffs (P : PairingGroup) (t : ℕ) (pk : Fin (t + 1) → PairingGroup.G₁) (coeffs : Fin (t + 1) → ZMod PairingGroup.p) :

      The representation whose element is computed from the basis pk and the exponent vector coeffs.

      Equations
      Instances For
        theorem CatCrypt.Crypto.AGMRepr.ofCoeffs_valid (P : PairingGroup) (t : ℕ) (pk : Fin (t + 1) → PairingGroup.G₁) (coeffs : Fin (t + 1) → ZMod PairingGroup.p) :
        Valid P t (ofCoeffs P t pk coeffs) pk

        A representation computed from a basis is valid for that basis.

        Extract the polynomial from an AGM representation. The polynomial is φ(X) = ∑ᵢ cᵢ · Xⁱ where cᵢ are the coefficients.

        Equations
        Instances For

          Extracted Polynomial Properties #

          theorem CatCrypt.Crypto.AGMRepr.toPoly_coeff (P : PairingGroup) (t : ℕ) (repr : AGMRepr P t) (j : Fin (t + 1)) :
          (toPoly P t repr).coeff ↑j = repr.coeffs j

          Coefficient of toPoly at position j matches the AGM coefficient.

          The extracted polynomial has degree at most t.

          theorem CatCrypt.Crypto.AGMRepr.toPoly_ofCoeffs_coeff (P : PairingGroup) (t : ℕ) (pk : Fin (t + 1) → PairingGroup.G₁) (φ : Polynomial (ZMod PairingGroup.p)) (hdeg : φ.natDegree ≤ t) :
          toPoly P t (ofCoeffs P t pk fun (i : Fin (t + 1)) => φ.coeff ↑i) = φ

          The representation whose exponents are the first t + 1 coefficients of φ extracts to φ when φ has degree at most t.

          A representation valid for the KZG SRS srs₁ α t has element g₁ ^ᵍ φ(α), where φ is the extracted polynomial.

          AGM Adversary #

          An AGM adversary for KZG.

          In the AGM, the adversary receives the SRS and outputs a commitment C together with an algebraic representation of C in terms of the SRS, an evaluation point, a claimed value, and a witness with its representation. The game that runs the adversary checks the representations against the SRS it supplied.

          Instances For