Re: /dev/random entropy calculations broken?

From: Oliver Xymoron (oxymoron@waste.org)
Date: Tue Oct 02 2001 - 16:29:38 EST


On Tue, 2 Oct 2001, Andreas Dilger wrote:

> > While we're on words/bytes/bits confusion, add_entropy_words() seems to
> > get called with number of bytes rather than words.
>
> Makes it that much more random, doesn't it ;-). OK, here is a new version
> of the patch. It clears up the parameters to the functions, and makes sure
> that we pass the right values to each.

Cool. Not sure if I like the introduction of poolbits. My personal
preference would be to s/poolwords/words/ and just use ->words*32, since
foo->foomember is a throwback to pre-ANSI compilers with a flat namespace
for structure members. Note that we don't bother prefixing tap*.

If not, at least put poolbits in the structure first...

> static struct poolinfo {
> int poolwords;
> + int poolbits; /* poolwords * 32 */
> int tap1, tap2, tap3, tap4, tap5;
> } poolinfo_table[] = {
> /* x^2048 + x^1638 + x^1231 + x^819 + x^411 + x + 1 -- 115 */
> - { 2048, 1638, 1231, 819, 411, 1 },
> + { 2048, 65536, 1638, 1231, 819, 411, 1 },
                ^^^^^
...because it's not as confusing comparing the polynomial in the comment
to the initializer.

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 07 2001 - 21:00:24 EST