Documentation

CslibFrontier.Crypto.Computational.Pairing.Assumptions

Pairing-based hardness assumptions and direct consequences #

This module formalizes the co-Computational Diffie–Hellman (co-CDH) and Decision Bilinear Diffie–Hellman (Decision BDH) assumptions over pairing groups, together with the direct algebraic consequences of a pairing from [BS23], Sections 15.4–15.6.

All family assumptions allow an arbitrary setup : ℕ → PMF F.Desc rather than an efficient group generator; they coincide with the textbook assumptions when setup is efficiently samplable. They are hypotheses, not theorems.

Main definitions #

Main results #

References #

Fixed-group co-CDH and Decision BDH experiments #

noncomputable def Cslib.Crypto.coCdhExperiment {G₀ G₁ : Type} [AddCommGroup G₀] [DecidableEq G₀] [AddCommGroup G₁] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] (g₀ : G₀) (g₁ : G₁) (A : G₀ → G₁ → G₀ → ProbComp G₀) :

The co-Computational Diffie–Hellman experiment ([BS23], Attack Game 15.1, p. 628) in fixed groups G₀ and G₁ of order q: draw uniform α, β : ZMod q, give (α • g₀, α • g₁, β • g₀) to A, and accept when A outputs (α * β) • g₀.

noncomputable def Cslib.Crypto.coCdhAdvantage {G₀ G₁ : Type} [AddCommGroup G₀] [DecidableEq G₀] [AddCommGroup G₁] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] (g₀ : G₀) (g₁ : G₁) (A : G₀ → G₁ → G₀ → ProbComp G₀) :

The co-CDH advantage of A: its success probability in coCdhExperiment.

theorem Cslib.Crypto.coCdhExperiment_ignoreSecond {G₀ G₁ : Type} [AddCommGroup G₀] [DecidableEq G₀] [AddCommGroup G₁] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] (g₀ : G₀) (g₁ : G₁) (A : G₀ → G₀ → ProbComp G₀) :
(coCdhExperiment q g₀ g₁ fun (u₀ : G₀) (x : G₁) (v₀ : G₀) => A u₀ v₀) = cdhExperiment q g₀ A

Ignoring the G₁ element in coCdhExperiment yields cdhExperiment in G₀.

theorem Cslib.Crypto.coCdhExperiment_self {G₀ : Type} [AddCommGroup G₀] [DecidableEq G₀] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] {g : G₀} (A : G₀ → G₀ → G₀ → ProbComp G₀) :
coCdhExperiment q g g A = cdhExperiment q g fun (u v : G₀) => A u u v

When G₁ = G₀ and g₁ = g₀, feeding u as both u₀ and u₁ reduces coCdhExperiment to cdhExperiment.

noncomputable def Cslib.Crypto.dbdhRealExperiment {G₀ G₁ GT : Type} [AddCommGroup G₀] [AddCommGroup G₁] [AddCommGroup GT] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] [Module (ZMod q) GT] (g₀ : G₀) (g₁ : G₁) (gT : GT) (D : G₀ → G₁ → G₀ → G₁ → GT → ProbComp Bool) :

The real world of the Decision Bilinear Diffie–Hellman experiment ([BS23], Attack Game 15.8, Experiment 0, p. 649): draw uniform α, β, γ : ZMod q and give (α • g₀, α • g₁, β • g₀, γ • g₁, (α * β * γ) • gT) to D. The book's unused δ does not affect the law.

noncomputable def Cslib.Crypto.dbdhRandomExperiment {G₀ G₁ GT : Type} [AddCommGroup G₀] [AddCommGroup G₁] [AddCommGroup GT] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] [Module (ZMod q) GT] (g₀ : G₀) (g₁ : G₁) (gT : GT) (D : G₀ → G₁ → G₀ → G₁ → GT → ProbComp Bool) :

The random world of the Decision Bilinear Diffie–Hellman experiment ([BS23], Attack Game 15.8, Experiment 1, p. 649): draw uniform α, β, γ, δ : ZMod q and give (α • g₀, α • g₁, β • g₀, γ • g₁, δ • gT) to D.

noncomputable def Cslib.Crypto.dbdhAdvantage {G₀ G₁ GT : Type} [AddCommGroup G₀] [AddCommGroup G₁] [AddCommGroup GT] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] [Module (ZMod q) GT] (g₀ : G₀) (g₁ : G₁) (gT : GT) (D : G₀ → G₁ → G₀ → G₁ → GT → ProbComp Bool) :

The Decision BDH advantage of D: its distinguishing advantage between dbdhRealExperiment and dbdhRandomExperiment.

theorem Cslib.Crypto.eval_dbdhRealExperiment {G₀ G₁ GT : Type} [AddCommGroup G₀] [AddCommGroup G₁] [AddCommGroup GT] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] [Module (ZMod q) GT] (g₀ : G₀) (g₁ : G₁) (gT : GT) (D : G₀ → G₁ → G₀ → G₁ → GT → ProbComp Bool) :
ProbComp.eval (dbdhRealExperiment q g₀ g₁ gT D) = (Probability.PMF.uniformOfFintype (ZMod q)).bind fun (a : ZMod q) => (Probability.PMF.uniformOfFintype (ZMod q)).bind fun (b : ZMod q) => (Probability.PMF.uniformOfFintype (ZMod q)).bind fun (c : ZMod q) => (D (a • g₀) (a • g₁) (b • g₀) (c • g₁) ((a * b * c) • gT)).eval

The law of dbdhRealExperiment: uniform a, b, c : ZMod q at the PMF level.

theorem Cslib.Crypto.eval_dbdhRandomExperiment {G₀ G₁ GT : Type} [AddCommGroup G₀] [AddCommGroup G₁] [AddCommGroup GT] (q : ℕ) [NeZero q] [Module (ZMod q) G₀] [Module (ZMod q) G₁] [Module (ZMod q) GT] (g₀ : G₀) (g₁ : G₁) (gT : GT) (D : G₀ → G₁ → G₀ → G₁ → GT → ProbComp Bool) :
ProbComp.eval (dbdhRandomExperiment q g₀ g₁ gT D) = (Probability.PMF.uniformOfFintype (ZMod q)).bind fun (a : ZMod q) => (Probability.PMF.uniformOfFintype (ZMod q)).bind fun (b : ZMod q) => (Probability.PMF.uniformOfFintype (ZMod q)).bind fun (c : ZMod q) => (Probability.PMF.uniformOfFintype (ZMod q)).bind fun (d : ZMod q) => (D (a • g₀) (a • g₁) (b • g₀) (c • g₁) (d • gT)).eval

The law of dbdhRandomExperiment: uniform a, b, c, d : ZMod q at the PMF level.

Asymptotic co-CDH assumption over a family and companion #

The input of a co-CDH adversary: the security parameter, public group parameters d, elements u₀ = α • g₀, u₁ = α • g₁, and v₀ = β • g₀.

  • secParam : ℕ

    The security parameter, given to machines in unary.

  • groupParameters : F.Desc

    Public parameters selecting the groups F.Carrier d and C.Carrier d.

  • leftZero : F.Carrier self.groupParameters

    First base challenge α • g₀ ∈ G₀.

  • leftOne : C.Carrier self.groupParameters

    Companion challenge α • g₁ ∈ G₁.

  • rightZero : F.Carrier self.groupParameters

    Second base challenge β • g₀ ∈ G₀.

theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_mk_polyTime (F : PrimeOrderGroupFamily) (C : F.Companion) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → ℕ} {x1 : γ → F.Desc} {x2 : (c : γ) → F.Carrier (x1 c)} {x3 : (c : γ) → C.Carrier (x1 c)} {x4 : (c : γ) → F.Carrier (x1 c)} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn Turing.MultiTapeTM.encUnary) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn F.encDesc) (h2 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => F.encode (x1 c) (x2 c)) encIn Turing.MultiTapeTM.encBits) (h3 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => C.encode (x1 c) (x3 c)) encIn Turing.MultiTapeTM.encBits) (h4 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => F.encode (x1 c) (x4 c)) encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftZero := x2 x, leftOne := x3 x, rightZero := x4 x }) encIn (F.encCoCDHInput C)
theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_mk_inO (F : PrimeOrderGroupFamily) (C : F.Companion) {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → F.Desc} {T1 S1 : γ → ℕ} {x2 : (c : γ) → F.Carrier (x1 c)} {T2 S2 : γ → ℕ} {x3 : (c : γ) → C.Carrier (x1 c)} {T3 S3 : γ → ℕ} {x4 : (c : γ) → F.Carrier (x1 c)} {T4 S4 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn F.encDesc T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => F.encode (x1 c) (x2 c)) encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => C.encode (x1 c) (x3 c)) encIn Turing.MultiTapeTM.encBits T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => F.encode (x1 c) (x4 c)) encIn Turing.MultiTapeTM.encBits T4 S4) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftZero := x2 x, leftOne := x3 x, rightZero := x4 x }) encIn (F.encCoCDHInput C) (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))

Encoding of a co-CDH input: unary security parameter, F.encDesc, and encoded elements F.encode d u₀, C.encode d u₁, F.encode d v₀, each framed except the last.

theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_rightZero_budget (F : PrimeOrderGroupFamily) (C : F.Companion) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → F.CoCDHInput C} :
theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_groupParameters_budget (F : PrimeOrderGroupFamily) (C : F.Companion) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → F.CoCDHInput C} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (F.encCoCDHInput C) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).groupParameters) encIn✝ F.encDesc S✝
theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_leftZero_budget (F : PrimeOrderGroupFamily) (C : F.Companion) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → F.CoCDHInput C} :
theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_leftOne_budget (F : PrimeOrderGroupFamily) (C : F.Companion) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → F.CoCDHInput C} :
theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_secParam_budget (F : PrimeOrderGroupFamily) (C : F.Companion) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → F.CoCDHInput C} :
theorem Cslib.Crypto.PrimeOrderGroupFamily.encCoCDHInput_mk_budget (F : PrimeOrderGroupFamily) (C : F.Companion) {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → F.Desc} {x2 : (c : γ) → F.Carrier (x1 c)} {x3 : (c : γ) → C.Carrier (x1 c)} {x4 : (c : γ) → F.Carrier (x1 c)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn F.encDesc budget) (h2 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => F.encode (x1 c) (x2 c)) encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => C.encode (x1 c) (x3 c)) encIn Turing.MultiTapeTM.encBits budget) (h4 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => F.encode (x1 c) (x4 c)) encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftZero := x2 x, leftOne := x3 x, rightZero := x4 x }) encIn (F.encCoCDHInput C) budget
@[reducible, inline]

A co-CDH adversary over F and companion C: given the security parameter, group parameters d, and (u₀, u₁, v₀), it outputs an element of F.Carrier d.

A co-CDH adversary is PPT when one uniform strict PPT machine reads F.encCoCDHInput C and writes the encoding of the adversary's output element in F.Carrier d.

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.coCdhGame (F : PrimeOrderGroupFamily) (C : F.Companion) (setup : ℕ → PMF F.Desc) (adversary : F.CoCDHAdversary C) (n : ℕ) :

The co-CDH game ([BS23], Attack Game 15.1, p. 628): draw group parameters d from the arbitrary setup law, then run coCdhExperiment in (F.Carrier d, C.Carrier d).

The co-Computational Diffie–Hellman assumption ([BS23], Attack Game 15.1 and Definition 15.3, p. 628) for a family F, companion C, and setup law setup: every uniform strict PPT co-CDH adversary wins coCdhGame with negligible probability. As for CDH and DiscreteLog, setup is an arbitrary ℕ → PMF F.Desc rather than an efficient group generator; this matches the source when setup is efficiently samplable.

