Documentation

CslibFrontier.Crypto.Primitives.UHF.Computational

Computational universal hashing #

The adversary receives the unary security parameter and a public setup description. The uniform hash key for that description stays private. The finite single-pair and multi-query experiments give the conditional success probabilities. A collision counts only between distinct valid messages. The message encoding is shared across setup descriptions.

The computational security implication follows by running the certified collision-pair sampler on the multi-query adversary's list. The list length bound follows from the strict PPT certificates for the setup and adversary. The converse submits a pair as a two-message batch and preserves the success probability.

Main definitions #

Main results #

References #

Run a collision guesser and submit its two messages in order, including repeated guesses.

Every supported output of the wrapper contains exactly two messages.

The batch wrapper adds only the cost of writing a two-element framed list.

noncomputable def Cslib.Crypto.UHF.collisionGame {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) (A : ℕ × D → ProbComp (CollisionGuess M)) (n : ℕ) :

Attack Game 7.1 with public setup. The adversary receives (n, d) and wins if its two distinct valid messages collide under a private uniform key from K d.

noncomputable def Cslib.Crypto.UHF.multiQueryGame {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) (A : ℕ × D → ProbComp (List M)) (n : ℕ) :

Attack Game 7.2 with public setup. The adversary receives (n, d) and wins if some two distinct valid messages in its output list collide under a private uniform key from K d. Repeated messages and invalid entries do not contribute a collision.

def Cslib.Crypto.UHF.IsComputationalUHF {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] (encD : D ↪ List Bool) (encM : M ↪ List Bool) (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) :

Computational UHF security ([BS23], Definition 7.2, printed p. 254) against uniform strict PPT adversaries. The unary parameter is framed before the public setup encoding. Invalid guesses lose. The predicate accepts a setup program of arbitrary runtime. IsComputationalUHF.isMultiQueryUHF requires strict PPT setup. The caller supplies the keyed hash family's recognition, sampling and evaluation requirements from Definition 7.4.

def Cslib.Crypto.UHF.IsMultiQueryUHF {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] (encD : D ↪ List Bool) (encM : M ↪ List Bool) (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) :

Multi-query UHF security ([BS23], Definition 7.3, printed p. 254) against uniform strict PPT adversaries, with the same public inputs and message domain as IsComputationalUHF. The adversary outputs a framed list of messages. The predicate accepts a setup program of arbitrary runtime. IsComputationalUHF.isMultiQueryUHF requires strict PPT setup.

theorem Cslib.Crypto.UHF.multiQueryGame_collisionPairToBatch {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) (A : ℕ × D → ProbComp (CollisionGuess M)) (n : ℕ) :
multiQueryGame setup valid H (fun (p : ℕ × D) => collisionPairToBatch (A p)) n = collisionGame setup valid H A n

The two-message batch and the original pair win on exactly the same guesses and keys.

theorem Cslib.Crypto.UHF.IsMultiQueryUHF.isComputationalUHF {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] {encD : D ↪ List Bool} {encM : M ↪ List Bool} {setup : ℕ → ProbComp D} {valid : ℕ → D → M → Bool} {H : ℕ → (d : D) → K d → M → Y d} (hH : IsMultiQueryUHF encD encM setup valid H) :
IsComputationalUHF encD encM setup valid H

Multi-query UHF security implies single-pair UHF security by submitting both messages in one batch. The wrapper leaves the public setup program unchanged.

theorem Cslib.Crypto.UHF.succProbability_multiQueryGame_le_collisionPairReduction {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] (setup : ℕ → ProbComp D) (valid : ℕ → D → M → Bool) (H : ℕ → (d : D) → K d → M → Y d) (fallback : M) (A : ℕ × D → ProbComp (List M)) (n : ℕ) {Q : ℕ} (hA : ∀ d ∈ (setup n).eval.support, ∀ ms ∈ (A (n, d)).eval.support, ms.length ≤ Q) :
(multiQueryGame setup valid H A n).succProbability ≤ ↑Q ^ 2 / 2 * (collisionGame setup valid H (fun (p : ℕ × D) => collisionPairReduction fallback (A p)) n).succProbability

With at most Q messages at each supported setup, the multi-query success probability is at most Q ^ 2 / 2 times the success probability of the collision-pair sampler.

theorem Cslib.Crypto.UHF.IsComputationalUHF.isMultiQueryUHF {D M : Type} {K Y : D → Type} [(d : D) → Fintype (K d)] [∀ (d : D), Nonempty (K d)] [DecidableEq M] [(d : D) → DecidableEq (Y d)] {encD : D ↪ List Bool} {encM : M ↪ List Bool} {setup : ℕ → ProbComp D} {valid : ℕ → D → M → Bool} {H : ℕ → (d : D) → K d → M → Y d} (hH : IsComputationalUHF encD encM setup valid H) (hsetup : Probability.IsPPTOn Turing.MultiTapeTM.encUnary encD setup) :
IsMultiQueryUHF encD encM setup valid H

Computational UHF security implies multi-query UHF security (Boneh–Shoup Lemma 7.1, [BS23], v0.6, printed pp. 254–255). The public setup is strict PPT and varies with the security parameter. The reduction uses bounded fair-bit sampling, preserving the Q ^ 2 / 2 bound, and outputs a losing repeated guess on exhaustion. The bound on the adversary's output list length comes from the two strict PPT certificates.