Re: Patch: rework kernel random number subsystem (*nearly final*)

Thor Lancelot Simon <[email protected]> Tue, 8 Nov 2011 15:16:05 -0500
Newsgroups gmane.os.netbsd.devel.kernel,gmane.os.netbsd.devel.crypto,gmane.os.netbsd.devel.security
Message-ID <[email protected]>
On Tue, Nov 08, 2011 at 07:34:16PM +0000, Christos Zoulas wrote:
> In article <[email protected]>,
> Matthias Drochner  <[email protected]> wrote:
> 
> >-not directly related: What is the "Mersenne Twister" code in libkern
> > good for?
> 
> Matt Thomas wanted to use this for network port allocation IIRC. I don't
> know what happened with that.

While converting arc4random() -> cprng_fast32() I found many, many
places in the kernel where random() had been converted to arc4random()
(which, while fast, is still much slower -- I tested this years ago on
several architectures).  MT might be better suited for these uses.

Thor