Collision-Resistant Hash Functions #
This file defines collision resistance for unkeyed hash functions and for keyed hash function families, together with their security experiments.
Collision Resistance #
A function f : X → Y is collision-resistant if no efficient adversary can
find two distinct inputs x ≠ x' with f x = f x'.
Keyed Hash Function Families #
A keyed hash family samples a public key k : K and the adversary must find
a collision under f k. This is the form used in practical constructions and
in the Merkle-tree / FRI commitment-scheme setting where the hash key is a
protocol parameter.
Main Definitions #
CRAdversary X— an adversary outputting a candidate collision pair.crExp— the collision-resistance experiment.crAdvantage— the advantage of a CR adversary.KeyedHashFamily K X Y— a keyed hash family.KeyedCRAdversary K X— an adversary for the keyed variant.keyedCRExp— the keyed collision-resistance experiment.keyedCRAdvantage— the advantage of a keyed CR adversary.ROMHashSpec X Y— random-oracle spec with domainXand rangeY.ROMCRAdversary X Y— an adversary for the ROM variant.romCRExp— the ROM collision-resistance experiment.romCRAdvantage— the advantage of a ROM-CR adversary.romCRAdvantage_le_birthday— birthday bound on ROM-CR advantage.
See also #
VCVio/CryptoFoundations/CommitmentScheme.lean— binding for commitment schemes; collision resistance of the underlying hash is the standard-model source of binding for hash-based commitments.VCVio/OracleComp/QueryTracking/Collision.lean—CacheHasCollisionpredicates and birthday bounds used to bound ROM-level collision probability.
Unkeyed Collision Resistance #
A collision-resistance adversary outputs a candidate pair of inputs that it hopes form a collision under the target hash function.
Instances For
Collision-resistance experiment: the adversary proposes a pair (x, x'),
and the experiment returns true iff the two inputs are distinct and map to
the same image under f.
Instances For
Collision-resistance advantage: the probability that the adversary
produces a valid collision for f.
Instances For
Keyed Hash Function Families #
A keyed hash family with key space K, domain X, and range Y.
The key-sampling algorithm is probabilistic; the hash itself is a
deterministic function of the key and input.
- keygen : ProbComp K
- hash : K → X → Y
Instances For
A keyed CR adversary receives the public key and outputs a candidate collision pair.
Instances For
Keyed collision-resistance experiment: sample a key, run the adversary on
the key, and return true iff the adversary's pair is a valid collision
under H.hash k.
Instances For
Keyed collision-resistance advantage: the probability of producing a valid collision under the sampled key.
Instances For
ROM-Level Collision Resistance #
Companion section modelling collision resistance directly in the random-oracle
model. A ROM-CR adversary is an oracle computation outputting a candidate
collision pair (x, x'). The experiment runs the adversary inside
cachingOracle, then queries the random oracle on both candidates sharing
the same cache; it wins iff x ≠ x' and the queried outputs coincide.
For any t-query ROM-CR adversary the advantage is bounded by the birthday
term (t+2) * (t+1) / (2 * |Y|) — a (t+2)-query game once the two
verification queries are accounted for.
Closes one of the layers requested in Verified-zkEVM/VCV-io#284.
The random-oracle spec with domain X and range Y: each input x : X is
a distinct oracle index returning a value in Y.
Instances For
A ROM-CR adversary is an oracle computation outputting a candidate collision pair under the random oracle.
Instances For
A ROM-CR adversary bundled with a total query bound.
- run : ROMCRAdversary X Y
The adversary's oracle computation.
- queryBound : OracleComp.IsTotalQueryBound self.run t
The adversary makes at most
ttotal queries.
Instances For
ROM collision-resistance experiment: run the adversary inside
cachingOracle from the empty cache, then query the random oracle on both
candidate inputs (verification queries share the cache). Win iff the inputs
are distinct and the queried outputs coincide.
Instances For
ROM collision-resistance advantage: probability that the adversary produces a valid collision under the random oracle.
Instances For
ROM Collision Resistance birthday bound: for any t-query ROM-CR
adversary A over a hash range of cardinality |Y| > 0, the advantage is
bounded by (t+2) * (t+1) / (2 * |Y|). The two extra queries account for the
experiment's verification queries, which share the adversary's cache.