Computational random-oracle key derivation via lazy simulation #
Formalizes the computational form of [BS23], Section 8.10.1 (Attack Game 8.3 and its
fourth motivating example, computational unpredictability of a secret source, pp. 325–326) and
Section 8.10.2 (Theorem 8.10, pp. 331–332) over general encoded finite secret families
S : ℕ → Type, side-information families X : ℕ → Type, and digest/key families T : ℕ → Type,
together with the specialization to BitString (secLen n) secrets and BitString (outLen n) keys.
Whereas CslibFrontier.Crypto.Computational.KeyDerivation.RandomOracle states eager-table
(uniformOfFintype (S → T)) concrete bounds and an information-theoretic (unbounded-guesser)
asymptotic transfer for arbitrary finite nonempty S and T, as steps toward Theorem 8.10,
this module constructs the elementary lazy-simulation wrappers lazyROToListGuess and
lazyROToGuess over associative-list caches (Cslib.Probability.cachedSamplerOracle), proves
their uniform strict PPT certificates from a word-oracle distinguisher's IsOraclePPTOn
certificate, and derives the asymptotic random-oracle KDF security transfer under the standard
computational unpredictability assumption SecretGuessHard.
Differences from the printed book #
- General encoded finite families, arbitrary source and side-information maps. At security
parameter
n, secrets lie in a nonempty finite typeS nencoded byencS n : S n ↪ List Boolwith canonical partial decoderdecS n : List Bool → Option (S n)(decS n w = some s ↔ encS n s = w, polynomial-timeisSomedomain recognition, and a polynomial-time fallback elementdefaultS n); digests and keys lie in a nonempty finite typeT nencoded byencT n : T n ↪ List Bool; and public side information lies inX nencoded byencX n : X n ↪ List Bool. Neithersample nnorinfo nis required to be efficiently computable;SecretGuessHard.negligible_roAdvantagerequires only thatencX n (info n s)has polynomial length innon(sample n).support. - Word-oracle distinguishers adapted to typed random-oracle games. Distinguishers operate on
words (
WordRODistinguisher X) and are adapted toRODistinguisherbytoRODistinguisher, answering canonical queriesencS n qfrom the typed random oracleS n → T nviaencT nand returning[]on malformed queries outsideSet.range (encS n). - Fair-coin sampling of digests and query indices. Because strict-PPT Turing machines flip fair
coins, non-power-of-two digest spaces
T n(such asZMod qfor an odd modulusq) admit no exact dyadic uniform sampler. The lazy simulator draws keys and cache-miss digests from a caller-supplied strict-PPT samplersampleT nwithin statistical distanceεT nofuniformOfFintype (T n), adding(Q n + 1) * εT nto the concrete bounds (0whensampleT nis exact uniform, as forBitString (outLen n)), andlazyROToGuessselects a candidate query index viaProbComp.sampleModIndex (width n) (Q n), addingQ n / 2 ^ width n. Both error terms are absorbed inSecretGuessHard.negligible_roAdvantagewhensampleTisStatisticallyIndistinguishablefrom uniform andwidth = id.
Main definitions #
Cslib.Crypto.KeyDerivation.GuessFamilyAdversary,GuessFamilyAdversary.IsPPT: families of singleton-guessing adversaries over(X n, S n)and uniform strict PPT admissibility.Cslib.Crypto.KeyDerivation.ListGuessFamilyAdversary,ListGuessFamilyAdversary.IsPPT: families of list-guessing adversaries over(X n, S n)and uniform strict PPT admissibility.Cslib.Crypto.KeyDerivation.SecretGuessHard: computational unpredictability of an encoded secret source given side information ([BS23], Attack Game 8.3 and §8.10.1, p. 326).Cslib.Crypto.KeyDerivation.WordROInput,encWordROInput,WordRODistinguisher,WordRODistinguisher.IsPPT,toRODistinguisher,toBitStringRODistinguisher: word-oracle KDF distinguishers and their typed random-oracle adapters.Cslib.Crypto.KeyDerivation.lazyROToListGuess,lazyROToGuess: the elementary lazy-simulation list-guessing and singleton-guessing wrappers of Theorem 8.10.
Main results #
Cslib.Crypto.KeyDerivation.length_le_of_mem_support_lazyROToListGuess: every supported list output bylazyROToListGuesshas length bounded by the distinguisher's query budget.Cslib.Crypto.KeyDerivation.roAdvantage_toRODistinguisher_le_listGuessAdvantage,roAdvantage_toRODistinguisher_le_listGuessAdvantage_add: exact and approximate-sampler lazy list-guessing bounds of Theorem 8.10.Cslib.Crypto.KeyDerivation.isPPT_lazyROToListGuess,isPPT_lazyROToGuess: uniform strict PPT certificates for the lazy list-guessing and singleton-guessing wrappers.Cslib.Crypto.KeyDerivation.roAdvantage_toRODistinguisher_le_mul_guessAdvantage_add: concrete singleton-guessing bound of Theorem 8.10 with fair-coin index and digest sampling.Cslib.Crypto.KeyDerivation.SecretGuessHard.negligible_roAdvantage,SecretGuessHard.negligible_roAdvantage_bitString: computational Theorem 8.10 over general encoded finite families and its fixed-width bit-string specialization.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 8.10.1 (Attack Game 8.3 and fourth example, pp. 325–326) and Section 8.10.2 (list-guessing game and Theorem 8.10, pp. 331–332).
1. Families of guessing adversaries and computational unpredictability #
A singleton-guessing family adversary is uniform strict PPT when one machine reads
(1ⁿ, encX n x) (encSigma encUnary encX) and writes the encoded candidate secret encS n s.
A list-guessing family adversary is uniform strict PPT when one machine reads
(1ⁿ, encX n x) (encSigma encUnary encX) and writes the framed list of encoded candidate
secrets.
Computational unpredictability of a secret source given public side information
([BS23], Section 8.10.1, Attack Game 8.3 and its fourth example, p. 326): every uniform
strict PPT guessing adversary (GuessFamilyAdversary.IsPPT encX encS) wins Attack Game 8.3 with
negligible probability.
Relative to the printed source: sample n and info n need not be efficiently computable, and
guessers are uniform strict PPT machines reading (1ⁿ, encX n x) and writing encS n s.
2. Word-oracle KDF distinguishers and typed random-oracle adapter #
Input (1ⁿ, x, z) of a WordRODistinguisher: the security parameter n, the public side
information x : X n, and the candidate key word z : List Bool.
Field-tuple encoding of WordROInput X: the unary security parameter 1ⁿ (framed), followed
by encX n x (framed), followed by the raw candidate key word z (unframed).
One uniform strict oracle-PPT machine reads (1ⁿ, x, z) (encWordROInput encX) and interacts
with the word oracle.
Adapt a word-oracle distinguisher to the typed random-oracle KDF game on S n and T n: pass
encT n t as the candidate key, answer canonical queries (decS n q = some s) by querying s and
encoding the reply with encT n, and answer malformed queries (decS n q = none) with [].
Specialization of toRODistinguisher to BitString (secLen n) secrets and
BitString (outLen n) digests via OracleCodec.bitString.
3. Lazy list-guessing wrapper #
The elementary lazy-simulation list-guessing wrapper B of Theorem 8.10 ([BS23],
§8.10.2, pp. 331–332): draw an independent candidate key t ← sampleT n, run
D n x (encT n t) against cachedSamplerOracle (fun w => (decS n w).isSome) (encT n <$> sampleT n)
starting from [], and decode the cached valid queries via decS n.
Lazy output-size bound ([BS23], Theorem 8.10, §8.10.2, p. 331): if
D n x (encT n t) makes at most Q oracle queries for every supported t of sampleT n, then
every list output by lazyROToListGuess decS encT sampleT D n x has length at most Q.
Lazy list-guessing inequality of Theorem 8.10 with approximate digest sampling
([BS23], §8.10.2, pp. 331–332): when sampleT n is within statistical distance εT of
uniformOfFintype (T n) and D n (info n s) (encT n t) makes at most Q oracle queries on
supported secrets s and candidate keys t, the random-oracle KDF advantage is at most
listGuessAdvantage (sample n) (info n) (lazyROToListGuess decS encT sampleT D n) + (Q + 1) * εT.
Exact lazy list-guessing inequality of Theorem 8.10 ([BS23], §8.10.2,
pp. 331–332): when sampleT n samples uniformOfFintype (T n) exactly, the random-oracle KDF
distinguishing advantage of toRODistinguisher decS encT D n is at most the list-guessing
advantage of lazyROToListGuess decS encT sampleT D n, with no query-bound hypothesis.
The lazy list-guessing wrapper is efficient: lazyROToListGuess decS encT sampleT D is
uniform strict PPT whenever (n, w) ↦ (decS n w).isSome is computable in polynomial time,
n ↦ encT n <$> sampleT n is uniform strict PPT, and D is uniform strict oracle-PPT.
4. Lazy singleton-guessing wrapper and computational Theorem 8.10 #
The elementary lazy-simulation singleton-guessing wrapper B' of Theorem 8.10
([BS23], §8.10.2, pp. 331–332) with fair-coin modular index sampling: run
lazyROToListGuess decS encT sampleT D n x, draw an index from
ProbComp.sampleModIndex (width n) (Q n), and return the entry at that position (or defaultS n
past the end of the list).
The lazy singleton-guessing wrapper is efficient:
lazyROToGuess width Q defaultS decS encT sampleT D is uniform strict PPT whenever width and Q
are computable in polynomial time in unary, (n, w) ↦ (decS n w).isSome and
n ↦ encS n (defaultS n) are computable in polynomial time, n ↦ encT n <$> sampleT n is uniform
strict PPT, and D is uniform strict oracle-PPT.
Concrete singleton-guessing inequality of Theorem 8.10 ([BS23], §8.10.2,
pp. 331–332), accounting for fair-coin index and digest sampling: when sampleT n is within
statistical distance εT of uniformOfFintype (T n) and D n (info n s) (encT n t) makes at most
Q n oracle queries on supported secrets s and candidate keys t, the random-oracle KDF
distinguishing advantage is at most
Q n * guessAdvantage (sample n) (info n) (lazyROToGuess width Q defaultS decS encT sampleT D n) + Q n / 2 ^ width n + (Q n + 1) * εT.
Computational Theorem 8.10 ([BS23], §8.10.2, pp. 331–332, with §8.10.1, Attack
Game 8.3, p. 326): over encoded finite secret families S and digest/key families T, if the
secret source is computationally unpredictable (SecretGuessHard), decS is the canonical partial
decoder of encS with polynomial-time domain recognition and a polynomial-time fallback element
defaultS, sampleT is a uniform strict-PPT sampler statistically indistinguishable from
uniformOfFintype (T n), and encX n (info n s) has polynomial length in n on
(sample n).support, then every uniform strict oracle-PPT word distinguisher has negligible
random-oracle KDF distinguishing advantage.
5. Specialization to fixed-width bit strings #
Computational Theorem 8.10 over fixed-width bit strings ([BS23], §8.10.2,
pp. 331–332): specialization of SecretGuessHard.negligible_roAdvantage to BitString (secLen n)
secrets and BitString (outLen n) keys when secLen and outLen are computable in polynomial time
in unary.