Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2015 23:22:31 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        freebsd-numerics@FreeBSD.org
Subject:   Random number generators
Message-ID:  <7CBD7758-9472-4A2E-8065-EC6E68EE8DAB@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi;

FreeBSD libc random functions are not too bad but in general I was =
having some thoughts about how the random generator functions in libc =
are slow and predictable and how just about every application nowadays =
is including "Mersenne Twister"  or similar algorithms (which are fast =
and better in every way but can=E2=80=99t be adapted for the C API) in =
their applications.

OpenBSD did something drastic about it [1], breaking standards and =
compatibility and whatnot.
I wouldn=E2=80=99t go there and I don=E2=80=99t think there is any real =
=E2=80=9Csolution=E2=80=9D for this. The musl libc guys tried something =
interesting though. They took the tempering function from MT:

=
http://git.musl-libc.org/cgit/musl/commit/?id=3D20d01d83b5a13c77805976e7c5=
20f566244ba3ff =
<http://git.musl-libc.org/cgit/musl/commit/?id=3D20d01d83b5a13c77805976e7c=
520f566244ba3ff>

It should be something relatively easy to try on our implementation too, =
if someone feels like running the tests and measuring if there is a =
difference.

Pedro.

[1[ http://www.tedunangst.com/flak/post/random-in-the-wild






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7CBD7758-9472-4A2E-8065-EC6E68EE8DAB>