From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752543AbdAUAPN (ORCPT ); Fri, 20 Jan 2017 19:15:13 -0500 Received: from imap.thunk.org ([74.207.234.97]:38952 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbdAUAPL (ORCPT ); Fri, 20 Jan 2017 19:15:11 -0500 Date: Fri, 20 Jan 2017 19:15:09 -0500 From: "Theodore Ts'o" To: "Jason A. Donenfeld" Cc: LKML , Hannes Frederic Sowa , Andy Lutomirski Subject: Re: [PATCH 1/2] random: use chacha20 for get_random_int/long Message-ID: <20170121001509.fj23eunnkaqj7yce@thunk.org> Mail-Followup-To: Theodore Ts'o , "Jason A. Donenfeld" , LKML , Hannes Frederic Sowa , Andy Lutomirski References: <20170106183202.5035-1-Jason@zx2c4.com> <20170118034907.spozwf4erlvx5s4x@thunk.org> <20170120142852.lznr25go4pbdlwdt@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20161126 (1.7.1) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2017 at 04:47:42PM +0100, Jason A. Donenfeld wrote: > > What do you mean? Nothing is wasted right now. The u64 function only > gets u64s from a dedicated u64 array. The u32 function only gets u32s > from a dedicated u32 array. There are separate batched entropy arrays > for each function. But there is a shared pointer, which is used both for the dedicated u32 array and the dedicated u64 array. So when you increment the pointer for the get_random_u32, the corresponding entry in the u64 array is wasted, no? - Ted