Naor–Yung universal one-way hash functions from one-way permutations #
Naor and Yung ([NY89], Section 3; §§2.1–2.3 in the March 13, 1995 manuscript revision;
see also [Gol04], Section 6.4.3.2, June 2003 chapter draft Construction 6.4.20 and
Proposition 6.4.21) construct a universal one-way (target collision-resistant) hash family from any
one-way permutation f without collision-free trapdoors.
This module is about that hash construction only. It is not the Naor–Yung public-key encryption
scheme secure against non-adaptive chosen-ciphertext attacks (CCA1), which comes from a different
paper and which the library does not formalize.
Rather than pairing f with an (m - 1) × m affine/Toeplitz universal hash, this module uses a
direct {0, δ}-coset pivot-deletion quotient on m-bit shift keys δ so that the single-step
reduction has exact loss 1 and zero additive error:
- One-bit quotient (
m → m - 1): given a shiftδ ∈ {0, 1}^mwhose firsttruecoordinate isp < m(0whenδ = 0^m), quotient{0, 1}^mby{0, δ}by XORing withδwhenever bitpistrue(naorYungCanon) and deleting bitp(naorYungShrink). Whenδ ≠ 0^m, every nontrivial collisiony₀ ≠ y₁undernaorYungShrink m δforcesy₁ = y₀ ⊕ δ. - Single-step
(n + 2) → (n + 1)UOWHF (naorYungStep f): composingfon(n + 2)-bit inputs withnaorYungShrink (n + 2) δyields a1-bit shrinking target collision-resistant family. Given a random challengey = f x*ininversionGame f _ (n + 2)and the adversary's committed targetw₀, plantingδ := f w₀ ⊕ yproduces an exact uniform(n + 2)-bit key, and any valid target collisionw₁ ≠ w₀satisfies eitherf w₀ = y(δ = 0^{n+2}) orf w₁ = f w₀ ⊕ δ = y(δ ≠ 0^{n+2}), invertingywith security loss1. - Iterated
2(n + 1) → (n + 1)compression (naorYungCompression) and arbitrary-length hashing (naorYungHash): cascadingn + 1steps with independent(n + 2)-bit subkeys compresses2(n + 1)bits ton + 1bits (KeyedCompressionFamily), and composing withKeyedCompressionFamily.treeHashyields an unrestricted target collision-resistantKeyedHashFamilyon allList Bool(withintreeHash's< 2 ^ nfinite-parameter tree capacity, which covers all strict-PPT adversaries asymptotically).
Main definitions #
Cslib.Crypto.naorYungPivot,Cslib.Crypto.naorYungCanon,Cslib.Crypto.naorYungShrink: pivot index, canonical{0, δ}-coset representative, and(m) → (m - 1)quotient map.Cslib.Crypto.naorYungStep,Cslib.Crypto.naorYungStepInverter: single-step(n + 2) → (n + 1)hash from a permutationfand its zero-loss reduction toinversionGame.Cslib.Crypto.naorYungCascade,Cslib.Crypto.naorYungCompressionEval,Cslib.Crypto.naorYungCompression:(n + 1)-step2(n + 1) → (n + 1)KeyedCompressionFamily.Cslib.Crypto.naorYungCascadeInput,Cslib.Crypto.naorYungCascadeAdversary: step-input extractor and planted-subkey reduction fromnaorYungCompressiontonaorYungStep.Cslib.Crypto.naorYungHash: unrestrictedKeyedHashFamilyonList Boolobtained viaKeyedCompressionFamily.treeHash.
Main results #
Cslib.Crypto.naorYungShrink_collision_eq_listXor: every distinctm-bit collision under a nonzero shiftδsatisfiesy₁ = BitString.listXor m [y₀, δ].Cslib.Crypto.succProbability_targetCollisionGame_naorYungStep_le: single-step target-collision success at parameternis bounded byinversionGamesuccess at lengthn + 2.Cslib.Crypto.OneWayPermutation.targetCollisionResistantOn_naorYungStep:naorYungStep fis target collision-resistant on(n + 2)-bit inputs wheneverfis aOneWayPermutation.Cslib.Crypto.exists_naorYungCascadeInput_collision,Cslib.Crypto.succProbability_targetCollisionGame_naorYungCompressionEval_le: deterministic step-collision extraction anddyadicSize (n + 1)reduction bound fornaorYungCompressionEval.Cslib.Crypto.OneWayPermutation.targetCollisionResistant_naorYungCompression,Cslib.Crypto.OneWayPermutation.targetCollisionResistant_naorYungHash,Cslib.Crypto.OneWayPermutation.exists_targetCollisionResistant_keyedHashFamily: everyOneWayPermutationyields a target collision-resistantKeyedCompressionFamilyand unrestrictedKeyedHashFamily.
References #
- M. Naor, M. Yung, Universal One-Way Hash Functions and their Cryptographic Applications, Section 3 in the 1989 proceedings; §§2.1–2.3 (Lemma 2.1/Theorem 1, Lemma 2.2, and succinct block hashing) in the March 13, 1995 manuscript revision.
- O. Goldreich, Foundations of Cryptography, Volume 2: Basic Applications, Section 6.4.3.2 (Constructions 6.4.20–6.4.26 and Propositions 6.4.21–6.4.27 in the June 2003 chapter draft).
One-bit coset quotient m → m - 1 #
Computing naorYungPivot is plain polynomial-time on unary m and raw bit string δ.
Canonical {0, δ}-coset representative of y at width m: normalize y to width m and XOR
with δ when coordinate naorYungPivot m δ is true.
Computing naorYungCanon is plain polynomial-time on unary m and raw bit strings δ, y.
Naor–Yung 1-bit quotient m → m - 1: canonicalize bit p := naorYungPivot m δ via
naorYungCanon m δ y and delete coordinate p.
Computing naorYungShrink is plain polynomial-time on unary m and raw bit strings δ, y.
Collision characterization for naorYungShrink: if δ has a true coordinate below m,
any two distinct m-bit strings y₀ ≠ y₁ colliding under naorYungShrink m δ differ by δ, i.e.,
y₁ = BitString.listXor m [y₀, δ].
Single-step (n + 2) → (n + 1) UOWHF from a one-way permutation #
Evaluating naorYungStep f is plain polynomial-time whenever f is plain polynomial-time.
Zero-loss preimage reduction from naorYungStep f to inversionGame f (adapting
[NY89], Section 3; [Gol04], Section 6.4.3.2, June 2003 draft Proposition 6.4.21): at
challenge length m ≥ 2, set n := m - 2, run adversary.choose n to obtain a target w₀
(normalized to n + 2 bits), plant δ := f w₀ ⊕ y, run adversary.find n state δ to obtain w₁,
and output whichever of w₁ or w₀ maps to y under f.
naorYungStepInverter is uniformly strict PPT whenever f is plain polynomial-time and
adversary is strict PPT.
Single-step Naor–Yung security bound: for any length-preserving bijection f, the
target-collision success probability of adversary against naorYungStep f at parameter n is at
most the preimage-finding success probability of naorYungStepInverter f adversary against f at
challenge length n + 2 (with factor 1 and zero additive error).
Single-step Naor–Yung UOWHF theorem (adapting [NY89], Section 3; [Gol04],
Section 6.4.3.2, June 2003 draft Construction 6.4.20 and Proposition 6.4.21): if f is a
OneWayPermutation, naorYungStep f is target collision-resistant on (n + 2)-bit inputs under
(n + 2)-bit keys.
(n + 1)-step cascade 2(n + 1) → (n + 1) (naorYungCompression) #
Folding naorYungCascade is computable in plain polynomial time whenever f is computable in
plain polynomial time.
Naor–Yung 2(n + 1) → (n + 1) compression evaluator ([NY89], Section 3;
[Gol04], Section 6.4.3.2): split x into two (n + 1)-bit halves and absorb the second
half one bit at a time across n + 1 independent (n + 2)-bit subkeys from K.
Evaluating naorYungCompressionEval f is plain polynomial-time on (1^n, K, x) whenever f
is plain polynomial-time.
Deterministic step-collision extraction for naorYungCompressionEval: if two distinct
2(n + 1)-bit inputs x₀ ≠ x₁ collide under naorYungCompressionEval f n K, there exists a step
i < n + 1 where their (n + 2)-bit step inputs naorYungCascadeInput f n i K are distinct yet
collide under naorYungStep f n (BitString.listRow (n + 2) i K).
Planted-subkey reduction from naorYungCompressionEval f to naorYungStep f: guess a dyadic
slot slot < n + 1, sample slot prefix (n + 2)-bit subkeys front before seeing the challenge
subkey δStar, commit to the step-slot target input naorYungCascadeInput f n slot front x₀, and
complete K := front ++ δStar ++ back in Stage 2.
naorYungCascadeAdversary is a uniform strict PPT TargetCollisionFinder whenever f is plain
polynomial-time and adversary is strict PPT.
Concrete security bound for naorYungCompressionEval: the target-collision success
probability of adversary against naorYungCompressionEval f at security parameter n is at most
dyadicSize (n + 1) times that of naorYungCascadeAdversary f adversary against
naorYungStep f.
Naor–Yung KeyedCompressionFamily ([NY89], Section 3; [Gol04],
Section 6.4.3.2): compresses 2(n + 1)-bit blocks to (n + 1)-bit blocks under
((n + 1) * (n + 2))-bit keys using any plain polynomial-time function f.
Naor–Yung compression theorem ([NY89], Section 3; [Gol04],
Section 6.4.3.2): if f is a OneWayPermutation, naorYungCompression hf.oneWay.polyTime is a
target collision-resistant KeyedCompressionFamily.
Naor–Yung unrestricted KeyedHashFamily ([NY89], 1995 revision, Sections 2.3 and
3): hashes arbitrary-length bit strings List Bool to (n + 1)-bit digests under
(n + 1)^2 * (n + 2)-bit keys via (naorYungCompression hf).treeHash (inheriting treeHash's
< 2 ^ n finite-parameter tree capacity).
Naor–Yung UOWHF theorem ([NY89], 1995 revision, Sections 2.3 and 3;
[Gol04], Section 6.4.3.2): if f is a OneWayPermutation,
naorYungHash hf.oneWay.polyTime is unrestrictedly target collision-resistant on all List Bool.
Every OneWayPermutation yields an unrestricted target collision-resistant KeyedHashFamily
on List Bool.