Re: /dev/random entropy calculations broken?

From: Oliver Xymoron (oxymoron@waste.org)
Date: Tue Oct 02 2001 - 10:37:50 EST


On Tue, 2 Oct 2001, Andreas Dilger wrote:

> Fifth fix: in extract_entropy() the "redundant but just in case" check was
> wrong, comparing entropy bit count and pool words. This had the effect
> of losing 31/32 of the random pool on each access. BAD, BAD program!

> + if (r->entropy_count > r->poolinfo.poolwords * 32)
> + r->entropy_count = r->poolinfo.poolwords * 32;

Damnit, I read that line 30 times yesterday!

While we're on words/bytes/bits confusion, add_entropy_words() seems to
get called with number of bytes rather than words.

--
 "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:22 EST