Universal hash games with a finite key space #
These experiments express the collision and difference-prediction advantages of
[BS23], Attack Games 7.1–7.3, as probabilities of returning true. The challenger
keeps the uniform key private. An adversary is a closed probabilistic program with no key input.
Main definitions #
Cslib.Crypto.UHF.collisionExperiment: the single-pair collision game (Attack Game 7.1).Cslib.Crypto.UHF.multiQueryExperiment: the multi-query collision game (Attack Game 7.2).Cslib.Crypto.UHF.differenceExperiment: the difference-prediction game (Attack Game 7.3).Cslib.Crypto.UHF.collisionPairReduction: turns a list of guesses into one pair.Cslib.Crypto.UHF.bestCollisionGuess: exhaustive search for a pair with maximal collision probability in an enumeration of the message space.
Main results #
Cslib.Crypto.UHF.isUniversalHash_iff_eval_collisionExperiment_leandCslib.Crypto.UHF.isDeltaUniversalHash_iff_eval_differenceExperiment_le: the pairwise predicates are equivalent to bounding the corresponding advantage for every adversary.Cslib.Crypto.UHF.bestCollisionGuess_wins: exhaustive search finds a guess that exceeds the proposed bound whenever a distinct pair does (Exercise 7.3).Cslib.Crypto.UHF.eval_multiQueryExperiment_le_collisionPairReduction: the finite-game advantage bound for the explicit wrapper, using bounded fair-bit sampling.Cslib.Crypto.UHF.isPPTOn_collisionPairReduction: the wrapper preserves strict PPT.Cslib.Crypto.UHF.eval_multiQueryExperiment_le: the statisticalC(Q, 2) * εbound for lists of length at mostQ.
The results here concern one key distribution and one hash function at a time. The computational
collision games and asymptotic implication are in Crypto.Primitives.UHF.Computational.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Sections 7.1 and 7.4 and Exercise 7.3.
The two messages submitted to the collision game.
- first : M
The first message.
- second : M
The second message.
Frame the first collision message and then write the encoding of the second message.
The messages and the predicted difference of their hashes.
Attack Game 7.1 ([BS23], v0.6, §7.1, p. 253). A guess wins when its two distinct messages hash to the same value under an independently sampled uniform key. The experiment rejects equal messages, which the source forbids submitting.
Attack Game 7.3 ([BS23], v0.6, §7.4, p. 268). A guess wins when its prediction equals the hash of the second message minus the hash of the first under a uniform key. Equal messages are rejected. The digest space may be any additive group, encompassing the source's cyclic group and the XOR example in Remark 7.3.
The pairwise collision bound (7.1) is equivalent to the game bound of Definition 7.2
([BS23], v0.6, p. 254), for one uniform-key instance and any ε.
The pairwise difference bound is equivalent to the game bound of Definition 7.5
([BS23], v0.6, pp. 268–269), for one uniform-key instance and any ε.
Exhaustively score the distinct pairs from an enumerated message space by the number of
keys giving a collision. Choose the first maximizer, or return none if there is no pair.
Exercise 7.3 ([BS23], v0.6, p. 277). Given a complete enumeration of a finite
message space, exhaustive search produces a deterministic guess that exceeds ε whenever
some distinct pair does. The search takes only the hash and the enumeration as inputs.
The witness pair and the sampled challenge key are absent from its inputs.
Attack Game 7.2 (multi-query UHF, [BS23], Version 0.6, Section 7.1.1, p. 254): the
adversary B outputs a list of messages, the challenger samples a uniform hash key independently,
and B wins when two distinct messages of the list have the same digest (MUHFadv[B, H] is the
probability of true). The book asks B to output distinct messages; Lean accepts any List M
and rewards only pairs with m ≠ m' and H k m = H k m', so duplicate messages earn nothing.
Run the multi-query adversary and sample an ordered pair of distinct positions with bounded
fair-bit rejection sampling. A list of length s allows s attempts. If the attempts fail
or there are fewer than two positions, return a repeated dummy message.
Bounded sampling and unary list access preserve strict PPT for a multi-query adversary. The certificate charges the framed input list and uses at most its length in attempts.
A finite-game step toward Lemma 7.1 ([BS23], v0.6, printed pp. 254–255).
If the multi-query adversary outputs at most Q messages, its collision probability is at most
Q ^ 2 / 2 times that of the explicit single-pair wrapper. Whenever the list contains a
collision, both orders of a colliding pair have enough sampling mass to give the bound. The
wrapper has a strict PPT certificate. Crypto.Primitives.UHF.Computational lifts this bound to
public setup and proves the asymptotic implication.
The ε-bounded case of [BS23], Lemma 7.1, a step toward the lemma, not the cited
result: against an ε-bounded UHF (IsUniversalHash for the uniform key, the ε-UHF of
Definition 7.2), an adversary whose supported output lists have length at most Q wins Attack
Game 7.2 with probability at most Q.choose 2 * ε. Only the key type has to be finite. Lemma 7.1
assumes only a computational UHF and bounds the multi-query advantage by Q ^ 2 / 2 times the
advantage of an efficient wrapper in Attack Game 7.1; here the hash is ε-bounded against every
adversary, efficient or not, for one fixed instance, with any ε (Definition 7.2 calls it
statistical only when ε is negligible), and the proof uses a union bound (#5790).