Documentation

CslibFrontier.Crypto.Computational.Pairing.BLS

The BLS signature scheme in the random-oracle model #

This module formalizes the Boneh–Lynn–Shacham (BLS) signature scheme ([BS23], Section 15.5.1, pp. 627–629) in the random-oracle model, together with:

Notice that succProbability_eufCmaGame_blsTypedROMScheme_le bounds a distribution-level reduction for an explicit typed call-bounded forger with ideal key generation, so it is a step toward Theorem 15.1. The full asymptotic ROMSignature.EUFCMA and ROMSignature.SUFCMA theorems with explicit uniform strict-PPT co-CDH reductions and native key sampling are proved in CslibFrontier.Crypto.Computational.Pairing.BLSSecurity.

Main definitions #

Main results #

References #

Pairing group families with decodable G₀ #

A pairing group family whose first source group G₀ admits a canonical polynomial-time recognizable decoder (DecodablePrimeOrderGroupFamily), so arbitrary signature bit strings can be tested and decoded in polynomial time without external validity stand-ins.

View the first source group of P as a DecodablePrimeOrderGroupFamily.

Boolean group-element membership test on G₀: true iff P.decode₀ d w succeeds.

@[reducible, inline]
abbrev Cslib.Crypto.DecodablePairingGroupFamily.ofDecodable (F₀ : DecodablePrimeOrderGroupFamily) (G₁ GT : F₀.Companion) (pair : (d : F₀.Desc) → F₀.Carrier d →ₗ[ZMod (F₀.order d)] G₁.Carrier d →ₗ[ZMod (F₀.order d)] GT.Carrier d) (pair_generator : ∀ (d : F₀.Desc), ((pair d) (F₀.generator d)) (G₁.generator d) = GT.generator d) (pairEncoded : F₀.Desc × List Bool × List Bool → List Bool) (pairEncoded_encode : ∀ (d : F₀.Desc) (u : F₀.Carrier d) (v : G₁.Carrier d), pairEncoded (d, F₀.encode d u, G₁.encode d v) = GT.encode d (((pair d) u) v)) (computableInPolyTime_pairEncoded : Turing.MultiTapeTM.ComputableInPolyTime pairEncoded (encDescBitsPair F₀.encDesc) Turing.MultiTapeTM.encBits) :

Build a DecodablePairingGroupFamily from a DecodablePrimeOrderGroupFamily for G₀ and the remaining pairing components.

Shared memoize preservation and unique-signature helpers #

@[instance_reducible]

Canonical Fintype instance on P.G₀.Carrier d, matching ZMod (P.G₀.order d) via P.G₀.smul_generator_bijective d.

Typed BLS scheme in the random-oracle model #

The typed BLS signature scheme ([BS23], Section 15.5.1, pp. 627–628) over P and fixed parameters d : P.G₀.Desc, with H : List Bool → P.G₀.Carrier d modeled as a random oracle returning uniform elements of G₀.

Non-degeneracy / unique-pairing rule: pairing with g₁ is injective on G₀ (e(σ₁, g₁) = e(σ₂, g₁) ↔ σ₁ = σ₂).

Correctness of the typed BLS signature scheme: every honest signature verifies.

theorem Cslib.Crypto.PairingGroupFamily.blsTypedROMScheme_unique (P : PairingGroupFamily) (d : P.G₀.Desc) (u : P.G₁.Carrier d) (h σ₁ σ₂ : P.G₀.Carrier d) (h₁ : ((P.pair d) h) u = ((P.pair d) σ₁) (P.G₁.generator d)) (h₂ : ((P.pair d) h) u = ((P.pair d) σ₂) (P.G₁.generator d)) :
σ₁ = σ₂

Unique signatures for typed BLS: for any public key u, hash point h, and candidate signatures σ₁, σ₂, if both satisfy the verification equation for (u, h) then σ₁ = σ₂.

Strong = existential unforgeability for typed BLS: because signatures are unique per (u, m, H(m)), sufCmaGame and eufCmaGame define the exact same distribution for every forger.

Banked Coron reduction and typed Theorem 15.1 bound #

Challenge element represented by a Coron sample (c, ρ) : Bool × ZMod q relative to v₀ : G₀: v₀ + ρ • g₀ when c = true, and ρ • g₀ when c = false.

Presampled Coron co-CDH step: maintains (table, aborted, count) where each new hash point draws the next (c, ρ) from samples ((false, 0) beyond samples). Hash queries return coronSampleElem d v₀ (c, ρ); signing queries return ρ • u₀ when c = false and mark aborted = true when c = true.

Finish the banked Coron co-CDH reduction after the forger outputs msig.

noncomputable def Cslib.Crypto.PairingGroupFamily.blsBankedReduction (P : PairingGroupFamily) (d : P.G₀.Desc) (A : Protocols.ROMSignature.Forger (P.G₁.Carrier d) (List Bool) (P.G₀.Carrier d) (List Bool) (P.G₀.Carrier d)) (K : ℕ) (coin : PMF Bool) (u₀ : P.G₀.Carrier d) (u₁ : P.G₁.Carrier d) (v₀ : P.G₀.Carrier d) :

Distribution-level banked Coron co-CDH reduction for an arbitrary typed Forger.

