News for hackers. Stuff that matters.
Re:“RNG broken for last 4 months” by jackweirdy on Tuesday February 17, 2015 @01:51PM (#9064186)
I’m curious about that too. How could you unit/regression test `rand`?
Re:“RNG broken for last 4 months” by fixermark on Tuesday February 17, 2015 @01:58PM (#9064220)
Statistic testing seems like it ought to work. However, I believe there's also the issue of actual uses of the RNG; it's not enough to test the kernel implementation, one must also test that libraries are using the implementation correctly (i.e. not using constant or completely-predictable seed), etc.

So it's not a trivial problem, because (among other reasons) nondeterministic, statistical testing is not well-understood in the testing culture.

Re:“RNG broken for last 4 months” by tedunangst on Tuesday February 17, 2015 @07:03PM (#9066105)
Further complication: many RNGs will produce output as a function of their seed state (e.g., rc4 or chacha20). That output will look really good, even with weak seeds. You'll have a hard time detecting that two chacha20 streams were seeded with gettimeofday() for instance, unless you happen to check the exact time used.
Re:“RNG broken for last 4 months” by rnnr on Tuesday February 17, 2015 @04:33PM (#9065187)
You use statistics. For example, take the birthday paradox problem and check if the collisions are higher than expected.
Re:“RNG broken for last 4 months” by tedunangst on Tuesday February 17, 2015 @07:01PM (#9066091)
eh, I'm not sure that works. A random number generator of "return number++" will pass your birthday test.
Re:“RNG broken for last 4 months” by rnnr on Tuesday February 17, 2015 @09:11PM (#9066620)
I just gave an example. I never intended to say you just need this sole solution.

It's also a good lead for a further search query on the topic. Almost all test sets include a birthday test ;) For example this page: https://sites.google.com/site/astudyofentropy/background-inf...

Re:“RNG broken for last 4 months” by jwiley on Tuesday February 17, 2015 @02:37PM (#9064462)
assert(rand() != dummy_random_read_phony())
Re:“RNG broken for last 4 months” by tedunangst on Tuesday February 17, 2015 @05:49PM (#9065688)
If dummy_random_read_phony() is rand(), that test will always pass. Almost every implementation of rand() will never return the same result in a row.