From: Daniel Berger Date: 2005-10-14T01:50:05+09:00 Subject: Re: ANN: Crypt::ISAAC 0.9.1 released Kirk Haines wrote: > This release is primarily a reorganization of the old package. It has a much > better installer, a basic unit test suite, better README and licensing info, > and a gem has been built for Crypt::ISAAC as well. The only functionality > change is to add an option when creating a new generator that will force it > to try to use /dev/random to seed the generator, instead of /dev/urandom > (falling back to rand() if neither is available). This is an experimental > feature -- seeding from /dev/random appears to be almost too slow to be > usable since so much entropy is needed, but to use it, create pass false when > creating the object, as follows: > > prng = Crypt::ISAAC.new(false) I got some improvement when I replaced "read" with "sysread" in ISAAC.rb. Here's a little benchmark script I wrote: require "crypt/ISAAC" require "benchmark" include Benchmark MAX = ARGV[0] || 100 bm do |x| x.report("rand"){ MAX.times{ Crypt::ISAAC.new(true) } } x.report("/dev"){ MAX.times{ Crypt::ISAAC.new(false) } } end Results: # Using read >ruby bench_isaac.rb user system total real rand 6.290000 0.410000 6.700000 ( 6.928163) /dev 6.490000 9.640000 16.130000 ( 23.197032) # Using sysread >ruby bench_isaac.rb user system total real rand 6.340000 0.550000 6.890000 ( 7.148228) /dev 6.560000 3.050000 9.610000 ( 9.976435) This was on a stock Sunblade 150 running Solaris 10. Regards, Dan