Computational security of the Naor–Reingold PRF from DDH #
This module completes the efficient lazy-sampling Decisional Diffie–Hellman (DDH) reduction and
the universal-hash bit-string pseudorandom-function bridge for the Naor–Reingold PRF over a
PrimeOrderGroupFamily ([BS23], Section 10.11, Exercises 10.4, 10.8, 10.11, pp. 424–426,
and Section 4.10, Exercise 4.18, p. 172; [NR04], Section 4.1, Construction 4.1,
Theorem 4.1, Lemma 4.2, Construction 4.2, Theorem 4.3, and Remark 4.2):
- Inverse-order bound from
DDH:DDH.negligible_expected_inv_order, imported fromCslibFrontier.Crypto.Computational.DiffieHellman.Order, makes the setup-averaged inverse group order negligible; it bounds the hashed-PRF error terms below. - Word-level adaptive group-PRF games and lazy-sampling
IsOraclePPTDDH reduction:naorReingoldFrontierOraclememoizesddhFixedUWordRerandomizeonly on thek-bit prefixes queried by anOracleDistinguisherand evaluates the remaining suffix vianaorReingoldWordSuffix. Choosingk ← sampleDyadicIndex (inLen n)yields the uniform strict PPT DDH distinguishernaorReingoldToDDHDistinguisher, proving both quantitative single- distinguisher bounds and asymptotic security underF.DDH setupalone: for the keys drawn with the fair-coin samplersampleNaorReingoldExp(DDH.negligible_naorReingoldProbGame), through the ideal-sampling step with exactly uniform keys (DDH.negligible_naorReingoldWordGame_ideal). - Universal-hash bit-string Naor–Reingold PRF (after [NR04], not checked):
composing
naorReingoldWordEvalwithlinearHashKDFunder a public universal-hash seed (F.withSeedandF.seededSetup) maps a uniform group element to anoutLen n-bit string that is jointly close to uniform with the public seed, with error bounded by the Leftover Hash Lemma; a multi-query Leftover Hash Lemma bound viaPMF.dist_bind_pair_pi_le_sumyields adaptive bit-string PRF security for exponents drawn with the fair-coin sampler (DDH.negligible_naorReingoldHashedProbGame), through the ideal-key-sampling steps with exactly uniform exponents (DDH.negligible_naorReingoldHashedGame_ideal,DDH.negligible_naorReingoldHashedGame_ideal_const).
Main definitions #
Cslib.Crypto.PrimeOrderGroupFamily.sampleNaorReingoldExp: executable modular exponent sampler with statistical slackn + (F.encDesc d).length.Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldWordRealGame,Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldProbRealGame,Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldWordIdealGame: setup-parameterized word-level adaptive Naor–Reingold group-PRF experiments.Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldFrontierOracle: memoized prefix DDH rerandomization followed bynaorReingoldWordSuffix.Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldDescToDDHDistinguisher: single-challenge uniform strict PPT DDH distinguisher constructed from an adaptive PRF distinguisher that reads the group parameters;Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldToDDHDistinguisheris its instance for anOracleDistinguisher, which reads them encoded.Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldHashedWordEval,Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldHashedRealGame,Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldHashedProbRealGame,Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldHashedGroupIdealGame,Cslib.Crypto.PrimeOrderGroupFamily.naorReingoldHashedIdealGame: universal-hash bit-string Naor–Reingold evaluation and setup-parameterized PRF experiments.
Main results #
Cslib.Crypto.PrimeOrderGroupFamily.isPPT_naorReingoldDescToDDHDistinguisher,Cslib.Crypto.PrimeOrderGroupFamily.isPPT_naorReingoldToDDHDistinguisher: uniform strict PPT certificates for both distinguishers from any oracle PPT distinguisher.Cslib.Crypto.PrimeOrderGroupFamily.advantage_naorReingoldProbRealGame_wordRealGame_le: modular-sampling bound between the fair-coin and the exactly uniform keys of the group-PRF.Cslib.Crypto.PrimeOrderGroupFamily.DDH.negligible_naorReingoldProbGame: asymptotic adaptive security of the Naor–Reingold group-PRF with fair-coin keys underF.DDH setup.Cslib.Crypto.PrimeOrderGroupFamily.computableInPolyTime_naorReingoldHashedWordEval,Cslib.Crypto.PrimeOrderGroupFamily.advantage_naorReingoldHashedIdeal_le,Cslib.Crypto.PrimeOrderGroupFamily.DDH.negligible_naorReingoldHashedProbGame: polynomial-time evaluation, multi-query Leftover Hash Lemma bound, and asymptotic bit-string PRF security with fair-coin exponents.
Ideal-sampling steps #
Cslib.Crypto.PrimeOrderGroupFamily.advantage_naorReingoldWordGame_le_ideal,Cslib.Crypto.PrimeOrderGroupFamily.DDH.negligible_naorReingoldWordGame_ideal: the quantitative DDH reduction bound and asymptotic security fornaorReingoldWordRealGame, whose keys are drawn exactly uniformly.DDH.negligible_naorReingoldProbGameconsumes them.Cslib.Crypto.PrimeOrderGroupFamily.DDH.negligible_naorReingoldHashedGame_ideal,Cslib.Crypto.PrimeOrderGroupFamily.DDH.negligible_naorReingoldHashedGame_ideal_const: asymptotic security of the hashed bit-string PRF fornaorReingoldHashedRealGame, whose exponents are drawn exactly uniformly.DDH.negligible_naorReingoldHashedProbGameconsumes the first, andCslibFrontier/Crypto/Computational/NaorReingold/PRF.leanconsumes both.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 4.10 (Exercise 4.18, p. 172) and Section 10.11 (Exercises 10.4, 10.8, and 10.11, pp. 424–426).
- M. Naor, O. Reingold, Number-Theoretic Constructions of Efficient Pseudo-Random Functions, Section 4.1 (Construction 4.1, Theorem 4.1, Lemma 4.2, Construction 4.2, Theorem 4.3, and Remark 4.2); locators not checked.
Word-level Naor–Reingold group-PRF games and prefix hybrids #
Sample a nearly-uniform modular exponent modulo F.order d via F.sampleExp with
n + (F.encDesc d).length statistical slack bits so that the statistical error
1 / 2 ^ (n + |encDesc d|) offsets polynomial query counts depending on |encDesc d|
(original).
Every value supported by sampleNaorReingoldExp is strictly less than F.order d.
Projected to ZMod (F.order d), sampleNaorReingoldExp n d has law
F.sampleModZModLaw (n + (F.encDesc d).length) d.
sampleNaorReingoldExp is uniform strict PPT in (n, d).
Deterministic word-level oracle wrapper encoding fn : BitString m → F.Carrier d on valid
m-bit queries and returning [] on malformed queries.
Setup-parameterized real Naor–Reingold group-PRF game with exact uniform ZMod (F.order d)
exponents ([BS23], Exercise 10.4, p. 424; [NR04], Construction 4.1 &
Theorem 4.1).
Setup-parameterized executable Naor–Reingold group-PRF real game sampling modular exponents via
sampleNaorReingoldExp (original).
Setup-parameterized ideal random group-function game against OracleDistinguisher
([BS23], Exercise 10.4, p. 424; [NR04], Theorem 4.1).
Lazy-sampling frontier oracle and IsOraclePPT DDH distinguisher #
Association-list cache mapping queried k-bit prefixes to encoded group-element pairs.
Executable rerandomized pair sampler for naorReingoldFrontierOracle: draw two exponents via
sampleNaorReingoldExp and apply ddhFixedUWordRerandomize.
Stateful level-k frontier oracle for Naor–Reingold ([BS23], Exercises 10.4(b) &
4.18(b); [NR04], Theorem 4.1): on a valid m-bit query, memoize a freshly
rerandomized DDH pair on query.take k, select the query[k] child, and evaluate the remaining
suffix with naorReingoldWordSuffix. Malformed queries return [] without modifying the cache.
Single-challenge uniform strict PPT DDH distinguisher constructed from an adaptive PRF
distinguisher adv that reads the group parameters directly: sample a hybrid level
k ← sampleDyadicIndex (inLen n), draw suffix exponents αs, and run adv n d against
naorReingoldFrontierOracle, given the encodings of the three DDH elements, from an empty cache
([BS23], Exercises 10.4(b) & 10.11; [NR04], Theorem 4.1).
naorReingoldDescToDDHDistinguisher for an OracleDistinguisher, which reads the encoded
group parameters F.encDesc d.
naorReingoldDescToDDHDistinguisher is uniform strict PPT whenever inLen is computable
in polynomial time in unary and adv is oracle PPT on the security parameter and group
parameters.
naorReingoldToDDHDistinguisher is uniform strict PPT whenever inLen is computable in
polynomial time in unary and adversary satisfies IsOraclePPT encBool ([BS23],
Exercise 10.4(b); [NR04], Theorem 4.1).
Quantitative and asymptotic DDH security of the Naor–Reingold group-PRF #
Ideal-sampling step toward [BS23], Exercise 10.4 (p. 424), not the cited result:
in naorReingoldWordRealGame, whose keys are drawn exactly uniformly from ZMod (F.order d), if
adversary makes at most Q d queries on d ∈ (setup n).support with modular-sampling slack
bounded by ε, then its PRF distinguishing advantage is at most dyadicSize (inLen n) times the
single-challenge DDH advantage of naorReingoldToDDHDistinguisher plus 2 * ε plus the
setup-averaged inverse group order. With the fair-coin keys of naorReingoldProbRealGame the bound
gains the term of advantage_naorReingoldProbRealGame_wordRealGame_le.
Modular-sampling distance between naorReingoldProbRealGame and naorReingoldWordRealGame:
replacing (inLen n + 1) calls to sampleNaorReingoldExp by exact uniform ZMod (F.order d)
exponents changes the output distribution by at most (inLen n + 1) / 2 ^ n.
Ideal-sampling step toward [BS23], Exercise 10.4 (p. 424), not the cited result: if
F.DDH setup holds and inLen is computable in polynomial time in unary, no IsOraclePPT
adversary can distinguish naorReingoldWordRealGame, whose keys are drawn exactly uniformly from
ZMod (F.order d), from naorReingoldWordIdealGame with non-negligible advantage. The theorem for
the keys drawn with the fair-coin sampler sampleNaorReingoldExp is
DDH.negligible_naorReingoldProbGame, which uses this one.
Asymptotic DDH security of the executable Naor–Reingold group-PRF
(naorReingoldProbRealGame) ([BS23], Exercise 10.4; [NR04], Theorem 4.1):
if F.DDH setup holds and inLen is computable in polynomial time in unary, no IsOraclePPT
adversary can distinguish naorReingoldProbRealGame from naorReingoldWordIdealGame with
non-negligible advantage.
Universal-hash bit-string Naor–Reingold PRF #
Word-level universal-hash Naor–Reingold evaluation (paraphrase of [NR04],
Section 4.1, Construction 4.2): evaluate naorReingoldWordEval and hash the resulting encoded
group element into {0, 1}^{outLen} with linearHashKDF.
naorReingoldHashedWordEval always outputs outLen bits.
naorReingoldHashedWordEval is computable in polynomial time when outLen is given in unary
and bound is computable in polynomial time in unary from d.
Setup-parameterized real universal-hash Naor–Reingold bit-string PRF game with exact uniform
ZMod (F.order d) exponents and public hash seed (d, seed) encoded via F.withSeed.encDesc
(paraphrase of [NR04], Section 4.1, Construction 4.2, Theorem 4.3, and Remark 4.2).
Setup-parameterized executable real universal-hash Naor–Reingold bit-string PRF game sampling
exponents via sampleNaorReingoldExp (original).
Setup-parameterized ideal bit-string random-function game for universal-hash Naor–Reingold:
sample (d, seed) ← F.seededSetup setup (F.linearHashSeedLen outLen bound) n, draw an independent
uniform random function f : BitString (inLen n) → BitString (outLen n), and pass
F.withSeed.encDesc (d, seed) to adversary (paraphrase of [NR04], Section 4.1,
Theorem 4.3 and Remark 4.2).
Intermediate hybrid game for universal-hash Naor–Reingold: sample (d, seed) via seededSetup,
draw an independent uniform random group-valued table B : BitString (inLen n) → ZMod (F.order d),
and hash each queried group element B x • g with linearHashKDF (paraphrase of
[NR04], Section 4.1, Theorem 4.3 and Remark 4.2, using Lemma 4.2).
Multi-query Leftover Hash Lemma bound for hashed Naor–Reingold (paraphrase of
[NR04], Section 4.1, Lemma 4.2; [BS23], Section 8.10.4, Theorem 8.11, p. 334):
if adversary makes at most Q queries on (setup n).support and qMin ≤ F.order d, then
replacing hashed random group elements by a uniform random function BitString (inLen n) → BitString (outLen n) changes the output distribution by at most
Q * (√(2 ^ (outLen n) / qMin) / 2).
Ideal-key-sampling step, not the cited result: under F.DDH setup, when group descriptions on
(setup n).support have polynomially bounded bit-length, bound bounds encoded group elements,
and 2 ^ (outLen n) / qMin n is negligible, no IsOraclePPT adversary can distinguish
naorReingoldHashedRealGame, whose exponents are drawn exactly uniformly from ZMod (F.order d),
from naorReingoldHashedIdealGame. The theorem for exponents drawn with the fair-coin sampler
sampleNaorReingoldExp is DDH.negligible_naorReingoldHashedProbGame, which uses this one. The
construction is after [NR04], not checked.
Asymptotic DDH security of the executable universal-hash Naor–Reingold bit-string PRF
(naorReingoldHashedProbRealGame) (paraphrase of [NR04], Section 4.1,
Construction 4.2, Theorem 4.3, and Remark 4.2).
Ideal-key-sampling step with constant output length, not the cited result: for any constant
output length c : ℕ (including c = 1), under F.DDH setup, the only hardness assumption,
together with the stated polynomial-time length functions and setup-support encoding bounds, no
IsOraclePPT adversary can distinguish naorReingoldHashedRealGame, whose exponents are drawn
exactly uniformly from ZMod (F.order d), from naorReingoldHashedIdealGame. F.DDH setup
supplies the inverse-order decay that the Leftover Hash Lemma needs
(DDH.negligible_expected_inv_order), so no qMin hypothesis is needed. The library has no version
of this theorem for fair-coin exponents (#5293); DDH.exists_pseudorandomGenerator in
CslibFrontier/Crypto/Computational/NaorReingold/PRF.lean uses this one. The construction is after
[NR04], not checked.