Quantitative Coron bound for typed BLS (blsTypedROMScheme): for any typed call-bounded forger A (Qs signing calls, Qro hash calls) and any Bernoulli coin coin with (coin true).toReal = a⁻¹ and Qs + 1 ≤ a, the EUF-CMA success probability is at most 2.72 * a times the co-CDH success probability of P.blsBankedReduction d A (Qs + Qro + 1) coin.

Quantitative Coron co-CDH bound for typed BLS ([BS23], Theorem 15.1, eq. (15.9), p. 629): for any typed call-bounded forger A making at most Qs signing queries and Qro hash queries, succProbability (eufCmaGame (P.blsTypedROMScheme d) A) ≤ 2.72 * (Qs + 1) * ... for P.blsBankedReduction.

Native word-level BLS algorithms and scheme #

Native BLS signing on encoded hash digests: query msg, reading at most limit reply bits, then scalar-multiply the encoded digest in G₀ by ofBits sk.

Native BLS verification on bit-string signatures: query msg, reading at most limit reply bits, test P.isElem₀ (d, sig), and check P.pairEncoded (d, hBits, pk) = P.pairEncoded (d, sig, encode g₁).

The native word-level BLS signature scheme in the random-oracle model ([BS23], Section 15.5.1, pp. 627–628) at security parameter n and group parameters d. Key generation samples sk ← P.G₁.toFamily.sampleExp n d and sets pk := encode (sk • g₁) via P.G₁.toFamily.schnorrSigKeyGen n d. Verification rejects non-canonical signature words via P.isElem₀.

theorem Cslib.Crypto.DecodablePairingGroupFamily.runWith_blsWordSign (P : DecodablePairingGroupFamily) (n : ℕ) (d : P.G₀.Desc) {limit : ℕ} (hlim : ∀ (h : P.G₀.Carrier d), (P.G₀.encode d h).length ≤ limit) {Store : Type} (reply : List Bool → StateT Store PMF (P.G₀.Carrier d)) (sk msg : List Bool) (state : Store) :
ProbOracleComp.runWith (fun (q : Unit × List Bool) (st : Store) => PMF.map (Prod.map (P.G₀.encode d) id) (reply q.2 st)) (P.blsWordSign d limit sk msg) state = OracleComp.runWith reply ((P.blsNativeROMScheme n d).sign sk msg ()) state

Exact joint realization of blsWordSign against any stateful G₀ oracle whenever every canonical digest encoding has length at most limit.

theorem Cslib.Crypto.DecodablePairingGroupFamily.runWith_blsWordVerify (P : DecodablePairingGroupFamily) (n : ℕ) (d : P.G₀.Desc) {limit : ℕ} (hlim : ∀ (h : P.G₀.Carrier d), (P.G₀.encode d h).length ≤ limit) {Store : Type} (reply : List Bool → StateT Store PMF (P.G₀.Carrier d)) (pk msg sig : List Bool) (state : Store) :
ProbOracleComp.runWith (fun (q : Unit × List Bool) (st : Store) => PMF.map (Prod.map (P.G₀.encode d) id) (reply q.2 st)) (P.blsWordVerify d limit pk msg sig) state = OracleComp.runWith reply ((P.blsNativeROMScheme n d).verify pk msg sig) state

Exact joint realization of blsWordVerify against any stateful G₀ oracle whenever every canonical digest encoding has length at most limit.

Correctness of blsNativeROMScheme: every generated key pair and signature verifies.

theorem Cslib.Crypto.DecodablePairingGroupFamily.blsNativeROMScheme_unique_of_canonical (P : DecodablePairingGroupFamily) (d : P.G₀.Desc) (u : P.G₁.Carrier d) (h : P.G₀.Carrier d) (sig₁ sig₂ : List Bool) (h₁ : P.isElem₀ (d, sig₁) = true ∧ P.pairEncoded (d, P.G₀.encode d h, P.G₁.encode d u) = P.pairEncoded (d, sig₁, P.G₁.encode d (P.G₁.generator d))) (h₂ : P.isElem₀ (d, sig₂) = true ∧ P.pairEncoded (d, P.G₀.encode d h, P.G₁.encode d u) = P.pairEncoded (d, sig₂, P.G₁.encode d (P.G₁.generator d))) :
sig₁ = sig₂

Canonical unique signatures for native BLS verification under a canonical G₁ public key P.G₁.encode d u: checking P.isElem₀ and the pairing equation determines sig : List Bool uniquely.

Strong = existential unforgeability for native BLS: for every word forger, wordSufCmaGame and wordEufCmaGame coincide.

theorem Cslib.Crypto.DecodablePairingGroupFamily.sufCma_iff_eufCma_blsNativeROMScheme (P : DecodablePairingGroupFamily) (description : ℕ → P.G₀.Desc) [(n : ℕ) → Fintype (P.G₀.Carrier (description n))] :
(Protocols.ROMSignature.SUFCMA (fun (n : ℕ) => { toFun := P.G₀.encode (description n), inj' := ⋯ }) fun (n : ℕ) => P.blsNativeROMScheme n (description n)) ↔ Protocols.ROMSignature.EUFCMA (fun (n : ℕ) => { toFun := P.G₀.encode (description n), inj' := ⋯ }) fun (n : ℕ) => P.blsNativeROMScheme n (description n)

Native BLS SUF-CMA ↔ EUF-CMA: strong unforgeability and existential unforgeability coincide in the random-oracle model.