Documentation

CslibFrontier.Crypto.Computational.DiffieHellman.WithKey

Group parameters with an attached public key #

A scheme over a prime-order group may also publish a key for another component. Cramer and Shoup draw the key of their hash function at key generation and put it in the public key ([CS03], Section 6.1, Figure 1). F.withKey is the group family F with a word k attached to every group description: its parameters are pairs (d, k), and the group, order, generator and operations at (d, k) are those of F at d. A component keyed by k, such as a hash function, can then take the pair (d, k) as its public system parameter, and its security notion is stated for the setup withKeySetup setup keyLen, which draws d ← setup n and an independent uniform keyLen n-bit key.

DDH ignores the key. DDH.withKey derives DDH for F.withKey under withKeySetup setup keyLen from DDH for F under setup. The reduction ddhSampleKey draws the key itself, and isPPT_ddhSampleKey certifies it.

Main definitions #

Main results #

References #

@[reducible, inline]

The family F with a public word k attached to every group description. Its parameters are pairs (d, k); the group, its order, generator, encoding and operations at (d, k) are those of F at d, and the parameters are encoded as encPair F.encDesc encBits.

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.withKeySetup (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (keyLen : ℕ → ℕ) (n : ℕ) :

Draw group parameters d ← setup n, then an independent uniform keyLen n-bit key k, and return (d, k).

theorem Cslib.Crypto.PrimeOrderGroupFamily.mem_support_withKeySetup (F : PrimeOrderGroupFamily) {setup : ℕ → PMF F.Desc} {keyLen : ℕ → ℕ} {n : ℕ} {d : F.Desc} {k : List Bool} (h : (d, k) ∈ (F.withKeySetup setup keyLen n).support) :
d ∈ (setup n).support ∧ k.length = keyLen n

A key in the support of withKeySetup setup keyLen n has length keyLen n, and its group parameters are in the support of setup n.

DDH reduction that samples the key: given a DDH distinguisher for F.withKey, draw a uniform keyLen n-bit key k and run it on the group parameters (d, k).

ddhSampleKey is uniform strict PPT when the distinguisher is and keyLen is computable in polynomial time on unary numbers.

theorem Cslib.Crypto.PrimeOrderGroupFamily.ddhRealGame_ddhSampleKey (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (keyLen : ℕ → ℕ) (distinguisher : F.withKey.DDHDistinguisher) (n : ℕ) :
F.ddhRealGame setup (F.ddhSampleKey keyLen distinguisher) n = F.withKey.ddhRealGame (F.withKeySetup setup keyLen) distinguisher n

In the real DDH game, ddhSampleKey plays the real DDH game of F.withKey under withKeySetup.

theorem Cslib.Crypto.PrimeOrderGroupFamily.ddhRandomGame_ddhSampleKey (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (keyLen : ℕ → ℕ) (distinguisher : F.withKey.DDHDistinguisher) (n : ℕ) :
F.ddhRandomGame setup (F.ddhSampleKey keyLen distinguisher) n = F.withKey.ddhRandomGame (F.withKeySetup setup keyLen) distinguisher n

In the random DDH game, ddhSampleKey plays the random DDH game of F.withKey under withKeySetup.

DDH ignores an attached key: DDH for F under setup gives DDH for F.withKey under withKeySetup setup keyLen, through the explicit reduction ddhSampleKey and its certificate isPPT_ddhSampleKey.