Pseudorandom residues from pseudorandom words #
Boneh–Shoup Example 3.3 ([BS23], pp. 86–87) reduces an L-bit pseudorandom word modulo
m to obtain an element of {0, ..., m - 1} that is computationally indistinguishable from
uniform when m / 2 ^ L is negligible.
Here modWord m word reads word most significant bit first (BitString.binaryValue) and
encodes the residue modulo m with encNat. The reduction modDistinguisher m adversary
evaluates modWord (m n) on its challenge word before running adversary n.
Compared with [BS23], pp. 86–87: 2 ^ L ≥ m is not assumed (for m > 2 ^ L the bound
exceeds 1); the bound is ≤ m / 2 ^ L where Example 3.2 proves <; the modulus m may depend
on the security parameter n and must then be computable in polynomial time (hm), which is what
makes the reduction modDistinguisher efficient; and the generator's security is used only as
indistinguishability of its output from uniform words.
Main definitions #
Cslib.Crypto.modWord: reduce a binary word modulomand re-encode the residue.Cslib.Crypto.modDistinguisher: the reduction that runs a residue distinguisher onmodWord.
Main results #
Cslib.Crypto.closeTo_uniformList_map_modWord: uniformL-bit words reduced modulomare withinm / 2 ^ Lof uniform residues inCloseTo([BS23], Example 3.2, p. 86).Cslib.Crypto.isPPT_modDistinguisher: uniform strict-PPT certificate formodDistinguisher.Cslib.Crypto.advantage_distinguishingGame_map_modWord_le: concrete advantage bound for arbitrary word distributions.Cslib.Crypto.ComputationallyIndistinguishable.map_modWord: asymptotic security for word ensembles ([BS23], Example 3.3, pp. 86–87).Cslib.Crypto.advantage_generatorEnsemble_map_modWord_le: the book's inequalityDistadv[A, P₀, P₁] ≤ PRGadv[B, G] + m / N.Cslib.Crypto.PseudorandomGenerator.indistinguishable_map_modWord: asymptotic security for aPseudorandomGenerator.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 3.11 (Examples 3.2–3.3, pp. 86–87).
Reducing a uniform word of L bits is the bounded residue sampler sampleModNat L m.
The residue modulo m of a uniform word of L bits is within m / 2 ^ L of a uniform
residue ([BS23], Example 3.2, p. 86, on binary words).
The reduction of [BS23], Example 3.3, p. 86: reduce the challenge word modulo
m n, then run the given distinguisher on the residue.
Reduction modulo a modulus computed from the unary parameter is polynomial time.
The reduction is uniform strict PPT when the modulus is computable in polynomial time from the unary security parameter and the given distinguisher is PPT.
Running a distinguisher on residues is running the reduction on the words.
Example 3.3, concrete bound ([BS23], p. 87): the advantage in telling residues of
samples of D from uniform residues is at most the advantage of the reduction in telling D from
uniform L-bit words, plus m n / 2 ^ L.
Example 3.3 ([BS23], pp. 86–87): if an ensemble of words is computationally
indistinguishable from uniform words of length n bits, the modulus is efficiently computable
and m n / 2 ^ length n is negligible, then the residues modulo m n are computationally
indistinguishable from uniform residues. The efficiency hypothesis hm is present for the PPT
certificate of the reduction modDistinguisher (isPPT_modDistinguisher), and no failing case
without hm is known.
Example 3.3, the book's inequality ([BS23], p. 87):
Distadv[A, P₀, P₁] ≤ PRGadv[B, G] + m / N, where P₀ is the generator's output reduced modulo
m n, P₁ is the uniform residue, N = 2 ^ length n and B is modDistinguisher m A, run in
the two programs of the generator's attack game. No hypothesis on the generator is used.
Example 3.3 for a pseudorandom generator: the generated word reduced modulo m n is
computationally indistinguishable from a uniform residue. The efficiency hypothesis hm is present
for the PPT certificate of the reduction modDistinguisher, and no failing case without hm is
known.