From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 788C21F953 for ; Tue, 16 Nov 2021 15:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238374AbhKPPrc (ORCPT ); Tue, 16 Nov 2021 10:47:32 -0500 Received: from cloud.peff.net ([104.130.231.41]:60102 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238327AbhKPPrb (ORCPT ); Tue, 16 Nov 2021 10:47:31 -0500 Received: (qmail 20418 invoked by uid 109); 16 Nov 2021 15:44:34 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 16 Nov 2021 15:44:34 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 30112 invoked by uid 111); 16 Nov 2021 15:44:34 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 16 Nov 2021 10:44:34 -0500 Authentication-Results: peff.net; auth=none Date: Tue, 16 Nov 2021 10:44:33 -0500 From: Jeff King To: "brian m. carlson" Cc: git@vger.kernel.org Subject: Re: [PATCH 0/2] Generate temporary files using a CSPRNG Message-ID: References: <20211116033542.3247094-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211116033542.3247094-1-sandals@crustytoothpaste.net> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Nov 16, 2021 at 03:35:40AM +0000, brian m. carlson wrote: > For those who are interested, I computed the probability of spurious > failure for the self-test mode like so: > > 256 * (255/256)^65536 > > This Ruby one-liner estimates the probability at approximately 10^-108: > > ruby -e 'a = 255 ** 65536; b = 256 ** 65536; puts b.to_s.length - a.to_s.length - 3' > > If I have made an error in the calculation, please do feel free to point > it out. Yes, I think your math is correct there. A more interesting question is whether generating 64k of PRNG bytes per test run is going to a problem for system entropy pools. For that matter, I guess the use of it for tempfiles will produce a similar burden, since we run so many commands. My understanding is that modern systems will just produce infinite output for /dev/urandom, etc, but I wonder if there are any systems left where that is not true (because they have a misguided notion that they need to stir in more "real" entropy bits). -Peff