Keyed collision-resistant hash families and compression functions #
In the uniform PPT model, an unkeyed deterministic function H : List Bool → List Bool with
unrestricted inputs (valid := fun _ _ => true, or any domain predicate that accepts a fixed pair
at every security parameter n) cannot be collision-resistant whenever a single colliding pair
(m₁, m₂) exists, because one uniform algorithm can hardcode (m₁, m₂) as a constant and win for
every n. (In the length-indexed compression setting validCompressionInput n x := (x.length == 2 * n), by contrast, a single hardcoded pair has fixed length and is valid at most at
one parameter n.) Standard uniform formulations therefore index both compression and hash families
H : List Bool → List Bool → List Bool by a public key k ← {0, 1}^n sampled uniformly at
security parameter n; the adversary receives (1^n, k) and wins by outputting a pair (m₁, m₂)
of valid inputs with m₁ ≠ m₂ and H k m₁ = H k m₂ ([BS23], Sections 8.1–8.2;
[KL20], Section 6.1).
Parameterizing the experiment by a validity predicate valid : ℕ → List Bool → Bool accommodates
both fixed-input-length compression families (validCompressionInput n x := (x.length == 2 * n),
mapping 2n-bit inputs to n-bit outputs under an n-bit key) and arbitrary-input-length hash
families (valid := fun _ _ => true).
Following [BS23], Section 8.1.1 (Definition 8.2 and Fig. 8.3, printed pp. 290–291), we
define the general setup-parameterized notions CollisionFinderFor, isCollisionFor,
collisionExperiment, collisionGameFor, CollisionResistantForOn, and CollisionResistantFor
for hash families H : (d : Param) → List Bool → Digest d indexed by a public system parameter
d ← setup n (where setup : ℕ → PMF Param need not be efficiently sampleable, matching
PrimeOrderGroupFamily in DiscreteLog and DiffieHellman, and where d subsumes any hash key
per footnote 1 on printed p. 290). collisionExperiment is the experiment at a fixed d, and
collisionGameFor runs it under Game.withSetup. Standard keyed word-level collision resistance
(CollisionFinder, CollisionResistantOn, CollisionResistant) is the abbrev specialization
Param = List Bool, Digest _ = List Bool, encParam = encBits,
setup n = ProbComp.eval (BitString.sampleList n).
Main definitions #
Cslib.Crypto.CollisionFinderFor,Cslib.Crypto.isCollisionFor,Cslib.Crypto.collisionExperiment,Cslib.Crypto.collisionGameFor,Cslib.Crypto.CollisionResistantForOn,Cslib.Crypto.CollisionResistantFor: the collision-finding experiment at a fixed public parameter, its setup-parameterized game, and collision resistance for familiesH : (d : Param) → List Bool → Digest dindexed by a public setup parameterd ← setup n(used for group-indexed $\mathbb{Z}_q$-valued hashes such as $H' : \mathbb{G}^3 \to \mathbb{Z}_q$ in Cramer–Shoup).Cslib.Crypto.CollisionFinder,Cslib.Crypto.isCollision,Cslib.Crypto.collisionGame,Cslib.Crypto.CollisionResistantOn,Cslib.Crypto.CollisionResistant: uniform keyed word-level collision resistance (Param = List Bool,setup n = ProbComp.eval (BitString.sampleList n)).Cslib.Crypto.validCompressionInput,Cslib.Crypto.CompressionFamily:2n → ncollision- resistant compression families.Cslib.Crypto.HashFamily: unrestricted collision-resistant hash families on arbitrary bit strings.
Main results #
Cslib.Crypto.CollisionResistantForOn.negligible,Cslib.Crypto.CollisionResistantForOn.of_negligible,Cslib.Crypto.not_collisionResistantForOn_of_le_succProbability,Cslib.Crypto.succProbability_collisionGameFor_map_le,Cslib.Crypto.CollisionResistantForOn.of_map,Cslib.Crypto.CollisionResistantForOn.mono,Cslib.Crypto.CollisionResistantOn.collisionResistantForOn: setup-parameterized collision resistance properties, restriction of the valid input domain, and injective-digest reductions (including the specialization from word-levelCollisionResistantOn).Cslib.Crypto.isPPTOn_collisionGame,Cslib.Crypto.isPPT_collisionGame: strict PPT certificates for the keyed word-level collision experiment.Cslib.Crypto.CollisionResistantOn.negligible,Cslib.Crypto.CollisionResistantOn.of_negligible: equivalence with negligible collision-finding probability.Cslib.Crypto.succProbability_collisionGame_le_of_extract,Cslib.Crypto.CollisionResistantOn.of_extract: deterministic polynomial-time collision extraction transfers collision resistance between hash families.Cslib.Crypto.CollisionResistantOn.mono: restricting the valid input domain preserves collision resistance.Cslib.Crypto.not_collisionResistantOn_of_le_succProbability: finding collisions with probability bounded away from zero refutes collision resistance.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 8.1 (Definition 8.2 and Fig. 8.3, printed pp. 290–291).
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, Section 6.1.
Setup-parameterized collision-resistant hash families ([BS23], Section 8.1.1) #
Verbatim from [BS23], Section 8.1.1 (printed pp. 290–291):
Definition 8.2 (Keyless hash functions). A (keyless) hash function is an efficient algorithm $H$, along with two families of spaces with system parameterization $P$: $$\mathcal{M} = \{\mathcal{M}_{\lambda, \Lambda}\}_{\lambda, \Lambda}, \quad \text{and} \quad \mathcal{T} = \{\mathcal{T}_{\lambda, \Lambda}\}_{\lambda, \Lambda},$$ such that
- $\mathcal{M}$, and $\mathcal{T}$ are efficiently recognizable.
- Algorithm $H$ is an efficient deterministic algorithm that on input $\lambda \in \mathbb{Z}_{\ge 1}$, $\Lambda \in \text{Supp}(P(\lambda))$, and $m \in \mathcal{M}_{\lambda, \Lambda}$, outputs an element of $\mathcal{T}_{\lambda, \Lambda}$.
In defining collision resistance, we parameterize Attack Game 8.1 by the security parameter $\lambda$. The asymptotic game is shown in Fig. 8.3. The advantage $\text{CRadv}[\mathcal{A}, H]$ is then a function of $\lambda$. Definition 8.1 should be read as saying that $\text{CRadv}[\mathcal{A}, H](\lambda)$ is a negligible function.
Test whether (m₁, m₂) is a valid collision for H d at security parameter n and public
parameter d under the domain predicate valid.
Parameterized collision testing is symmetric in the two candidate messages.
The collision-finding experiment at security parameter n and public parameter d
([BS23], Section 8.1.1, Fig. 8.3, printed p. 291): run adversary n d to obtain
(m₁, m₂), and accept when isCollisionFor H valid n d m₁ m₂ holds.
The setup-parameterized collision-finding game ([BS23], Section 8.1.1,
Definition 8.2 and Fig. 8.3, printed pp. 290–291): draw d ← setup n and run
collisionExperiment at d. The setup law need not be efficiently sampleable, matching
DiscreteLog and DDH.
Collision resistance of a setup-parameterized hash family H on valid against every
uniform strict PPT collision finder ([BS23], Section 8.1.1, Definition 8.2 and Fig. 8.3,
printed pp. 290–291). The setup distribution setup : ℕ → PMF Param need not be efficiently
sampleable.
Unrestricted collision resistance of a setup-parameterized hash family H:
CollisionResistantForOn with every input valid. This is collision resistance as in
[BS23], Attack Game 8.1 and Definitions 8.1–8.2 (pp. 290–291), with the system parameter
drawn from setup, against uniform strict PPT collision finders. The setup law need not be
efficiently samplable, whereas the source's system parameterization is an efficient algorithm
(Definition 2.9, p. 30).
Setup-parameterized collision resistance gives negligible collision-finding probability for every strict PPT collision finder.
Establish setup-parameterized collision resistance by bounding every strict PPT adversary's success probability.
Finding collisions with probability bounded away from zero refutes
CollisionResistantForOn: a strict PPT collision finder whose success probability is at least a
fixed c > 0 at every security parameter.
Pushing a setup distribution setup₁ n forward along f n : Param₁ → Param₂ and post-composing
H₁ with a digest map that is injective on valid H₁ p₁-outputs for p₁ ∈ (setup₁ n).support
never increases collision-finding success probability.
Parameter-map and injective-digest reduction for CollisionResistantForOn: if f is
computable in polynomial time and every H₂ (f n p₁)-collision on p₁ ∈ (setup₁ n).support is a
valid H₁ p₁-collision, then CollisionResistantForOn for H₁ implies CollisionResistantForOn
for H₂ under fun n => (setup₁ n).map (f n).
Restricting the valid input domain preserves setup-parameterized collision resistance: a
collision on valid₁ is a collision on valid₂ whenever valid₁ ⊆ valid₂ on supported
parameters. This is CollisionResistantForOn.of_map with the identity parameter map. In
particular CollisionResistantFor gives CollisionResistantForOn for every valid.
A collision finder receives the unary security parameter n and public hash key k and
outputs a pair (m₁, m₂) of candidate colliding messages.
Testing whether (m₁, m₂) is a valid collision is polynomial-time when H and valid are
polynomial-time.
The keyed collision-finding experiment: sample a uniform n-bit key k, run adversary n k
to obtain a candidate pair (m₁, m₂), and accept when isCollision H valid n k m₁ m₂ holds.
The keyed collisionGame is the Param = List Bool, setup n = ProbComp.eval (sampleList n)
specialization of collisionGameFor.
Run the complete collision experiment on its unary security parameter.
The collision experiment is uniformly strict PPT, independently of unused auxiliary input.
Collision resistance of a keyed hash family H on the valid input domain valid:
specialization of CollisionResistantForOn to Param = List Bool, Digest _ = List Bool,
encParam = encBits, and setup n = ProbComp.eval (BitString.sampleList n). This is
[BS23], Attack Game 8.1 and Definitions 8.1–8.2 (pp. 290–291), with a uniform n-bit
key given to the finder as the system parameter, the keyed form that footnote 1 on p. 290 says is
the same as the source's, and with messages the words that valid n accepts. Finders are uniform
strict PPT.
Unrestricted collision resistance on all bit strings List Bool: CollisionResistantOn with
every word valid, that is, [BS23], Attack Game 8.1 and Definitions 8.1–8.2
(pp. 290–291), keyed by a uniform n-bit key. The source's message spaces are finite sets of
words of polynomially bounded length; since a strict PPT finder outputs words of polynomially
bounded length, this is collision resistance on every such message space at once.
Collision resistance gives negligible collision-finding probability for every strict PPT adversary.
Establish collision resistance by bounding every strict PPT adversary's success probability.
If a deterministic map extract turns every valid H₁-collision under an n-bit key k
into a valid H₂-collision under k, then postprocessing adversary by extract at parameter n
never decreases the collision success probability.
Deterministic collision-extraction reduction: if a polynomial-time function extract
turns every H₁-collision at parameter n (for all sufficiently large n and n-bit keys k)
into an H₂-collision under the same key k, then collision resistance of H₂ implies collision
resistance of H₁.
Restricting the valid input domain preserves collision resistance.
Finding collisions with probability bounded away from zero refutes collision resistance:
a strict PPT adversary whose success probability is at least a fixed c > 0 at every security
parameter.
Bridge from word-level CollisionResistantOn to CollisionResistantForOn over
(d n, k) : Param × List Bool: when d : ℕ → Param is computable in polynomial time and
toDigest (d n) is eventually injective on valid H k-outputs for n-bit keys k, collision
resistance of H implies parameterized collision resistance of
fun pk x => toDigest pk.1 (H pk.2 x) under
setup n = (ProbComp.eval (BitString.sampleList n)).map (fun k => (d n, k)).
Testing whether an input has length 2 * n is computable in plain polynomial time.
A keyed 2n → n collision-resistant compression family: computable in deterministic
polynomial time, mapping 2n-bit inputs under an n-bit key to n-bit outputs, and
collision-resistant on 2n-bit inputs (CollisionResistantOn). In [BS23], Section 8.4
(pp. 295–296), a compression function is a hash function h over (X × Y, X) that is collision
resistant in the sense of Attack Game 8.1 and Definitions 8.1–8.2 (pp. 290–291); here the chaining
value and the block are one 2n-bit word, keyed by a uniform n-bit key.
- polyTime : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : List Bool × List Bool) => h p.1 p.2) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits
Deterministic polynomial-time evaluation of
(k, x) ↦ h k x. Compressing a
2n-bit input under ann-bit key produces ann-bit digest.- collisionResistant : CollisionResistantOn h validCompressionInput
Finding two distinct
2n-bit inputs with the same digest under a uniformn-bit key is hard for every uniform strict PPT adversary.
A keyed collision-resistant hash family on arbitrary-length bit strings (List Bool), mapping
every message under an n-bit key to an n-bit digest: a hash function in the sense of
[BS23], Definition 8.2 (pp. 290–291), with a uniform n-bit key as its system
parameter, that is CollisionResistant (Attack Game 8.1 and Definition 8.1, p. 290). Digests of
exactly n bits are a restriction of this interface; the source does not require them.
- polyTime : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : List Bool × List Bool) => H p.1 p.2) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits
Deterministic polynomial-time evaluation of
(k, msg) ↦ H k msg. Hashing any message under an
n-bit key produces ann-bit digest.- collisionResistant : CollisionResistant H
Finding two distinct bit strings of any lengths with the same digest under a uniform
n-bit key is hard for every uniform strict PPT adversary.