[Python-Dev] RNG in the core (original) (raw)
Steven D'Aprano steve at pearwood.info
Tue Jan 3 21:29:10 CET 2012
- Previous message: [Python-Dev] RNG in the core
- Next message: [Python-Dev] RNG in the core
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Christian Heimes wrote: [...]
I propose an addition to the current Python C API:
int PyOSURandom(char *buf, Pyssizet len) Read "len" chars from the OS's RNG into the pre-allocated buffer "buf". The RNG should be suitable for cryptography.
Since some platforms may not have /dev/urandom, we need a PRNG in the core, too. I therefore propose to move the Mersenne twister from randommodule.c into the core, too.
Mersenne twister is not suitable for cryptography.
http://en.wikipedia.org/wiki/Mersenne_twister
-- Steven
- Previous message: [Python-Dev] RNG in the core
- Next message: [Python-Dev] RNG in the core
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]