Date: Mon, 3 Feb 2003 00:56:32 +0000 From: Edward Brocklesby <ejb@lythe.org.uk> To: Don <don@calis.blacksun.org>, current@FreeBSD.ORG Subject: Re: rand() is broken Message-ID: <200302030056.32009.ejb@lythe.org.uk> In-Reply-To: <20030202193215.E2519@calis.blacksun.org> References: <200302021848.NAA19508@agamemnon.cnchost.com> <200302030026.33781.ejb@lythe.org.uk> <20030202193215.E2519@calis.blacksun.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 03 February 2003 12:41 am, Don wrote: > I think Terry mentioned binary packages simply because it is harder to fix > them than something available as source but I could be mistaken. Possibly -- if we're looking at this from the point of view of the user of said binary package, rather than the developer (as I'd assumed), then I see what you mean (you can do ld hacks and so on, but ..) > > I'm not sure Yet Another RNG API (of course arc4random() already exists) > > gains anything unless rand()/random() absolutely cannot be changed; and > > as I say I'm not convinced this is the case. > > I am by no means convinced either. I do, however, think this is something > that should not be changed without a lot of consideration and testing. IMHO, it "shouldn't" break things (ie, things shouldn't be relying on it); but, well, I can accept there might be something that does. I do find it hard to believe though; this 'simulation' problem is the first I've heard of it, and it doesn't look like an insurmountable one. > Your point about arc4random() is a good one. Why depend on rand() for > cryptographic randomness when we already have arc4random()? Because arc4random() is not portable. I would rather rely on the OS having a useful rand() RNG rather than #ifdef'ing on this that and the other to choose the correct one. > > Doesn't even the 0 / RAND_MAX fix change > > the algorithm? Software which relies on that behaviour will break .. > > [...] I don't recall advocating that change either. Well, no -- but are you against it? Where is the line drawn? Regards, Edward. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302030056.32009.ejb>