Documentation

CslibFrontier.Crypto.Computational.InaccessibleEntropy.TargetCollision

Target collision-resistant hashing from inaccessible entropy and one-way functions #

Completing the construction of universal one-way hash families (target collision-resistant hash families) from arbitrary one-way functions ([Rompel1990]; [Shoup2000]; [HHRVW2020], Section 5.1, Theorem 5.1, STEPS 4–5, Lemmas 5.6 and 5.7, pp. 29–32):

  1. Target shift (rompelShiftedStep; [HHRVW2020], Section 5.1.4, Lemma 5.6, pp. 29–30, and Section 5.1.5, STEP 4, p. 31): given a ShrinkingCollisionGrid G whose gridCount n candidates compress G.inLen n = G.outLen n + G.shrinkLen n bits to G.outLen n bits (with G.shrinkLen n = Nat.log 2 n + 1 on the canonical grid AdversaryInaccessibleEntropyFamily.exists_shrinkingCollisionGrid_log), shifting the input of candidate q by a G.inLen n-bit key mask y via w ↦ G.evalGrid n q (listXor (G.inLen n) [w, y]) converts random-input collision resistance at q = goodIdx n into keyed target collision resistance on G.inLen n-bit inputs.
  2. Shoup O(|y| log t) XOR-masking cascade and candidate concatenation (rompelCandidateEval, rompelCompressionEval, rompelCompression, rompelKeyLen_le; [Shoup2000]; [HHRVW2020], Section 5.1.4, Lemma 5.7, p. 30, and Section 5.1.5, STEP 5(ii–iii), p. 32): instantiating ShoupComposition.shoupComposeEval with rompelShiftedStep over rompelCascadeSteps G n = ⌈(2 * G.gridCount n - 1) * G.outLen n / G.shrinkLen n⌉ steps compresses 2 * rompelBlockLen G n bits to G.outLen n bits for each q < G.gridCount n, and concatenating all G.gridCount n candidate outputs produces a halving KeyedCompressionFamily (rompelCompression G) with block width rompelBlockLen G n = G.gridCount n * G.outLen n.
    • Key length (rompelKeyLen_le): the shared key K = y ++ masks has bit-length rompelKeyLen G n = G.inLen n + (Nat.log 2 (rompelCascadeSteps G n) + 1) * G.outLen n ≤ (Nat.log 2 (rompelCascadeSteps G n) + 2) * G.inLen n, matching [HHRVW2020] Lemma 5.7's O(|y| log t) bound directly on rompelCompression G.
    • Shared key across candidates vs. [HHRVW2020] STEP 5(iii): sharing one Shoup key K = (y, M₀, …, M_d) across all G.gridCount n candidate rows suffices for every security, PPT, key-length, and domain-extension claim in the library because for each strict PPT adversary adv, G.exists_good_candidate supplies one index goodIdx n, so rompelCompressionInverter G adv only needs faithful key simulation at goodIdx n. Sharing K achieves the same multiplicative reduction loss dyadicSize (G.gridCount n) * dyadicSize (rompelCascadeSteps G n) with G.gridCount n-times shorter keys than per-candidate keys.
  3. Modular reduction via ShoupComposition (rompelCompressionInverter, succProbability_targetCollisionGame_rompelCompression_le, ShrinkingCollisionGrid.targetCollisionResistant_rompelCompression): projecting rompelCompressionEval onto row qStar (listRow_rompelCompressionEval) reduces collisions on rompelCompression G to rompelCandidateEval G · qStar, where succProbability_targetCollisionGame_shoupCompose_le reduces rompelCascadeSteps G n steps to a single call to rompelShiftedStep G · qStar with loss dyadicSize (rompelCascadeSteps G n). Guessing qGuess via sampleDyadicIndex (G.gridCount n) and XOR-shifting the uniform challenge zWord against shoupComposeChoose's target w₀ (yStar := zWord ⊕ w₀) completes Lemma 5.6's 1-step reduction to randomCollisionGame with total loss dyadicSize (G.gridCount n) * dyadicSize (rompelCascadeSteps G n) and zero additive error.
  4. Domain extension to List Bool (rompelHash, ShrinkingCollisionGrid.targetCollisionResistant_rompelHash, AdversaryInaccessibleEntropyFamily.exists_targetCollisionResistantHash, OneWay.exists_targetCollisionResistant_keyedHashFamily): composing rompelCompression G with KeyedCompressionFamily.treeHash (uowhfTreeHash) yields an unrestricted computational target collision-resistant KeyedHashFamily on List Bool from any uniform OneWay function, establishing the qualitative polynomial-time target collision-resistance part of [HHRVW2020] Theorem 5.1 (with dense two-universal matrices in EntropyReduction and (n + 1)-level treeHash in rompelHash).

