Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 2 Oct 2001 11:35:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 2 Oct 2001 11:35:23 -0400 Received: from waste.org ([209.173.204.2]:32121 "EHLO waste.org") by vger.kernel.org with ESMTP id ; Tue, 2 Oct 2001 11:35:12 -0400 Date: Tue, 2 Oct 2001 10:37:50 -0500 (CDT) From: Oliver Xymoron To: Andreas Dilger cc: linux-kernel , "Theodore Y. Ts'o" Subject: Re: /dev/random entropy calculations broken? In-Reply-To: <20011002015114.A24826@turbolinux.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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/