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 5.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).
Main definitions #
Cslib.Crypto.CollisionFinder: uniform adversary taking(n, k)and outputting candidate messages(m₁, m₂).Cslib.Crypto.isCollision,Cslib.Crypto.collisionGame: Boolean collision test and keyed collision-finding experiment.Cslib.Crypto.CollisionResistantOn,Cslib.Crypto.CollisionResistant: negligible collision probability against every uniform strict PPT adversary.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.isPPTOn_collisionGame,Cslib.Crypto.isPPT_collisionGame: strict PPT certificates for the 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 #
A collision finder receives the unary security parameter n and public hash key k and
outputs a pair (m₁, m₂) of candidate colliding messages.
Instances For
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.
Instances For
Run the complete collision experiment on its unary security parameter.
The collision experiment is uniformly strict PPT, independently of unused auxiliary input.
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.
Testing whether an input has length 2 * n is computable in plain polynomial time.
A keyed 2n → n collision-resistant compression family ([BS23], Section 8.2):
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.
- 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.
Instances For
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.
- 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.