Documentation

CslibFrontier.Crypto.Computational.DiffieHellman.BlindedFamily

The blinded Diffie–Hellman problems over a group family #

Over a PrimeOrderGroupFamily, this module states the two problems of [BS23], Section 21.11.5, Lemmas 21.7 and 21.8 (pp. 910–911), as games. It gives the book's reductions, which turn an adversary for each problem into a CDH adversary, with PPT certificates, and proves that under the CDH assumption every PPT adversary wins either game with negligible probability. The fixed-group problems (Cslib.Crypto.blindedCDHExperiment, Cslib.Crypto.blindedCDHPairExperiment), the reductions with fixed blinding exponents and their exact analysis are in CslibFrontier/Crypto/Computational/DiffieHellman/Blinded.lean, whose module docstring lists the differences from the book in one group. The book names neither problem: "blinded CDH" and "two-point blinded CDH", and the names of all declarations here, are this library's names.

Adversaries receive and return group elements and exponents. Their efficiency is stated on encodings, as for CDHAdversary.IsPPT: one uniform strict PPT machine reads the encoded input (encBlindedCDHInput, encBlindedCDHPairInput) and writes the answer, the exponents as binary numbers below the group order and the elements as their words.

The reductions draw their blinding exponents with sampleExp, the fair-coin sampler of the other Diffie–Hellman reductions, whose law is within 1 / 2 ^ n of uniform. The bounds therefore carry a sampling loss of 2 / 2 ^ n for Lemma 21.7 (two draws) and 1 / 2 ^ n for Lemma 21.8 (one draw), which the book's "we can easily solve" leaves implicit. The theorems assume only F.CDH setup and the adversary's PPT predicate.

Main definitions #

Main results #

References #

Lemma 21.7 #

The input of an adversary in the blinded CDH game: the security parameter, public group parameters and the four elements a, b, u, v of [BS23], Lemma 21.7.

  • secParam : ℕ

    The security parameter, given to machines in unary.

  • groupParameters : F.Desc

    Public parameters selecting the group.

  • leftBlind : F.Carrier self.groupParameters

    The first blinding element, a = α • g in the experiment.

  • rightBlind : F.Carrier self.groupParameters

    The second blinding element, b = β • g in the experiment.

  • leftPublic : F.Carrier self.groupParameters

    The first public element, u = x • g in the experiment.

  • rightPublic : F.Carrier self.groupParameters

    The second public element, v = y • g in the experiment.

theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHInput_groupParameters_budget (F : PrimeOrderGroupFamily) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → F.BlindedCDHInput} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ F.encBlindedCDHInput S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).groupParameters) encIn✝ F.encDesc S✝
theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHInput_mk_budget (F : PrimeOrderGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → F.Desc} {x2 x3 x4 x5 : (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 : γ) => F.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) (h5 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => F.encode (x1 c) (x5 c)) encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftBlind := x2 x, rightBlind := x3 x, leftPublic := x4 x, rightPublic := x5 x }) encIn F.encBlindedCDHInput budget
theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHInput_mk_polyTime (F : PrimeOrderGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → ℕ} {x1 : γ → F.Desc} {x2 x3 x4 x5 : (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 : γ) => F.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) (h5 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => F.encode (x1 c) (x5 c)) encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftBlind := x2 x, rightBlind := x3 x, leftPublic := x4 x, rightPublic := x5 x }) encIn F.encBlindedCDHInput

The encoding of a blinded CDH input: the unary security parameter, the group parameters and the words of the four elements, each framed except the last (encBlindedCDHInput_apply).

theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHInput_mk_inO (F : PrimeOrderGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → F.Desc} {T1 S1 : γ → ℕ} {x2 : (c : γ) → F.Carrier (x1 c)} {T2 S2 : γ → ℕ} {x3 : (c : γ) → F.Carrier (x1 c)} {T3 S3 : γ → ℕ} {x4 : (c : γ) → F.Carrier (x1 c)} {T4 S4 : γ → ℕ} {x5 : (c : γ) → F.Carrier (x1 c)} {T5 S5 : γ → ℕ} (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 : γ) => F.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) (h5 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => F.encode (x1 c) (x5 c)) encIn Turing.MultiTapeTM.encBits T5 S5) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { secParam := x0 x, groupParameters := x1 x, leftBlind := x2 x, rightBlind := x3 x, leftPublic := x4 x, rightPublic := x5 x }) encIn F.encBlindedCDHInput (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + (T4 x + T5 x))))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + (S4 x + S5 x))))
@[reducible, inline]

An adversary for the blinded CDH problem over the family: given the security parameter, the group parameters and a, b, u, v, it answers an exponent and a group element.

A blinded CDH adversary is PPT when one uniform strict PPT machine reads encBlindedCDHInput and writes the adversary's exponent as a binary number below the order, followed by the word of its value.

The blinded CDH game: choose group parameters with the setup law, then run Cslib.Crypto.blindedCDHExperiment in that group.

The reduction of [BS23], Lemma 21.7, as a CDH adversary: draw the two blinding exponents with sampleExp and run Cslib.Crypto.blindedCDHToCDHWith.

The reduction of [BS23], Lemma 21.7, is efficient: it is uniform strict PPT whenever the adversary is.

Sampling loss of the reduction of [BS23], Lemma 21.7: the blinded CDH game and the CDH game of the reduction accept with probabilities at most 2 / 2 ^ n apart, one 1 / 2 ^ n for each sampleExp draw.

