public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "Ondřej Bílka" <neleai@seznam.cz> To: bugdal at aerifal dot cx <sourceware-bugzilla@sourceware.org> Cc: glibc-bugs@sourceware.org Subject: Re: [Bug libc/15615] Poor quality output from rand_r Date: Tue, 25 Jun 2013 06:58:00 -0000 [thread overview] Message-ID: <20130625073944.GA27305@domone> (raw) In-Reply-To: <bug-15615-131-si9rRV04Ff@http.sourceware.org/bugzilla/> On Fri, Jun 14, 2013 at 03:37:30PM +0000, bugdal at aerifal dot cx wrote: > http://sourceware.org/bugzilla/show_bug.cgi?id=15615 > > --- Comment #4 from Rich Felker <bugdal at aerifal dot cx> --- > On Fri, Jun 14, 2013 at 12:10:59PM +0000, neleai at seznam dot cz wrote: > > To test rand_r equivalent I wrote a simple generator (which is for > > mostly to test performance, I did not look for quality.) > > > > movd (%rdi),%xmm0 > > movdqa %xmm0,%xmm1 > > > > aesenc %xmm0,%xmm1 > > aesenc %xmm0,%xmm1 > > aesenc %xmm0,%xmm1 > > aesenc %xmm0,%xmm1 > > movd %xmm1, (%rdi) > > movd %xmm1, %eax > > shr $1, %eax > > There's no reason to believe this code will have acceptable period or > be unbiased. Instead of storing the AES result back to the state, you Well I wrote above > > To test rand_r equivalent I wrote a simple generator (which is for > > mostly to test performance, I did not look for quality.) Which was only to show that using cryptographic functions is not too slow. (You can alternatively use CRC32 instruction.) I am still not convinced that changing implementation is improvement as everybody which cares about quality uses random_r. I would accept an warning that rand_r is weak and one should use random_r.
next prev parent reply other threads:[~2013-06-25 6:58 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-06-12 23:39 [Bug libc/15615] New: " bugdal at aerifal dot cx 2013-06-13 8:26 ` Ondřej Bílka 2013-06-13 8:26 ` [Bug libc/15615] " neleai at seznam dot cz 2013-06-13 12:38 ` bugdal at aerifal dot cx 2013-06-14 12:11 ` Ondřej Bílka 2013-06-14 12:11 ` neleai at seznam dot cz 2013-06-14 15:37 ` bugdal at aerifal dot cx 2013-06-25 6:58 ` Ondřej Bílka [this message] 2013-06-25 12:25 ` bugdal at aerifal dot cx 2014-06-13 15:07 ` fweimer at redhat dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20130625073944.GA27305@domone \ --to=neleai@seznam.cz \ --cc=glibc-bugs@sourceware.org \ --cc=sourceware-bugzilla@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).