Open axch opened 8 years ago
C implementation of weakprng here:
https://github.com/probcomp/crosscat/blob/4f75431b06978c77fc1c8e9c559af0f68101316d/cpp_code/src/weakprng.cpp https://github.com/probcomp/crosscat/blob/4f75431b06978c77fc1c8e9c559af0f68101316d/cpp_code/include/CrossCat/weakprng.h
(Nominally C++98 for build convenience but it is valid C99 too.)
For example, on @riastradh-probcomp has written:
http://mumble.net/~campbell/python/prng.py (32-byte state w/ 32-byte buffer, lower throughput) http://mumble.net/~campbell/python/weakprng.py (48-byte state w/ 64-byte buffer, higher throughput) http://mumble.net/~campbell/python/chacha.py (crypto core PRF)
Why?
Any cryptographic PRNG makes the latter two concerns vanish entirely; and at least ChaCha's full state is small enough to print out on one 80-character line using only non-special printable ASCII characters.