Embed a CDH adversary into a co-CDH adversary by ignoring the G₁ challenge u₁.

Wrapping a PPT CDH adversary to ignore u₁ preserves uniform strict PPT.

@[simp]
theorem Cslib.Crypto.PrimeOrderGroupFamily.coCdhGame_cdhToCoCDHAdversary (F : PrimeOrderGroupFamily) (C : F.Companion) (setup : ℕ → PMF F.Desc) (adversary : F.CDHAdversary) (n : ℕ) :
F.coCdhGame C setup (F.cdhToCoCDHAdversary C adversary) n = F.cdhGame setup adversary n

coCdhGame of cdhToCoCDHAdversary equals cdhGame of adversary.

theorem Cslib.Crypto.PrimeOrderGroupFamily.CoCDH.cdh {F : PrimeOrderGroupFamily} {C : F.Companion} {setup : ℕ → PMF F.Desc} (h : F.CoCDH C setup) :
F.CDH setup

Co-CDH implies CDH in F for every companion C: ignoring u₁ = α • g₁ turns any CDH adversary into a co-CDH adversary with the same success probability.

Co-CDH implies DiscreteLog in F for every companion C.

Embed a symmetric co-CDH adversary (where C = F.self) into a CDH adversary by duplicating u = α • g₀ into both G₀ and G₁ slots.

Duplicating u preserves uniform strict PPT.

