True Random Numbers

Gilles Baudrillard gilles.baudrillard@eads.net
Mon Nov 8 09:15:00 GMT 2004


Robert G. Brown wrote:
> On Fri, 5 Nov 2004, Kevin H. Hobbs wrote:
> 
> 
>>Is it possible, or easy, to use the GSL random number distributions with
>>true random number devices?  I'm thinking of a generator that really
>>just reads from /dev/random or a device driver for one of the really
>>fancy hardware random number devices.
> 
> 
> It is pretty easy, really.  I wrapped /dev/random in the GSL-style
> wrapper some time ago as part of an effort I had underway to write a
> random number tester that was fully integrated with the GSL (which
> exists and works, BTW, although I quit before re-implementing e.g. all
> of diehard).  The tester also times the various GSL routines.  This is
> one of the biggest problems with /dev/random -- it is s l o o o o w.  It
> has to accumulate enough entropy to replenish the rands it returns, and
> its sources have a very definitely finite and system-state dependent
> rate of generating entropy.

You can use /dev/urandom instead of /dev/random. It will not block if
there is not enough entropy and it is what I do to get an initial seed
for my RNGs.
It is not suitable for crypto-related applications, but if you use RNGs
for scientfic simulations, it's ok.

Gilles



More information about the Gsl-discuss mailing list