[lug] Question about /dev/random

Paul E Condon pecondon at mesanetworks.net
Wed Jun 2 15:07:38 MDT 2004


I am doing some MonteCarlo simulation studies for which I use lots of
pseudo-random integers. I use a /dev/random to provide a seed for the
generator and display on the console some information about the workings
of /dev/random. This info puzzles me. 

During initialization, my program reads and displays contents of 
/proc/sys/kernel/random/entropy_avail
Typically this is 4096, the size of the random pool buffer.
My program then reads 8 bytes (64 bits) from /dev/random and then
reads .../entropy_avail again. On this second read it finds 3136. 
Reading 64 bits seems to have decreased the pool by 960 bits. Why?

-- 
Paul E Condon           
pecondon at mesanetworks.net



More information about the LUG mailing list