Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 2 Oct 2001 18:29:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 2 Oct 2001 18:29:14 -0400 Received: from h24-64-71-161.cg.shawcable.net ([24.64.71.161]:53501 "EHLO webber.adilger.int") by vger.kernel.org with ESMTP id ; Tue, 2 Oct 2001 18:29:02 -0400 From: Andreas Dilger Date: Tue, 2 Oct 2001 16:28:44 -0600 To: Oliver Xymoron Cc: linux-kernel , "Theodore Y. Ts'o" Subject: Re: /dev/random entropy calculations broken? Message-ID: <20011002162844.Q8954@turbolinux.com> Mail-Followup-To: Oliver Xymoron , linux-kernel , "Theodore Y. Ts'o" In-Reply-To: <20011002150233.M8954@turbolinux.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.22i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Oct 02, 2001 16:29 -0500, Oliver Xymoron wrote: > 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*. I added poolbits because we were doing poolwords * 32 all the time in the commonly called functions credit_entropy_store() and batch_entropy_process()). I don't really care either way, except that it makes the code easier to read. We could always do the following (hackish, but makes code more readable): #define POOLBITS poolwords*32 #define POOLBYTES poolwords*4 > 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. Sorry, I didn't notice that the poolwords was also part of the polynomial. I'll wait a while before reposting in case of more comments (Ted has been silent thus far). Cheers, Andreas -- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert - 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/