@[simp]
theorem Cslib.Crypto.PrimeOrderGroupFamily.coCdhGame_self_eq (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (adversary : F.CoCDHAdversary F.self) (n : ℕ) :
F.coCdhGame F.self setup adversary n = F.cdhGame setup (F.coCdhSelfToCDHAdversary adversary) n

In the symmetric case C = F.self, coCdhGame coincides with cdhGame of coCdhSelfToCDHAdversary.

Symmetric co-CDH is equivalent to CDH ([BS23], Section 15.5.1, p. 629): when C = F.self (G₁ = G₀ and g₁ = g₀), F.CoCDH F.self setup ↔ F.CDH setup.

Asymptotic Decision BDH assumption over a pairing group family #

The input of a Decision BDH distinguisher: security parameter, group parameters d, and the five elements (u₀, u₁, v₀, w₁, z) of [BS23], Attack Game 15.8 (p. 649).

theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_groupParameters_budget (P : PairingGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → P.DBDHInput} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ P.encDBDHInput S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).groupParameters) encIn✝ P.G₀.encDesc S✝
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_mk_inO (P : PairingGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → P.G₀.Desc} {T1 S1 : γ → ℕ} {x2 : (c : γ) → P.G₀.Carrier (x1 c)} {T2 S2 : γ → ℕ} {x3 : (c : γ) → P.G₁.Carrier (x1 c)} {T3 S3 : γ → ℕ} {x4 : (c : γ) → P.G₀.Carrier (x1 c)} {T4 S4 : γ → ℕ} {x5 : (c : γ) → P.G₁.Carrier (x1 c)} {T5 S5 : γ → ℕ} {x6 : (c : γ) → P.GT.Carrier (x1 c)} {T6 S6 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn P.G₀.encDesc T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => P.G₀.encode (x1 c) (x2 c)) encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => P.G₁.encode (x1 c) (x3 c)) encIn Turing.MultiTapeTM.encBits T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => P.G₀.encode (x1 c) (x4 c)) encIn Turing.MultiTapeTM.encBits T4 S4) (h5 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => P.G₁.encode (x1 c) (x5 c)) encIn Turing.MultiTapeTM.encBits T5 S5) (h6 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => P.GT.encode (x1 c) (x6 c)) encIn Turing.MultiTapeTM.encBits T6 S6) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftZero := x2 x, leftOne := x3 x, rightZero := x4 x, thirdOne := x5 x, candidateTarget := x6 x }) encIn P.encDBDHInput (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + (T4 x + (T5 x + T6 x)))))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + (S4 x + (S5 x + S6 x)))))
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_candidateTarget_budget (P : PairingGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → P.DBDHInput} :
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_leftZero_budget (P : PairingGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → P.DBDHInput} :
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_mk_budget (P : PairingGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → P.G₀.Desc} {x2 : (c : γ) → P.G₀.Carrier (x1 c)} {x3 : (c : γ) → P.G₁.Carrier (x1 c)} {x4 : (c : γ) → P.G₀.Carrier (x1 c)} {x5 : (c : γ) → P.G₁.Carrier (x1 c)} {x6 : (c : γ) → P.GT.Carrier (x1 c)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn P.G₀.encDesc budget) (h2 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => P.G₀.encode (x1 c) (x2 c)) encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => P.G₁.encode (x1 c) (x3 c)) encIn Turing.MultiTapeTM.encBits budget) (h4 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => P.G₀.encode (x1 c) (x4 c)) encIn Turing.MultiTapeTM.encBits budget) (h5 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => P.G₁.encode (x1 c) (x5 c)) encIn Turing.MultiTapeTM.encBits budget) (h6 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => P.GT.encode (x1 c) (x6 c)) encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftZero := x2 x, leftOne := x3 x, rightZero := x4 x, thirdOne := x5 x, candidateTarget := x6 x }) encIn P.encDBDHInput budget
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_mk_polyTime (P : PairingGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → ℕ} {x1 : γ → P.G₀.Desc} {x2 : (c : γ) → P.G₀.Carrier (x1 c)} {x3 : (c : γ) → P.G₁.Carrier (x1 c)} {x4 : (c : γ) → P.G₀.Carrier (x1 c)} {x5 : (c : γ) → P.G₁.Carrier (x1 c)} {x6 : (c : γ) → P.GT.Carrier (x1 c)} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn Turing.MultiTapeTM.encUnary) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn P.G₀.encDesc) (h2 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => P.G₀.encode (x1 c) (x2 c)) encIn Turing.MultiTapeTM.encBits) (h3 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => P.G₁.encode (x1 c) (x3 c)) encIn Turing.MultiTapeTM.encBits) (h4 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => P.G₀.encode (x1 c) (x4 c)) encIn Turing.MultiTapeTM.encBits) (h5 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => P.G₁.encode (x1 c) (x5 c)) encIn Turing.MultiTapeTM.encBits) (h6 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => P.GT.encode (x1 c) (x6 c)) encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftZero := x2 x, leftOne := x3 x, rightZero := x4 x, thirdOne := x5 x, candidateTarget := x6 x }) encIn P.encDBDHInput
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_secParam_budget (P : PairingGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → P.DBDHInput} :
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_thirdOne_budget (P : PairingGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → P.DBDHInput} :

Encoding of a Decision BDH input: unary security parameter, P.G₀.encDesc, and the five encoded group elements, each framed except the last.

theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_rightZero_budget (P : PairingGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → P.DBDHInput} :
theorem Cslib.Crypto.PairingGroupFamily.encDBDHInput_leftOne_budget (P : PairingGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → P.DBDHInput} :
@[reducible, inline]

A Decision BDH distinguisher over P: given (n, d, u₀, u₁, v₀, w₁, z), it outputs a bit.

A Decision BDH distinguisher is PPT when one uniform strict PPT machine reads P.encDBDHInput and writes its output bit.

noncomputable def Cslib.Crypto.PairingGroupFamily.dbdhRealGame (P : PairingGroupFamily) (setup : ℕ → PMF P.G₀.Desc) (distinguisher : P.DBDHDistinguisher) (n : ℕ) :

The real Decision BDH game ([BS23], Attack Game 15.8, Experiment 0, p. 649): draw group parameters d from setup n and run dbdhRealExperiment with gT = P.GT.generator d (matching e(g₀, g₁) by P.pair_generator d).

noncomputable def Cslib.Crypto.PairingGroupFamily.dbdhRandomGame (P : PairingGroupFamily) (setup : ℕ → PMF P.G₀.Desc) (distinguisher : P.DBDHDistinguisher) (n : ℕ) :