Main definitions #

Main results #

References #

Schedules and XOR-shifted G.shrinkLen n-bit shrinking step (Lemma 5.6, STEP 4) #

Number of G.shrinkLen n-bit cascade steps ((2 * G.gridCount n - 1) * G.outLen n + G.shrinkLen n - 1) / G.shrinkLen n used by each candidate in rompelCompression G ([HHRVW2020], Section 5.1.5, STEP 5(ii), p. 32).

Output (and half-input) block width G.gridCount n * G.outLen n of rompelCompression G ([HHRVW2020], Section 5.1.5, STEP 5(iii), p. 32).

Shared Shoup O(|y| log t) key bit-length G.inLen n + (Nat.log 2 (rompelCascadeSteps G n) + 1) * G.outLen n of rompelCompression G ([Shoup2000]; [HHRVW2020], Section 5.1.4, Lemma 5.7, p. 30).

[HHRVW2020] Lemma 5.7 O(|y| log t) key-length bound: rompelKeyLen G n ≤ (Nat.log 2 (rompelCascadeSteps G n) + 2) * G.inLen n.

XOR-shifted G.shrinkLen n-bit shrinking step ([HHRVW2020], Section 5.1.4, Lemma 5.6, pp. 29–30; Section 5.1.5, STEP 4, p. 31): masks w by y at width G.inLen n and evaluates candidate q of G (G.outLen n + G.shrinkLen n = G.inLen n).

Shoup O(|y| log t) XOR-masking cascade and step-collision extraction (Lemma 5.7) #

Candidate-q 2 * rompelBlockLen G n → G.outLen n Shoup XOR-masking cascade evaluator under compact key K (y := BitString.listRow (G.inLen n) 0 K, masks := K.drop (G.inLen n)).

Step-i (1 ≤ i ≤ rompelCascadeSteps G n) G.inLen n-bit input fed to rompelShiftedStep G n q (BitString.listRow (G.inLen n) 0 K) during rompelCandidateEval G n q K x.

theorem Cslib.Crypto.exists_rompelCascadeInput_collision (G : ShrinkingCollisionGrid) {n q : ℕ} {K x₀ x₁ : List Bool} (hx₀ : x₀.length = 2 * rompelBlockLen G n) (hx₁ : x₁.length = 2 * rompelBlockLen G n) (hne : x₀ ≠ x₁) (hcol : rompelCandidateEval G n q K x₀ = rompelCandidateEval G n q K x₁) :
∃ (i : ℕ), 1 ≤ i ∧ i ≤ rompelCascadeSteps G n ∧ rompelCascadeInput G n q i K x₀ ≠ rompelCascadeInput G n q i K x₁ ∧ rompelShiftedStep G n q (BitString.listRow (G.inLen n) 0 K) (rompelCascadeInput G n q i K x₀) = rompelShiftedStep G n q (BitString.listRow (G.inLen n) 0 K) (rompelCascadeInput G n q i K x₁)

Deterministic step-collision extraction ([Shoup2000], [HHRVW2020], Section 5.1.4, Lemma 5.7, p. 30): if two distinct 2 * rompelBlockLen G n-bit inputs x₀ ≠ x₁ collide under rompelCandidateEval G n q K, there exists a step 1 ≤ i ≤ rompelCascadeSteps G n where their G.inLen n-bit step inputs rompelCascadeInput G n q i K are distinct yet collide under rompelShiftedStep G n q (BitString.listRow (G.inLen n) 0 K).

gridCount n-way candidate concatenation (adapting [HHRVW2020], STEP 5(iii), p. 32) #

gridCount n-way concatenated compression evaluator (adapting [HHRVW2020], Section 5.1.5, STEP 5(iii), p. 32): evaluates rompelCandidateEval G n q K x for every 0 ≤ q < G.gridCount n under the shared key sequence K and concatenates the G.outLen n-bit digests into a rompelBlockLen G n-bit block.

Rompel / HHRVW halving KeyedCompressionFamily (adapting [Shoup2000]; [HHRVW2020], Section 5.1.5, STEP 4 and STEP 5(ii–iii), pp. 31–32): compresses 2 * rompelBlockLen G n-bit blocks to rompelBlockLen G n-bit blocks under shared O(|y| log t) Shoup XOR-masking keys (rompelKeyLen G n).