theorem Cslib.Crypto.PrimeOrderGroupFamily.CDH.negligible_blindedCDHGame {F : PrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} (h : F.CDH setup) (adversary : F.BlindedCDHAdversary) (hA : adversary.IsPPT) :
Negligible fun (n : ℕ) => (F.blindedCDHGame setup adversary n).succProbability

[BS23], Lemma 21.7, Section 21.11.5, p. 910: under the CDH assumption, every PPT adversary wins the blinded CDH game with negligible probability.

Lemma 21.8 #

The input of an adversary in the two-point blinded CDH game: the security parameter, public group parameters and the three elements a, b, u of [BS23], Lemma 21.8.

  • secParam : ℕ

    The security parameter, given to machines in unary.

  • groupParameters : F.Desc

    Public parameters selecting the group.

  • leftBlind : F.Carrier self.groupParameters

    The first blinding element, a = α • g in the experiment.

  • rightBlind : F.Carrier self.groupParameters

    The second blinding element, b = β • g in the experiment.

  • leftPublic : F.Carrier self.groupParameters

    The public element, u = x • g in the experiment.

theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHPairInput_mk_inO (F : PrimeOrderGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : γ → F.Desc} {T1 S1 : γ → ℕ} {x2 : (c : γ) → F.Carrier (x1 c)} {T2 S2 : γ → ℕ} {x3 : (c : γ) → F.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 : γ) => F.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, leftBlind := x2 x, rightBlind := x3 x, leftPublic := x4 x }) encIn F.encBlindedCDHPairInput (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))
theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHPairInput_mk_budget (F : PrimeOrderGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : γ → F.Desc} {x2 x3 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 : γ) => F.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, leftBlind := x2 x, rightBlind := x3 x, leftPublic := x4 x }) encIn F.encBlindedCDHPairInput budget

The encoding of a two-point blinded CDH input: the unary security parameter, the group parameters and the words of the three elements, each framed except the last (encBlindedCDHPairInput_apply).

theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHPairInput_mk_polyTime (F : PrimeOrderGroupFamily) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → ℕ} {x1 : γ → F.Desc} {x2 x3 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 : γ) => F.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, leftBlind := x2 x, rightBlind := x3 x, leftPublic := x4 x }) encIn F.encBlindedCDHPairInput

What a machine writes for a Cslib.Crypto.BlindedCDHPairAnswer: the two exponents as binary numbers and the words of the three elements.

  • exponent₁ : ℕ

    The first exponent, as a number below the order.

  • exponent₂ : ℕ

    The second exponent, as a number below the order.

  • right : List Bool

    The word of the adversary's v.

  • value₁ : List Bool

    The word of the first value.

  • value₂ : List Bool

    The word of the second value.

The encoding of the written answer: the five fields in order, each framed except the last (encBlindedCDHPairAnswerWords_apply).

theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHPairAnswerWords_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 x1 : γ → ℕ} {x2 x3 x4 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encNat budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { exponent₁ := x0 x, exponent₂ := x1 x, right := x2 x, value₁ := x3 x, value₂ := x4 x }) encIn encBlindedCDHPairAnswerWords budget
theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHPairAnswerWords_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × ℕ × List Bool × List Bool × List Bool) => { exponent₁ := p.1, exponent₂ := p.2.1, right := p.2.2.1, value₁ := p.2.2.2.1, value₂ := p.2.2.2.2 }) encBlindedCDHPairAnswerWordsFields encBlindedCDHPairAnswerWords 1 1
theorem Cslib.Crypto.PrimeOrderGroupFamily.encBlindedCDHPairAnswerWords_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} {x4 : γ → List Bool} {T4 S4 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encNat T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encBits T4 S4) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { exponent₁ := x0 x, exponent₂ := x1 x, right := x2 x, value₁ := x3 x, value₂ := x4 x }) encIn encBlindedCDHPairAnswerWords (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))
@[reducible, inline]

An adversary for the two-point blinded CDH problem over the family: given the security parameter, the group parameters and a, b, u, it answers two exponents and three group elements.

A two-point blinded CDH adversary is PPT when one uniform strict PPT machine reads encBlindedCDHPairInput and writes the answer as encBlindedCDHPairAnswerWords.

The two-point blinded CDH game: choose group parameters with the setup law, then run Cslib.Crypto.blindedCDHPairExperiment in that group.

The reduction of [BS23], Lemma 21.8, as a CDH adversary: draw the blinding exponent with sampleExp and run Cslib.Crypto.blindedCDHPairToCDHWith.

The reduction of [BS23], Lemma 21.8, with its blinding exponent read from the input, is efficient: on a CDH input and a number μ, running Cslib.Crypto.blindedCDHPairToCDHWith with the blinding exponent μ is uniform strict PPT whenever the adversary is. isPPT_blindedCDHPairToCDHAdversary draws μ with sampleExp first.

The reduction of [BS23], Lemma 21.8, is efficient: it is uniform strict PPT whenever the adversary is.

Sampling loss of the reduction of [BS23], Lemma 21.8: the two-point blinded CDH game is won at most as often as the CDH game of the reduction, up to 1 / 2 ^ n for its one sampleExp draw.

theorem Cslib.Crypto.PrimeOrderGroupFamily.CDH.negligible_blindedCDHPairGame {F : PrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} (h : F.CDH setup) (adversary : F.BlindedCDHPairAdversary) (hA : adversary.IsPPT) :
Negligible fun (n : ℕ) => (F.blindedCDHPairGame setup adversary n).succProbability

[BS23], Lemma 21.8, Section 21.11.5, p. 911: under the CDH assumption, every PPT adversary wins the two-point blinded CDH game with negligible probability.