Space-bounded pseudorandom generators are small-bias generators #
The parity of the bits of a word in a set S of positions is computed by a read-once branching
program with two states (Cslib.Crypto.PRG.isReadOnceTest_parityOn). A generator that fools the
read-once programs of width 2 ^ s, s ≥ 1, with error ε (an (s, ε)-pseudorandom generator
in the sense of Goldreich, Definition 8.20) is therefore a 2ε-bias
generator (Cslib.Crypto.PRG.Generator.Secure.isSmallBias): the bias at S is
2 |Pr[⊕_S G(U) = 1] - 1/2| (Goldreich's Eq. (8.18)), twice the advantage of the parity test.
With the limitation on small-bias generators of Exercise 8.37
(Cslib.BitString.card_lt_card_of_isSmallBias), an (s, ε)-pseudorandom generator with
s ≥ 1 and ε < 1/2 has stretch ℓ(k) < 2^k (Cslib.Crypto.PRG.Generator.Secure.lt_two_pow).
Source qualification. Goldreich, Exercise 8.38 states that an
(s, ε)-pseudorandom generator with s ≥ 1 is an ε-bias generator, and Exercise 8.25(2) that
it has ℓ(k) < 2^k whenever ε(k) < 1, by combining Exercises 8.37 and 8.38. Both printed
claims are false under the source's own definitions: the generator σ ↦ σσ on one seed bit is
(s, 1/2)-pseudorandom for every s (its output is at statistical distance 1/2 from uniform,
so no test whatsoever has advantage above 1/2), yet its two output bits always have even
parity, bias 1 > 1/2, and its stretch is 2 = 2^1
(Cslib.Crypto.PRG.exists_secure_not_isSmallBias). The factor 2 above is necessary, and the
corrected endpoints are 2ε-bias for Exercise 8.38 and ε < 1/2 for Exercise 8.25(2).
Main results #
Cslib.Crypto.PRG.isReadOnceTest_countMod: counting ones modulomis a read-once test of widthm.Cslib.Crypto.PRG.isReadOnceTest_parityOn: parities are read-once tests of width2.Cslib.Crypto.PRG.Generator.Secure.isSmallBias: Exercise 8.38, corrected to2ε.Cslib.Crypto.PRG.Generator.Secure.lt_two_pow: Exercise 8.25(2), corrected toε < 1/2.Cslib.Crypto.PRG.exists_secure_not_isSmallBias: the counterexample to both printed claims.
References #
The parity of the bits in a set S of positions is a read-once test of every width w ≥ 2:
two states hold the parity of the bits read so far.
Space-bounded pseudorandom generators are small-bias generators (Goldreich, Exercise
8.38, corrected): a generator G : {0,1}^k → {0,1}^ℓ that fools the
read-once programs of width 2 ^ s, s ≥ 1, with error ε is a 2ε-bias generator. The printed
bound ε is false (exists_secure_not_isSmallBias).
The stretch of space-bounded pseudorandom generators (Goldreich, Exercise
8.25(2), corrected): a generator G : {0,1}^k → {0,1}^ℓ that fools the
read-once programs of width 2 ^ s, s ≥ 1, with error ε < 1/2 has ℓ < 2^k. The printed
hypothesis ε < 1 does not suffice (exists_secure_not_isSmallBias).
Counterexample to the printed Exercises 8.38 and 8.25(2) Goldreich:
the generator σ ↦ σσ on one seed bit fools every test, however large its space, with error
1/2, but it is not 1/2-biased (its two output bits always have even parity), and its stretch
is 2 = 2^1.