From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id 3847238485B2 for ; Wed, 29 Jun 2022 21:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3847238485B2 Received: by mail-oi1-x22a.google.com with SMTP id bd16so23492589oib.6 for ; Wed, 29 Jun 2022 14:53:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Ef8kWLu0Hc2R6UEJukrzcUZA0cYzerecInpxMOEZPCQ=; b=jMqjeII0wf1RINzLp9c6BofUq6A6c42YnBVqe6wgLY8AW/a09RGbYkmBc4Ar0QNjVZ kIqn2ScM14u9n9bcR/j3MXILwgMNkzAT6Yf7fwndTbmREr9cszS4CRKOqsiBUp031VLM favvjFaawtPv7WwBW+7Q5Ynso9RrBLZc3+kfZJ8zNiwmQKURCdTZZPFWPW8miu8eHZVj mtUp+CA0X8jlV7LI5Og4gQovqV8e8w7fbNLfZAl50KJAdforFKoUmEI8Qpu8txhUcFYC 3+t+6y9VHsAgfOheDm2TmAiTqzNuKeiU3qrtdwXU5B6Gfn0kvxFF8IxFVU/szRmG1TtB pNQQ== X-Gm-Message-State: AJIora8mdUd2qgaFTaVzwkfpCwDvsbWwX9nAzMADZHxt7QMTPR0HQpeF +uAh6wnoA+alFOh91Xje6qxQLmUqCbmERRCZ X-Google-Smtp-Source: AGRyM1szmcFCPhikqRUhYKreskfDGaqDU7VvH1bbmj07ii5Jg074iazp7VX+aAWY14BSA/lqhFpX8A== X-Received: by 2002:a05:6808:124b:b0:2da:38f0:945f with SMTP id o11-20020a056808124b00b002da38f0945fmr4313675oiv.171.1656539603613; Wed, 29 Jun 2022 14:53:23 -0700 (PDT) Received: from smtpclient.apple ([2804:431:c7cb:fef6:c4a4:5cf:6a9a:8440]) by smtp.gmail.com with ESMTPSA id g14-20020a056870340e00b00101afc7b263sm11674358oah.9.2022.06.29.14.53.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jun 2022 14:53:23 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: [PATCH v8 9/9] manual: Add documentation for arc4random functions From: Adhemerval Zanella In-Reply-To: Date: Wed, 29 Jun 2022 18:53:16 -0300 Cc: GNU C Library , Florian Weimer Content-Transfer-Encoding: quoted-printable Message-Id: <1471BD6A-8680-41E9-9FE5-B1DC45940264@linaro.org> References: <20220629213428.3065430-1-adhemerval.zanella@linaro.org> <20220629213428.3065430-10-adhemerval.zanella@linaro.org> To: Noah Goldstein X-Mailer: Apple Mail (2.3696.100.31) X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2022 21:53:25 -0000 > On 29 Jun 2022, at 18:45, Noah Goldstein = wrote: >=20 > On Wed, Jun 29, 2022 at 2:36 PM Adhemerval Zanella via Libc-alpha > wrote: >>=20 >> --- >> manual/math.texi | 45 +++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 45 insertions(+) >>=20 >> diff --git a/manual/math.texi b/manual/math.texi >> index 477a18b6d1..ab96726e57 100644 >> --- a/manual/math.texi >> +++ b/manual/math.texi >> @@ -1447,6 +1447,7 @@ systems. >> * ISO Random:: @code{rand} and friends. >> * BSD Random:: @code{random} and friends. >> * SVID Random:: @code{drand48} and friends. >> +* High Quality Random:: @code{arc4random} and friends. >> @end menu >>=20 >> @node ISO Random >> @@ -1985,6 +1986,50 @@ This function is a GNU extension and should = not be used in portable >> programs. >> @end deftypefun >>=20 >> +@node High Quality Random >> +@subsection High Quality Random Number Functions >> + >> +This section describes the random number functions provided as a GNU >> +extension, based on OpenBSD interfaces. >> + >> +@Theglibc{} uses kernel entropy obtained either through = @code{getrandom} >> +or by reading @file{/dev/urandom} to seed and periodically re-seed = the >> +internal state. A per-thread data pool is used, which allows fast = output >> +generation. >> + >=20 > Are we committing to per-thread data pools? I thought there were ideas = to > use rseq. For this version yes, since it works on all supported kernels (even for = the ones without getentropy support) and on all architectures. I do not = know how=20 feasible it would be to implement per-cpu caches along with rseq and it = would require a fallback for older kernel (most likely a per-thread cache as = this version), although it might be future improvement.=