Messages in this thread | | | Date | Thu, 16 Oct 2003 14:40:33 -0600 | From | Andreas Dilger <> | Subject | Re: [RFC] frandom - fast random generator module |
| |
On Oct 16, 2003 14:31 -0500, Matt Mackall wrote: > On Thu, Oct 16, 2003 at 12:18:25PM -0600, Andreas Dilger wrote: > > while (nbytes >= sizeof(*data)) { > > *(long *)buf = *data; > > buf += sizeof(*data); > > *data = *data * 1812433253L + 12345L; /* or whatever... */ > > } > > I don't think a get_pseudorandom_bytes() is a horrible idea. But it's > still worth the trouble to pick a more robust pseudorandom generator. > The above won't satisfy common spectral requirements. I'd rather try > to make /dev/urandom suffice first though.
Oh, by all means the above isn't sufficient, just an example. We have already had 2 arch-specific assembly PRNGs that are much better than the above that can be used if there is no HW RNG. My point was that it would be nice to hide the details of which PRNG and all the CPU selection and config detection from callers in the kernel.
Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |