in reply to Re: randfunc in Config
in thread randfunc in Config

Hai choroba, I'm the guy who takes the blame, as they mentioned in #devious, tho I was not at my computer today to answer there, but am AFresh1 on Twitter and Freenode as well as afresh1 AT OpenBSD.org. The main answer is that yes, perl-5.20 on OpenBSD uses the system drand48 to back rand() and other random functions. However, seeding with a known seed and testing the values won't help detect this change because we fall back to perl's drand48 if you ask for deterministic numbers since OpenBSD's random subsystem doesn't provide a facility for that on purpose. On OpenBSD drand48, as well as most all random sources, is backed by arc4random which is currently sourced from ChaCha20.

On YouTube there are several talks about it although my YAPC talk audio is broken but there are other talks ad slides available.

There are other changes we make as well including some I need to find the time to get upstream but haven't.

l8rZ,
--
andrew

Replies are listed 'Best First'.
Re^3: randfunc in Config
by choroba (Cardinal) on Jul 15, 2016 at 09:13 UTC
    Hi afresh1, thanks for the reply. I guess that testing the values for a known seed should be enough, but maybe Syntax::Construct should emit a warning if the $Config{randfunc} is different to Perl_drand48 . The reasoning is: why would anyone need Perl_drand48 ? Either to get a predictable sequence for a given seed, or to have a better algorithm than the previous one (on some platforms, e.g. MSWin), which both holds for OpenBSD's rand. But maybe I'm too optimistic...

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      I too am not sure what reasons anyone would have for wanting to know which random number generator is behind rand(). If they do care, I would hope they would use a module of some sort that brings some guarantees of randomness with it. I know Dana Jacobsen has spent a lot of time thinking about this.

      l8rZ,
      --
      andrew