Documentation

CslibFrontier.Crypto.Computational.SecondPreimageResistant.XorTarget

Target collision resistance from second-preimage resistance (H(k ⊕ m)) #

Given a hash function H : List Bool → List Bool, the XOR-masked keyed family $$H_{\mathrm{tcr}}(k, m) := H(k \oplus m)$$ ([BS23], Section 8.11.3, equation (8.18) and Theorem 8.12, pp. 338–339) is target collision-resistant on n-bit messages under uniform n-bit keys whenever H is second-preimage resistant on any validity domain valid that eventually admits all n-bit strings (in particular Definition 8.6's {0, 1}ⁿ domain validFixedLengthInput or unrestricted SecondPreimageResistant):

The restriction to validFixedLengthInput (messages of length n, matching the book's fixed domain M = {0, 1}^n in equation (8.18)) is essential because BitString.listXor n pads or truncates its inputs to n bits: without validFixedLengthInput, m₀ = [] and m₁ = [false] collide under xorTargetHash H n k for every H, n, and k. Likewise, valid n must admit n-bit words because xorTargetToSecondPreimage produces an n-bit candidate m₁ ⊕ k.

Main definitions #

Main results #

References #

Validity predicate for n-bit messages at security parameter n.

The XOR-masked keyed hash family H_tcr(k, m) = H(k ⊕ m) of [BS23], Section 8.11.3, equation (8.18), p. 338, at security parameter n (where keys and messages have length n).

@[simp]

The second-preimage finder B of [BS23], Theorem 8.12 (pp. 338–339): given unary n and a uniform n-bit input m, run adversary.choose n to obtain (m₀, state), plant the key k := m ⊕ m₀, run adversary.find n state k to obtain m₁, and output m₁ ⊕ k.

Running both stages of a strict PPT TargetCollisionFinder with two n-bit XOR operations is uniformly strict PPT.

Theorem 8.12, concrete bound ([BS23], Section 8.11.3, pp. 338–339): for every target-collision adversary adversary attacking xorTargetHash H on n-bit messages and any second-preimage domain predicate valid that accepts all n-bit words, the second-preimage finder xorTargetToSecondPreimage adversary wins secondPreimageGameOn H valid at least as often as adversary wins targetCollisionGame.

Theorem 8.12 ([BS23], Section 8.11.3, p. 338): if H is second-preimage resistant on a domain valid that eventually admits all n-bit words (in particular Definition 8.6's {0, 1}ⁿ domain validFixedLengthInput or unrestricted SecondPreimageResistant), then H_tcr(k, m) = H(k ⊕ m) is target collision-resistant on n-bit messages under uniform n-bit keys.