[HHRVW2020] Lemma 5.7 O(|y| log t) key-length bound directly on (rompelCompression G).keyLen.

Modular reduction via ShoupComposition to randomCollisionGame #

Planted-subkey reduction to randomCollisionGame ([Shoup2000]; [HHRVW2020], Section 5.1.4, Lemmas 5.6–5.7, pp. 29–30; Section 5.1.5, STEPS 4–5, pp. 31–32): samples a dyadic candidate guess qGuess, runs shoupComposeChoose to obtain the planted G.inLen n-bit step target choice.1 and encoded Shoup state choice.2, shifts the challenge zWord to form yStar = listXor (G.inLen n) [zWord, choice.1], runs shoupComposeFindWith on rompelShiftedStep G n q at key yStar, and unmasks the returned step input via w₁ ⊕ yStar.

rompelCompressionInverter G adversary is uniformly strict PPT whenever adversary is strict PPT.

Concrete security bound for rompelCompression G: at every candidate index qStar < G.gridCount n, the target-collision success probability of adversary against rompelCompression G is at most dyadicSize (G.gridCount n) * dyadicSize (rompelCascadeSteps G n) times the random-collision success probability of rompelCompressionInverter G adversary against candidate qStar.

Adapting [HHRVW2020], Section 5.1.5, STEP 4 and STEP 5(ii–iii) (pp. 31–32): for any ShrinkingCollisionGrid G, rompelCompression G is a target collision-resistant KeyedCompressionFamily.

Unrestricted KeyedHashFamily and OneWay UOWHF endpoints #

Rompel / HHRVW unrestricted KeyedHashFamily ([Rompel1990]; [HHRVW2020], Section 5.1, Theorem 5.1, p. 26): hashes arbitrary-length bit strings List Bool to rompelBlockLen G n-bit digests via (rompelCompression G).treeHash (inheriting uowhfTreeHash's (n + 1)-level binary tree and < 2 ^ n finite-parameter tree capacity).

End-to-end target collision-resistant compression from Definition 3.9 (AdversaryInaccessibleEntropyFamily) preserving both the (Nat.log 2 n + 1)-bit candidate shrinkage of exists_shrinkingCollisionGrid_log and Lemma 5.7's O(|y| log t) shared-key bound rompelCompression_keyLen_le.

End-to-end target collision-resistant compression from any uniform OneWay function, preserving both (Nat.log 2 n + 1)-bit candidate shrinkage and Lemma 5.7's O(|y| log t) shared-key bound rompelCompression_keyLen_le.

Qualitative polynomial-time target collision-resistant compression from Definition 3.9 ([HHRVW2020], Section 5.1, Theorem 5.1, p. 26): every AdversaryInaccessibleEntropyFamily yields a target collision-resistant KeyedCompressionFamily. EntropyReduction uses dense two-universal matrices rather than Toeplitz hashing; see exists_shrinkingCollisionGrid_rompelCompression and rompelCompression_keyLen_le for the Lemma 5.7 O(|y| log t) key-length bound.

Qualitative polynomial-time target collision-resistant hashing from Definition 3.9 ([HHRVW2020], Section 5.1, Theorem 5.1, p. 26): every AdversaryInaccessibleEntropyFamily yields an unrestricted target collision-resistant KeyedHashFamily on List Bool via the (n + 1)-level KeyedCompressionFamily.treeHash wrapper (EntropyReduction uses dense two-universal matrices; see rompelCompression_keyLen_le for the Lemma 5.7 compression key bound).

Qualitative polynomial-time target collision-resistant compression from OneWay ([HHRVW2020], Section 5.1, Theorem 5.1, p. 26): every uniform OneWay function yields a target collision-resistant KeyedCompressionFamily (EntropyReduction uses dense two-universal matrices; see OneWay.exists_shrinkingCollisionGrid_rompelCompression and rompelCompression_keyLen_le for the Lemma 5.7 O(|y| log t) key-length bound).

Rompel–HHRVW universal one-way hash theorem ([Rompel1990]; [HHRVW2020], Section 5.1, Theorem 5.1, p. 26, qualitative polynomial-time scope): every uniform OneWay function implies the existence of an unrestricted target collision-resistant KeyedHashFamily on List Bool (EntropyReduction uses dense two-universal matrices and rompelHash uses the (n + 1)-level KeyedCompressionFamily.treeHash; see rompelCompression_keyLen_le for the Lemma 5.7 O(|y| log t) compression key bound).