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 _______________________________________________ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers