Thread (10 messages) 10 messages, 5 authors, 2016-05-26

Re: [PATCH] btrfs-progs: utils: use better wrappered random generator

From: Hugo Mills <hidden>
Date: 2016-05-25 11:20:18

On Wed, May 25, 2016 at 01:11:38PM +0200, David Sterba wrote:
On Wed, May 25, 2016 at 08:33:45AM +0800, Qu Wenruo wrote:
quoted

David Sterba wrote on 2016/05/24 11:51 +0200:
quoted
On Tue, May 24, 2016 at 08:31:01AM +0800, Qu Wenruo wrote:
quoted
quoted
This could be made static (with thread local storage) so the state does
not get regenerated all the time. Possibly it could be initialize from
some true random source, not time or pid.
I also considered true random source like /dev/random, but since it's
possible to wait for entropy pool, it would be quite slow and confusing
for users.
How would it be confusing? We'll once seed the random generator from
/dev/random, reading 3 * 16bit for the nrand generator context.
Reading from /dev/random may sleep, until the entropy pool is filled.
I know, but does this apply in our case? We're going to get just a few
bytes to seed.  I want to avoid inventing own random number generation
schemes, so we'll use a standard random number source or API.

/dev/random gives about 1-2MB/s of random data on several machines I've
tried.
   Just use /dev/urandom?

   See, e.g. http://www.2uo.de/myths-about-urandom/

   Hugo.

-- 
Hugo Mills             | Putting U back in Honor, Valor, and Trth.
hugo@... carfax.org.uk |
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help