The random Decision BDH game ([BS23], Attack Game 15.8, Experiment 1, p. 649): draw group parameters d from setup n and run dbdhRandomExperiment with gT = P.GT.generator d.

The Decision Bilinear Diffie–Hellman assumption ([BS23], Attack Game 15.8 and Definition 15.12, pp. 649–650) for a pairing group family P and setup law setup: every uniform strict PPT distinguisher has negligible distinguishing advantage between dbdhRealGame and dbdhRandomGame. As for DiscreteLog, setup is an arbitrary ℕ → PMF P.G₀.Desc rather than an efficient parameter generator; this matches the source when setup is efficiently samplable.

@[reducible, inline]

Flat word layout (1ⁿ, d, u₀, u₁, v₀, w₁, z) of encDBDHInput.

theorem Cslib.Crypto.PairingGroupFamily.decisionBDH_iff_encoded (P : PairingGroupFamily) (setup : ℕ → PMF P.G₀.Desc) :
P.DecisionBDH setup ↔ ∀ (distinguisher : ℕ → P.G₀.Desc × List Bool × List Bool × List Bool × List Bool × List Bool → ProbComp Bool), (Probability.IsPPTOn P.encWordDBDHInput Turing.MultiTapeTM.encBool fun (x : ℕ × P.G₀.Desc × List Bool × List Bool × List Bool × List Bool × List Bool) => distinguisher x.1 x.2) → Negligible fun (n : ℕ) => (P.dbdhRealGame setup (fun (n : ℕ) (d : P.G₀.Desc) (u₀ : P.G₀.Carrier d) (u₁ : P.G₁.Carrier d) (v₀ : P.G₀.Carrier d) (w₁ : P.G₁.Carrier d) (z : P.GT.Carrier d) => distinguisher n (d, P.G₀.encode d u₀, P.G₁.encode d u₁, P.G₀.encode d v₀, P.G₁.encode d w₁, P.GT.encode d z)) n).advantage (P.dbdhRandomGame setup (fun (n : ℕ) (d : P.G₀.Desc) (u₀ : P.G₀.Carrier d) (u₁ : P.G₁.Carrier d) (v₀ : P.G₀.Carrier d) (w₁ : P.G₁.Carrier d) (z : P.GT.Carrier d) => distinguisher n (d, P.G₀.encode d u₀, P.G₁.encode d u₁, P.G₀.encode d v₀, P.G₁.encode d w₁, P.GT.encode d z)) n)

DecisionBDH is the word-level Decision BDH assumption: since distinguishers output a single bit, quantifying over distinguishers reading the flat word layout gives the exact same assumption as DecisionBDH.

Direct §15.4 consequences (p. 625) #

The pairing DDH check e(u, v) = e(g₀, w) on encoded group elements ([BS23], equation (15.8), p. 625).

Distinguisher checking equation (15.8) when P is a symmetric pairing (P.G₁ = P.G₀.self).

DDH is easy in a symmetric pairing group ([BS23], Section 15.4, equation (15.8), p. 625): if P.G₁ = P.G₀.self, then checking e(α • g₀, β • g₀) = e(g₀, γ • g₀) distinguishes real DDH triples from random triples with advantage at least 1 / 2 for every setup law.

Lift a target-group discrete-log adversary to P.G₀ via u₀ ↦ P.pair d u₀ g₁ ([BS23], Section 15.4, p. 625).

Discrete-log hardness in G₀ implies discrete-log hardness in GT ([BS23], Section 15.4, p. 625: computing discrete logarithms in G₀ is no harder than in GT).

Lift a target-group discrete-log adversary to P.G₁ via u₁ ↦ P.pair d g₀ u₁ ([BS23], Section 15.4, p. 625).

Discrete-log hardness in G₁ implies discrete-log hardness in GT ([BS23], Section 15.4, p. 625: computing discrete logarithms in G₁ is no harder than in GT).