chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] random returns the same number on x86_64 a


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] random returns the same number on x86_64 all the time
Date: Sun, 4 Mar 2012 17:32:22 +0100
User-agent: Mutt/1.4.2.3i

On Sun, Mar 04, 2012 at 10:14:34AM -0600, Jim Ursetto wrote:
> But the question is what are you going to do with those bits, and I don't 
> know how the hash table randomization works.  I am simply letting Peter know 
> that the bottom bits are currently zero and should not be used, and if only 
> 30 bits are needed during the randomization, you might as well do (random 
> 2^30-1) instead of (random most-positive-fixnum) anyway.

Thanks, Jim; I used most-positive-fixnum here because I figured it should
try to use as many bits as there are available; on 64 bit systems that
may be 54 bits and on 32 bit systems that'll be 30 bits.

I'm unsure of the implications of having zero bits in there (I'm not
a cryptographer), but the hashing function uses the full C_word, so
whether we have them on the bottom or the top shouldn't matter a
great deal.

> Obviously the non-randomness of rand() is another limiting factor.

Yep, if we want more secure randomness we could build in a better
randomizer in core, but until then this is the best we can do
with what we have.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]