Target collision resistance and universal one-way hash families #
A keyed hash family H with key-length schedule keyLen : ℕ → ℕ is target collision-resistant
(equivalently, a universal one-way hash family, UOWHF; [NY89], Section 2;
[BS23], Section 8.11.2, Attack Game 8.5 and Definition 8.7; [Gol04],
Section 6.4.3) if no uniform strict PPT two-stage adversary A = (choose, find) can win the
following game with non-negligible probability:
- Given
1^n,A.choose nselects a target inputm₀and saved statestbefore the hash key is sampled; - A uniform key
k ← {0, 1}^{keyLen n}is sampled; - Given
(1^n, st, k),A.find n st koutputs a candidate inputm₁; Awins whenm₀andm₁satisfy the domain predicatevalid n,m₀ ≠ m₁, andH n k m₀ = H n k m₁.
Unlike full collision resistance (CollisionResistantOn), where a single key k can be reused
across every Merkle–Damgård step, plugging a target collision-resistant compression function with
one fixed key directly into Merkle–Damgård can fail to give a target collision-resistant hash
([BS23], Section 8.11.3, p. 340). The tree constructions adapted here use independent keys
across stages so that the reduction can compute the target compression input at a guessed stage
before receiving the challenge key at that stage ([NY89], March 13, 1995 manuscript
revision, Section 2.3; [Gol04], Section 6.4.3.2, June 2003 chapter draft Constructions
6.4.24 and 6.4.26, Propositions 6.4.25 and 6.4.27).
We formalize:
- Two-stage target-collision adversaries (
TargetCollisionFinder,TargetCollisionFinder.IsPPT), the experimenttargetCollisionGamewith strict PPT certificates, and security predicatesTargetCollisionResistantOnandTargetCollisionResistant, together with the zero-loss implication from full collision resistance (CollisionResistantOn.targetCollisionResistantOn). - Syntactic and plain polynomial-time bundled interfaces
KeyedCompressionFamily(2M(n) → M(n)underkeyLen n-bit keys withn ≤ M(n)) andKeyedHashFamily(unrestricted bit-string inputs underkeyLen n-bit keys withn ≤ digestLen n), allowing polynomial key and digest schedules, plus bridges fromCompressionFamilyandHashFamily. - Level-keyed binary-tree + length-block domain extension (
uowhfTreeHash), stretching any target collision-resistantKeyedCompressionFamilyto an unrestricted target collision-resistantKeyedHashFamilyon allList Boolusing(n + 1) * keyLen n-bit keys (KeyedCompressionFamily.treeHash,KeyedCompressionFamily.targetCollisionResistant_treeHash).
Source mapping and finite-parameter boundary #
Whereas [BS23], Section 8.11.3 (pp. 339–340, Fig. 8.15 and Theorem 8.13) presents a linear
chain that reuses one compression key k₁ at every step and XORs one of 1 + log₂ L masks
k₂[ν(i)] into the chaining value, so that its key is logarithmic in the message length (and
mentions a tree-based alternative with logarithmic-size keys on p. 340), and the Naor–Yung (1995
revision, Section 2.3) and Goldreich (June 2003 draft, Section 6.4.3.2) tree constructions hash
fixed-length block sequences before composing with length disambiguation, uowhfTreeHash adapts
level-keyed binary-tree hashing into a single total function on List Bool:
uowhfLeavesencodes each bit ofmsgas a zero-paddedM-bit leaf block ([0^M]whenmsg = []), whereM = blockLen nsatisfiesn ≤ M;uowhfTreeLevelsfoldsnfixed binary-tree halving levels under independent subkeysk_0, ..., k_{n-1}, andtop.headD []selects the first resulting block;- a final
(n + 1)-st compression underk_ncombines that block withBitString.lowBits M msg.length(msg.length mod 2^M).
At any fixed parameter n, messages with msg.length > 2 ^ n exceed the n-level tree capacity:
top has multiple blocks and top.headD [] discards the extra roots (for example, at n = 1,
[false, false, false] and [false, false, true] produce identical digests for every h, K,
keyLen, and blockLen). The arbitrary-input security theorem
KeyedCompressionFamily.targetCollisionResistant_treeHash holds asymptotically because strict-PPT
admissibility bounds the output lengths of both adversary.choose and adversary.find by
polynomials in n; for all sufficiently large n, every supported m₀ and m₁ satisfies
length < 2 ^ n ≤ 2 ^ M, within the injective tree and length-block regime where top is a
singleton and lowBits M records msg.length injectively.
Main definitions #
Cslib.Crypto.TargetCollisionFinder,Cslib.Crypto.TargetCollisionFinder.IsPPT: two-stage target-collision adversaries and uniform strict PPT admissibility.Cslib.Crypto.targetCollisionGame,Cslib.Crypto.TargetCollisionResistantOn,Cslib.Crypto.TargetCollisionResistant: two-stage target-collision game and security predicates.Cslib.Crypto.KeyedCompressionFamily,Cslib.Crypto.KeyedHashFamily: keyed compression and unrestricted hash families with polynomial key/digest schedules.Cslib.Crypto.uowhfLeaves,Cslib.Crypto.uowhfPairInput,Cslib.Crypto.uowhfTreeStep,Cslib.Crypto.uowhfTreeLevels,Cslib.Crypto.uowhfTreeHash: level-keyed binary-tree + length-block domain extension.Cslib.Crypto.uowhfCandidateInput,Cslib.Crypto.uowhfTreeAdversary: node compression-input extractor and two-stage planted-subkey reduction.
Main results #
Cslib.Crypto.isPPTOn_targetCollisionGame,Cslib.Crypto.isPPT_targetCollisionGame: strict PPT certificates fortargetCollisionGame.Cslib.Crypto.CollisionResistantOn.targetCollisionResistantOn: full collision resistance implies target collision resistance with identical game success probability.Cslib.Crypto.computableInPolyTime_uowhfTreeHash: plain polynomial-time evaluation ofuowhfTreeHash.Cslib.Crypto.exists_uowhfCandidateInput_collision: deterministic extraction of a colliding2M-bit compression pair at some leveli ≤ nand pair indexj < B.Cslib.Crypto.succProbability_targetCollisionGame_uowhfTreeHash_le: concrete security bound foruowhfTreeHashwith multiplicative lossdyadicSize ((n + 1) * maxBlocks n).Cslib.Crypto.KeyedCompressionFamily.targetCollisionResistant_treeHash: any target collision-resistantKeyedCompressionFamilyextends to an unrestricted target collision-resistantKeyedHashFamilyonList Bool.
References #
- M. Naor, M. Yung, Universal One-Way Hash Functions and their Cryptographic Applications, Section 2 (and Section 2.3 of the March 13, 1995 manuscript revision).
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Sections 8.11.2–8.11.3 (pp. 337–340).
- O. Goldreich, Foundations of Cryptography: Volume 2, Basic Applications, Sections 6.4.3 and 6.4.3.2 (Constructions 6.4.24 and 6.4.26, Propositions 6.4.25 and 6.4.27 in the June 2003 chapter draft).
A two-stage target-collision adversary ([NY89], Section 2; [BS23],
Section 8.11.2, Attack Game 8.5 and Definition 8.7; [Gol04], Section 6.4.3): choose
selects a target message and saved state from 1^n before the hash key is sampled, and find
produces a second message after receiving the sampled key.
Select
(m₀, state)given unarynbefore the hash key is chosen.Given unary
n, savedstate, and sampled hashkey, output a candidatem₁.
Uniform strict PPT admissibility for both stages of a TargetCollisionFinder, charging the full
saved-state word passed from choose to find.
- choose : Probability.IsPPTOn Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) adversary.choose
Target selection is uniform strict PPT on unary
n. - find : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits fun (x : ℕ × List Bool × List Bool) => match x with | (n, state, key) => adversary.find n state key
Second-preimage search is uniform strict PPT on
(1^n, state, key).
The two-stage target-collision experiment ([NY89], Section 2; [BS23],
Section 8.11.2, Attack Game 8.5): run adversary.choose n to obtain (m₀, state), sample a
uniform keyLen n-bit key k, run adversary.find n state k to obtain m₁, and accept iff
isCollision (H n) valid n k choice.1 m₁ holds.
Run the complete target-collision experiment in uniform strict PPT on unary n.
The target-collision experiment is uniformly strict PPT, independently of unused auxiliary input.
Target collision resistance (universal one-wayness) of H with key-length schedule keyLen on
valid against every uniform strict PPT TargetCollisionFinder ([NY89], Section 2;
[BS23], Section 8.11.2, Definition 8.7; [Gol04], Section 6.4.3).
Unrestricted target collision resistance on all bit strings List Bool:
TargetCollisionResistantOn with every word valid. This is [BS23], Attack Game 8.5 and
Definition 8.7 (pp. 337–338) for the keyed hash H n with uniform keyLen n-bit keys, against
uniform strict PPT two-stage adversaries.
Target collision resistance gives negligible success probability in targetCollisionGame for
every strict PPT TargetCollisionFinder.
Establish TargetCollisionResistantOn by bounding every strict PPT adversary's success
probability.
Restricting the valid input domain preserves target collision resistance.
Finding target collisions with probability bounded away from zero refutes
TargetCollisionResistantOn: a strict PPT adversary whose success probability is at least a fixed
c > 0 at every security parameter.
Full collision resistance implies target collision resistance: running both stages of a
TargetCollisionFinder inside a single-stage CollisionFinder produces the exact same game
distribution, since adversary.choose n is independent of BitString.sampleList n.
Bundled keyed compression and hash families #
A uniform keyed 2 * blockLen n → blockLen n compression family with plain polynomial-time key
length, block length, and evaluation, satisfying n ≤ blockLen n so n-bit lengths embed
injectively into blockLen n-bit blocks.
Key bit-length at security parameter
n.Output (and half-input) block bit-length at security parameter
n.Keyed compression evaluator
eval n k x.- keyLen_polyTime : Turing.MultiTapeTM.ComputableInPolyTime self.keyLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
Key length is computable in plain polynomial time from unary
n. - blockLen_polyTime : Turing.MultiTapeTM.ComputableInPolyTime self.blockLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
Block length is computable in plain polynomial time from unary
n. - polyTime : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × List Bool) => match x with | (n, k, x) => self.eval n k x) (encKeyedInput Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits
Compression is computable in plain polynomial time on
(1^n, k, x). Block length is at least
nat security parametern.
Valid 2 * C.blockLen n-bit compression inputs for C at security parameter n.
Testing C.validInput is computable in plain polynomial time.
A uniform keyed hash family on arbitrary-length bit strings List Bool, with plain
polynomial-time key length, digest length, and evaluation, satisfying n ≤ digestLen n.
Key bit-length at security parameter
n.Digest bit-length at security parameter
n.Keyed hash evaluator
eval n k msg.- keyLen_polyTime : Turing.MultiTapeTM.ComputableInPolyTime self.keyLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
Key length is computable in plain polynomial time from unary
n. - digestLen_polyTime : Turing.MultiTapeTM.ComputableInPolyTime self.digestLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
Digest length is computable in plain polynomial time from unary
n. - polyTime : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × List Bool) => match x with | (n, k, msg) => self.eval n k msg) (encKeyedInput Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits
Hashing is computable in plain polynomial time on
(1^n, k, msg). Digest length is at least
nat security parametern.
View a 2n → n collision-resistant CompressionFamily as a KeyedCompressionFamily with
keyLen = id and blockLen = id.
Every CompressionFamily is target collision-resistant on 2n-bit inputs.
View an unrestricted HashFamily as a KeyedHashFamily with keyLen = id and
digestLen = id.
Every HashFamily is unrestrictedly target collision-resistant on List Bool.
Level-keyed binary-tree + length-block domain extension #
Compress one level of the binary hash tree under subkey k: keep level unchanged if it has at
most one block, and otherwise compress each adjacent pair into an M-bit block.
After keys.length tree-compression levels, any nonempty leaf list of length at most
2 ^ keys.length collapses to a single root block.
Folding uowhfTreeStep is computable in plain polynomial time whenever h and the parameters
are computable in plain polynomial time.
Level-keyed binary-tree + length-block hash: total fixed-depth adaptation of level-keyed
tree hashing ([NY89], 1995 revision, Section 2.3; [Gol04], Section 6.4.3.2, June
2003 draft Constructions 6.4.24 and 6.4.26; cf. [BS23], Section 8.11.3, p. 340). Split K
into n level subkeys k_0, ..., k_{n-1} plus one final subkey k_n of width keyLen n, fold
uowhfTreeStep across k_0, ..., k_{n-1} starting from the one-bit-per-leaf encoding
uowhfLeaves (blockLen n) msg, take root := padOrTake (blockLen n) (top.headD []), and compress
root ++ BitString.lowBits (blockLen n) msg.length (msg.length mod 2^{blockLen n}) under k_n.
At fixed n, messages with msg.length > 2 ^ n leave multiple blocks in top and top.headD []
discards the extra roots; for msg.length < 2 ^ n ≤ 2 ^ blockLen n, top is a singleton and
lowBits records msg.length injectively.
Evaluating uowhfTreeHash is computable in plain polynomial time on (1^n, K, msg).
Deterministic tree collision witness #
Deterministic node-collision extraction for uowhfTreeHash: whenever two distinct messages
m₀ ≠ m₁ of length < 2 ^ n (with m₀.length ≤ B, 1 ≤ B, 1 ≤ n, and n ≤ blockLen n) produce
the same digest under uowhfTreeHash, there exist a subkey index i ≤ n and a pair index j < B
whose 2 * blockLen n-bit candidate inputs collide under BitString.listRow (keyLen n) i K.
Two-stage planted-subkey reduction for uowhfTreeHash #
Two-stage target-collision reduction from uowhfTreeHash to the underlying compression family
h: Stage 1 samples a dyadic slot slot < (n + 1) * maxBlocks n encoding (i, j) (i ≤ n,
j < maxBlocks n), runs adversary.choose n, samples i prefix subkeys front before seeing the
challenge subkey, and outputs the (i, j) target compression input x₀; Stage 2 receives the
challenge subkey kStar, samples the remaining n - i suffix subkeys back, runs
adversary.find on front ++ kStar ++ back, and extracts the (i, j) candidate input x₁.
uowhfTreeAdversary is a uniform strict PPT TargetCollisionFinder whenever h, keyLen,
blockLen, maxBlocks are plain polynomial-time and adversary is strict PPT.
Concrete security bound for uowhfTreeHash: at any security parameter n ≥ 1 with
n ≤ blockLen n, 1 ≤ maxBlocks n, and every supported message pair (m₀, m₁) of adversary
satisfying m₀.length ≤ maxBlocks n, m₀.length < 2 ^ n, and m₁.length < 2 ^ n, the
target-collision success probability of adversary against uowhfTreeHash is at most
dyadicSize ((n + 1) * maxBlocks n) times that of uowhfTreeAdversary against h.
Extend any KeyedCompressionFamily C (2 * C.blockLen n → C.blockLen n under
C.keyLen n-bit keys) to an unrestricted KeyedHashFamily on List Bool with
(n + 1) * C.keyLen n-bit keys and C.blockLen n-bit digests via uowhfTreeHash. Note that at
fixed n, uowhfTreeHash has injective tree capacity < 2 ^ n bits and discards extra roots
beyond 2 ^ n via List.headD; asymptotic security on all List Bool relies on strict-PPT
adversary output-length bounds.
Domain extension for target collision resistance (adapting [NY89], 1995 revision,
Section 2.3 and [Gol04], Section 6.4.3.2, June 2003 draft Constructions 6.4.24 and 6.4.26,
Propositions 6.4.25 and 6.4.27; cf. [BS23], Section 8.11.3, pp. 339–340): if C is
target collision-resistant on 2 * C.blockLen n-bit inputs, then C.treeHash is unrestrictedly
target collision-resistant on all List Bool. Strict-PPT admissibility bounds the output lengths of
both adversary.choose and adversary.find by polynomials in n, placing every supported m₀ and
m₁ strictly below 2 ^ n ≤ 2 ^ C.blockLen n for all sufficiently large n.