Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:115927
Return-Path: <zeriyoshi@gmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 17368 invoked from network); 3 Sep 2021 13:19:18 -0000
Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5)
  by pb1.pair.com with SMTP; 3 Sep 2021 13:19:18 -0000
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id 6E9D51804C8
	for <internals@lists.php.net>; Fri,  3 Sep 2021 06:55:46 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net
X-Spam-Level: 
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,
	SPF_PASS autolearn=no autolearn_force=no version=3.4.2
X-Spam-ASN: AS15169 209.85.128.0/17
X-Spam-Virus: No
X-Envelope-From: <zeriyoshi@gmail.com>
Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by php-smtp4.php.net (Postfix) with ESMTPS
	for <internals@lists.php.net>; Fri,  3 Sep 2021 06:55:46 -0700 (PDT)
Received: by mail-ej1-f46.google.com with SMTP id e21so12238792ejz.12
        for <internals@lists.php.net>; Fri, 03 Sep 2021 06:55:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20210112;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
        bh=Ad4c1CIeVyzN0nbVXDybz+78NqkJtZ+hv2pPtla0Mwc=;
        b=WdW2VCGhEd4cl1YgpiW9QPnKb6AwdQENlxRLc8czYDUeq2d2IWUFnAzqbnCjto4740
         BeXfm9xuE0aniV6AvH8X8zOUv0IbYfCH4/guMqIZh2sbRVIjuBPqyYEk6QKtOouqh8zY
         UKM0UuV7ag39zdByGyKpRwniSHIYdP13Yk9J9UWEQ3HswRx/qCacUuytEniHomTiWRkf
         VTrJgpYWJ5LAgUV++k249JBbmO3lT7cMRWAnIDbfebMzoC44IQRTi1Yquw07mMQ5AII0
         9MA/l4QEgB5gdOUzQ4hlS1d7l85tDCDftw+wRdzl1jS5IfJ2xhigWeqSGx6eFcC3LW6/
         yEcg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to;
        bh=Ad4c1CIeVyzN0nbVXDybz+78NqkJtZ+hv2pPtla0Mwc=;
        b=VS/DBqxZAQ+6bMS3PfynoUJ7nM/hUqHug0vSNAXk05Un1lPLehdH+ql838S4MpNuy8
         nO1hSmOvQ4o7mPg3sVXekpvgH01VRrb0zkH6VZGdexT+wKWv6nmxKsxJ2a02CwIFx3V/
         IWB8sRsVZs9F8fTl0cIOPfjltqDDbhiMi8tyXFP0hVlupfF3PoDAPZhh1olpuAYMbSm7
         vVCRm2m1iiPv7F8rzkdvQpb4z0QiNDqtV2PaNg+WAnwrwlYKiOj4+aBw0Fg6yNa75/U9
         NApAZ9k16xyKVZPrLNXVecBRi6QdJJLpAln+F5TqrbTSFDzh+Mns387K3eOgZK7Bm88P
         mPYQ==
X-Gm-Message-State: AOAM531298w/FXHwaFoQ2A3ks1NNXcE75ftjxTEslTw4s4QYl5V/BhWa
	bvcdFoGfzwDwUTgaaT8yh31B4skwMoAM4CiQ2XVz2iathSBVzw==
X-Google-Smtp-Source: ABdhPJyZq6YVOOp3hehRLMhC0j+rWUA4UhAyeYEDsAJHAqWn65pOwLpwmfsmBu6LWL017sid82FjGlTVg2tTyUCIfAg=
X-Received: by 2002:a17:906:3159:: with SMTP id e25mr4333091eje.549.1630677342542;
 Fri, 03 Sep 2021 06:55:42 -0700 (PDT)
MIME-Version: 1.0
References: <CABTDVhBRpD=nWBk2xGLEmdcWwOzCeqGeqH5vLSugPFOeEN9Mog@mail.gmail.com>
 <6921b613-d993-4e5b-82a7-60e3c9b3df38@www.fastmail.com>
In-Reply-To: <6921b613-d993-4e5b-82a7-60e3c9b3df38@www.fastmail.com>
Date: Fri, 3 Sep 2021 22:55:29 +0900
Message-ID: <CABTDVhDufAQMvHJqe6fF5Jz+t0Wo+hbRA0A7KA1jh9ZPBeR2Eg@mail.gmail.com>
To: Larry Garfield <larry@garfieldtech.com>, PHP internals <internals@lists.php.net>
Content-Type: multipart/alternative; boundary="000000000000bee01e05cb17a746"
Subject: Re: [PHP-DEV] [RFC] Random Extension 3.0
From: zeriyoshi@gmail.com (Go Kudo)

--000000000000bee01e05cb17a746
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thank you.

> Why is the number generator a parent class rather than an interface?

This is an implementation limitation. I could not find a way to define my
own object handler in interface.
As Nikita pointed out in a previous suggestion, the NumberGenerator now
uses php_random_ng_algo_user to generate random numbers faster than before,
even if it is a userland implementation.

> You don't mention the CSPRNG functions at all.

This is a mistake. I have corrected it. Thanks!

I will keep an eye on it throughout the next week, and if there are no
additional responses, I will start voting the week after next.

Regards,
Go Kudo

2021=E5=B9=B49=E6=9C=883=E6=97=A5(=E9=87=91) 3:26 Larry Garfield <larry@gar=
fieldtech.com>:

> On Thu, Sep 2, 2021, at 10:10 AM, Go Kudo wrote:
> > Hi Internals.
> >
> > Expanded from the previous RFC and changed it to an RFC that organizes
> the
> > whole PHP random number generator. Also, the target version has been
> > changed to 8.2.
> >
> > https://wiki.php.net/rfc/rng_extension
> > https://github.com/php/php-src/pull/7453
> >
> > Hopefully you will get some good responses.
> >
> > Regards,
> > Go Kudo
>
> This looks pretty nice to my unskilled eye.  Two questions.
>
> 1) Why is the number generator a parent class rather than an interface?
> It seems like an interface target.  And either way it needs more clarity
> about how you'd write one for reals.  (It returns an int, so does that me=
an
> getBytes() just derives from a series of ints?)
>
> 2) You don't mention the CSPRNG functions at all.  Is there any intention
> to fold those into this model as well, or to leave those as is?  Or is th=
e
> Secure generator implementation intended to replace those?  It's unclear
> here.
>
> --Larry Garfield
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>

--000000000000bee01e05cb17a746--