Bilinear Pairing Groups #
This file defines bilinear pairing groups (Type III pairings) integrated with Mathlib's algebraic hierarchy.
Main definitions #
PairingGroup— class bundling G₁, G₂, GT with bilinear, non-degenerate pairinge_bilinear—e(g₁^a, g₂^b) = e(g₁, g₂)^(a*b)zpowZMod₁/₂— exponentiation by ZMod elementssrs₁/srs₂— Structured Reference Strings for KZG
References #
- [Kate, Zaverucha, Goldberg, Constant-Size Commitments to Polynomials and Their Applications, ASIACRYPT 2010]
Pairing Group Class #
A bilinear pairing group (Type III setting).
Groups are in multiplicative notation with CommGroup instances.
The pairing e : G₁ → G₂ → GT is bilinear and non-degenerate.
- G₁ : Type
Source group 1
- G₂ : Type
Source group 2
- GT : Type
Target group
- p : ℕ
Prime order of all groups
- instDecEqG₁ : DecidableEq G₁
- instDecEqG₂ : DecidableEq G₂
- instDecEqGT : DecidableEq GT
Cardinality constraints
- g₁ : G₁
Generator of G₁
- g₂ : G₂
Generator of G₂
g₁ generates G₁
g₂ generates G₂
Bilinear pairing function
Bilinearity in first argument
Bilinearity in second argument
Non-degeneracy: e(g₁, g₂) ≠ 1
Instances
Nonempty instances #
Basic pairing lemmas #
Power lemmas #
ZMod exponentiation #
Exponentiate by a ZMod P.p element via its value representative
Equations
- CatCrypt.Crypto.PairingGroup.zpowZMod₁ x a = x ^ ↑a.val
Instances For
Equations
- CatCrypt.Crypto.PairingGroup.zpowZMod₂ x a = x ^ ↑a.val
Instances For
Equations
- CatCrypt.Crypto.PairingGroup.zpowZModT x a = x ^ ↑a.val
Instances For
Notation: x ^ᵍ a for ZMod exponentiation in G₁.
The exponent binds tighter than relational/arithmetic operators, so
g ^ᵍ s = a * pk ^ᵍ c parses as (g ^ᵍ s) = (a * (pk ^ᵍ c)).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Notation: x ^ʰ a for ZMod exponentiation in G₂ (same precedence as ^ᵍ).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Generator order #
g₁ has order p (since it generates G₁ of cardinality p)
g₂ has order p
zpowZMod lemmas #
Any element of G₁ raised to p is 1
Any element of G₁: x ^ n = x ^ (n % p)
Product of zpowZMod₁ over a finset equals zpowZMod₁ of the sum
e(g₁, g₂)^p = 1
General power lemmas (for arbitrary group elements) #
Order-theoretic lemmas #
e(g₁, g₂) has order p in GT
Non-degeneracy gives first-argument injectivity: if e(x, g₂) = 1, then x = 1.
g₁ ^ᵍ a = 1 iff a = 0
Power bijection #
x ^ᵍ 1 = x
x ↦ x ^ᵍ sk is a bijection on G₁ when sk ≠ 0.
The inverse is x ↦ x ^ᵍ sk⁻¹. This uses the composition law
zpowZMod₁_zpowZMod₁ and the fact that ZMod p is a field.
Equations
- One or more equations did not get rendered due to their size.
Instances For
SRS (Structured Reference String) #
The Structured Reference String for KZG: [g₁, g₁^α, g₁^(α²), ..., g₁^(αᵗ)]
Equations
Instances For
SRS in G₂: [g₂, g₂^α] (just two elements needed for verification)