public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH v12 1/9] stdlib: Add arc4random, arc4random_buf, and arc4random_uniform (BZ #4417)
Date: Fri, 22 Jul 2022 14:00:30 -0300	[thread overview]
Message-ID: <8e0450cf-60c7-5536-969c-92c3b1865d8d@linaro.org> (raw)
In-Reply-To: <eaaf1937-ad17-6fee-ae68-f6a4cc0f3426@owlfolio.org>



On 22/07/22 12:31, Zack Weinberg via Libc-alpha wrote:
> On 2022-07-22 8:21 AM, Adhemerval Zanella via Libc-alpha wrote:
>> diff --git a/NEWS b/NEWS
>> index df882ec243..8420a65cd0 100644
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -60,6 +60,10 @@ Major new features:
>>     _GNU_SOURCE macro is defined and the C++20 __cpp_char8_t feature test macro
>>     is not defined (if __cpp_char8_t is defined, then char8_t is a builtin type).
>>   +* The functions arc4random, arc4random_buf, and arc4random_uniform have been
>> +  added.  The functions use a pseudo-random number generator along with
>> +  entropy from the kernel.
>> +
> 
> I think the second sentence ought to be a little more specific than "a pseudo-random number generator", since the whole point of the arc4random* API is that it's supposed to be cryptographically strong, and since the name (incorrectly) suggests that a *known-broken* CSPRNG is in use.  Maybe something like
> 
> "These functions implement a cryptographically strong pseudo-random number generator, based on ChaCha20 and automatically seeded from kernel-provided entropy."

My understanding is we do not really want to state this scheme used is a CRNG,
since it might create an additional certification requirement (such as FIPS)
nor I have the cryptographic background to certify it follows the requirements
(although reading http://blog.cr.yp.to/20170723-random.html it does follow the
idea and it also based on already deployed implementations like openbsd).

> 
>> reseeds the internal state on every 16MB of consumed buffer
> 
> Is this sufficient to provide forward security (i.e. a state leak does not permit the attacker to reconstruct past outputs of the RNG)?
> 
> zw

I am not sure, openbsd implementation stir value was added without much comment
why the value was chosen.  Should we tune a lower bound? 


  reply	other threads:[~2022-07-22 17:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 12:21 [PATCH v12 0/9] Add arc4random support Adhemerval Zanella
2022-07-22 12:21 ` [PATCH v12 1/9] stdlib: Add arc4random, arc4random_buf, and arc4random_uniform (BZ #4417) Adhemerval Zanella
2022-07-22 12:35   ` Florian Weimer
2022-07-22 13:00     ` Adhemerval Zanella Netto
2022-07-22 15:31   ` Zack Weinberg
2022-07-22 17:00     ` Adhemerval Zanella Netto [this message]
2022-07-22 12:21 ` [PATCH v12 2/9] stdlib: Add arc4random tests Adhemerval Zanella
2022-07-22 12:21 ` [PATCH v12 3/9] benchtests: Add arc4random benchtest Adhemerval Zanella
2022-07-22 12:21 ` [PATCH v12 4/9] aarch64: Add optimized chacha20 Adhemerval Zanella
2022-07-22 12:21 ` [PATCH v12 5/9] x86: Add SSE2 " Adhemerval Zanella
2022-07-22 12:21 ` [PATCH v12 6/9] x86: Add AVX2 " Adhemerval Zanella
2022-07-22 12:21 ` [PATCH v12 7/9] powerpc64: Add " Adhemerval Zanella
2022-07-27 14:09   ` Tulio Magno Quites Machado Filho
2022-07-22 12:21 ` [PATCH v12 8/9] s390x: " Adhemerval Zanella
2022-07-22 12:21 ` [PATCH v12 9/9] manual: Add documentation for arc4random functions Adhemerval Zanella
2022-07-22 15:33   ` Zack Weinberg
2022-07-22 17:15     ` Adhemerval Zanella Netto
2022-07-24 15:20       ` Zack Weinberg
2022-07-22 19:12 ` [PATCH v12 0/9] Add arc4random support Cristian Rodríguez
2022-07-22 21:35   ` Adhemerval Zanella Netto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e0450cf-60c7-5536-969c-92c3b1865d8d@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).