Documentation

CslibFrontier.Crypto.Computational.DiscreteLog

The discrete-logarithm assumption #

A PrimeOrderGroupFamily is a family of cyclic groups of prime order. Fixing F : PrimeOrderGroupFamily fixes the family, its element encodings and its algorithms. A value d : F.Desc is a bundle of public group parameters selecting the group F.Carrier d, its order F.order d and its generator F.generator d. For example, Schnorr parameters (p, q, g) select the subgroup of order q of (ZMod p)ˣ generated by g. The API names Desc and encDesc refer to the parameter type and its bit-string encoding.

Groups are written additively, as ZMod q-modules, so the book's g ^ α is α • g. Algorithms receive the public parameters and words encoding group elements. The family supplies plain polynomial-time functions of these inputs for the order, the encoded generator, addition and multiplication by a natural number.

The discrete-logarithm experiment ([BS23], Attack Game 10.4) draws public group parameters from a setup law and a uniform α : ZMod q, then gives the adversary those parameters and the encoding of α • g; the adversary wins when the binary number it outputs is α modulo q. DiscreteLog asserts that every uniform strict PPT adversary wins with negligible probability.

As for DecisionLWE, this is a hypothesis, not a theorem. The setup law is arbitrary and is not claimed to be efficiently sampleable: generating primes with certainty is not a strict PPT task, since a fair-coin machine with a fixed clock fails with positive probability. The group parameters are public, and an adversary's running time may depend on their encoded length.

Main definitions #

Main results #

References #

@[reducible, inline]
abbrev Cslib.Crypto.encDescBitsPair {Desc : Type} (encDesc : Desc ↪ List Bool) :

Encoding of public group parameters d paired with two bit-string element words (d, x, y): the framed encoding encDesc d of d (encPair adds the framing outside encDesc), followed by framed x and unframed y.

A family of cyclic groups of prime order, indexed by public group parameters, with polynomial-time operations on encoded elements. A value d : F.Desc selects the group, order and generator within the fixed family F.

@[instance_reducible]

Equality of group elements, decided on their injective encodings.

The order of computed group parameters is computable in polynomial time.

The encoded generator of computed group parameters.

Word-level scalar multiplication of a computed group-element word by a computed natural number is computable in polynomial time.

A discrete logarithm modulo q is unique: α ↦ α • g is injective.

Every element of F.Carrier d is a scalar multiple of the generator: α ↦ α • g is surjective.

The scalar map α ↦ α • g is a bijection between ZMod (F.order d) and F.Carrier d.

theorem Cslib.Crypto.PrimeOrderGroupFamily.uniform_smul_generator_add (F : PrimeOrderGroupFamily) {α : Type u_1} (d : F.Desc) (m : F.Carrier d) (f : F.Carrier d → PMF α) :
((Probability.PMF.uniformOfFintype (ZMod (F.order d))).bind fun (γ : ZMod (F.order d)) => f (γ • F.generator d + m)) = (Probability.PMF.uniformOfFintype (ZMod (F.order d))).bind fun (γ : ZMod (F.order d)) => f (γ • F.generator d)

One-time group mask: for any group element m : F.Carrier d, masking m by γ • g for a uniform γ : ZMod (F.order d) has the same distribution as γ • g itself.

noncomputable def Cslib.Crypto.PrimeOrderGroupFamily.discreteLogGame (F : PrimeOrderGroupFamily) (setup : ℕ → PMF F.Desc) (adversary : ℕ → F.Desc × List Bool → ProbComp (List Bool)) (n : ℕ) :

The discrete-logarithm experiment ([BS23], Attack Game 10.4): draw public group parameters and a uniform α, give the adversary those parameters and the encoding of α • g, and accept when the binary number it outputs is α modulo q.

The discrete-logarithm assumption for a family and a setup law: every uniform strict PPT adversary, given the unary security parameter, public group parameters and the encoded instance, finds the discrete logarithm with negligible probability. This is a hypothesis, not a theorem.

It is [BS23], Attack Game 10.4 and Definition 10.6 (p. 409), read asymptotically as in Section 10.5.2 (pp. 413–414), with these differences. The group parameters are drawn from setup, which need not be efficiently samplable, whereas the source draws them with an efficient system parameterization algorithm (Definition 10.9, p. 413); the assumption is the source's only for setup laws that an efficient algorithm samples. The adversary's running time is polynomial in the length of its whole input, including the encoded group parameters, which such a setup keeps polynomial in n. The adversary writes the exponent as a binary number, read modulo q, where the source's adversary outputs an element of ℤ_q.