Documentation

CslibFrontier.Crypto.Computational.DiffieHellman.Decodable

Word-level CDH and equivalence with typed CDH for decodable families #

For an arbitrary PrimeOrderGroupFamily, the typed assumption PrimeOrderGroupFamily.CDH quantifies over adversaries that output elements of F.Carrier d, whereas a word-level CDH adversary outputs an arbitrary bit string List Bool and wins when that word equals F.encode d ((a * b) • F.generator d) (PrimeOrderGroupFamily.cdhWordGame and PrimeOrderGroupFamily.WordCDH).

WordCDH always implies CDH (PrimeOrderGroupFamily.WordCDH.cdh) via IsPPTOn.exists_factor and injectivity of F.encode d. When the family is decodable (DecodablePrimeOrderGroupFamily), decoding any candidate word with fallback 0 (DecodablePrimeOrderGroupFamily.wordToTypedCDHAdversary) preserves uniform strict PPT (isPPT_wordToTypedCDHAdversary) and never lowers success probability (succProbability_cdhWordGame_le_cdhGame). Hence CDH ↔ WordCDH (DecodablePrimeOrderGroupFamily.cdh_iff_encoded), and DDH implies word-level WordCDH when 1 / order is negligible (DecodablePrimeOrderGroupFamily.DDH.wordCDH).

Main definitions #

Main results #

References #

@[reducible, inline]

Encoding of word-level CDH inputs (n, d, u, v), with n in unary (encUnary) and every component except the last framed by encPair; d uses F.encDesc and u, v use encBits.

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

The word-level Computational Diffie–Hellman game: draw d ← setup n and uniform exponents a, b : ZMod (F.order d), give (d, encode (a • g), encode (b • g)) to adversary n, and accept when it outputs encode ((a * b) • g).

The word-level Computational Diffie–Hellman assumption ([BS23], Attack Game 10.5 and Definition 10.7, printed pp. 409–410, with the adversary's answer taken as a bit string): every uniform strict PPT adversary on encoded CDH instances encWordCDHInput wins cdhWordGame with negligible probability.

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

Word-level WordCDH always implies typed CDH: any PPT typed CDH adversary factors through a word-level PPT program via IsPPTOn.exists_factor and encBits = id, and injectivity of F.encode preserves the success event identically.

Turn a word-level CDH adversary into a typed CDH adversary using F.decode, falling back to 0 : F.Carrier d on invalid words.

wordToTypedCDHAdversary preserves uniform strict PPT: encoding the decoded output with fallback 0 equals echoing valid words w verbatim and outputting F.encode d 0 otherwise.

Whenever a word-level adversary outputs F.encode d ((a * b) • F.generator d), wordToTypedCDHAdversary recovers (a * b) • F.generator d via F.decode_encode.

Typed CDH is equivalent to word-level CDH for every DecodablePrimeOrderGroupFamily.

theorem Cslib.Crypto.DecodablePrimeOrderGroupFamily.DDH.wordCDH {F : DecodablePrimeOrderGroupFamily} {setup : ℕ → PMF F.Desc} (hDDH : F.DDH setup) {m : ℕ → ℕ} (hm0 : ∀ (n : ℕ), 0 < m n) (hm : ∀ (n : ℕ), ∀ d ∈ (setup n).support, m n ≤ F.order d) (hinv : Negligible fun (n : ℕ) => 1 / ↑(m n)) :
F.WordCDH setup

DDH implies word-level WordCDH for a DecodablePrimeOrderGroupFamily when every supported group at parameter n has order at least m n > 0 and 1 / m n is negligible.