Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112716 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7471 invoked from network); 2 Jan 2021 22:08:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jan 2021 22:08:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4E3C31804F3 for ; Sat, 2 Jan 2021 13:44:06 -0800 (PST) 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_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 ; Sat, 2 Jan 2021 13:44:05 -0800 (PST) Received: by mail-lf1-f51.google.com with SMTP id l11so55609901lfg.0 for ; Sat, 02 Jan 2021 13:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4SD7IVuWDXr2QCmkFL4TFhZq/1LblSRdJzPSmihnYJQ=; b=nIF5PW5CW4GCny49BrZP0NUj2W2ClKC5QDk0Se+baCvsalf35KP+tNdZvYn/M5+U3p zABrnZsJh292DKowhGONzYtj2iZT5VRu/0bMqV8giS4IGkPaEEd5D2CAS3B5dV0kDzWo /y1eo04e2ZkI26yHyjKGDbpGNv2WoqNXzWlAtQsPV/sg6akixgiozm+0PZhHAYZdJjAA yEv743FLWj+XKorIGc8k0Pooi369WgfrWqrkUhuOy6H586mKsBu3AMZl7NiFxb4fopHc bO1z1MmHmSBOoV2BFQ/dHGkRbt38UpYVVso8Bg5cHrm3JfLNisOK8GdHkJHiLYBdNhtF zIkQ== 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=4SD7IVuWDXr2QCmkFL4TFhZq/1LblSRdJzPSmihnYJQ=; b=VfhwH4OvIewNhBqdXlRen/RmPlFWvkeP5FAOGSQHPUdH9hlhqFiGKOyjbgFzQXi3Lg oVWlATxiNO3ObRSOMn95eu/eDUQW6jhvKApM7MhYSRgrsQAmq7k5cgV5CkYKSZJ+FRIZ 3NFQyhAob5wQr35juwV9fR9gGKXfiqi2Cm99uYNuQ0NVkovncgr5ab9LNFk5gdRXhihK R3/9Iz+4POTxK5bsEonX63JbNdt/2TnYA58QKDU4bQ6xIWzyv5xMAIT5Ljkq3OqLlu3N MgjRuehCo50FsU96Hgj9/uHj0687dy1ef7rxTKYNb35i2kV2c5tt8LCT9TXlSoxaDLQO 00HA== X-Gm-Message-State: AOAM5325GuQHDA7kPknqohIu7Q1PfyR56TQYIS2bWNYsKb8vg+NXUHfG A009upGv3lfzxoBXLvYasTNIRUnaGUTy5qQZ/2Dq0cqADzim5w== X-Google-Smtp-Source: ABdhPJw7zDpnt93FRdyz8D5Dk867MfCTe4/uJYnOfP2cVplHCIti8e8HngGlJwwuR1FbugYn0HtFqwH63XgRXpL/V40= X-Received: by 2002:a19:d86:: with SMTP id 128mr31164836lfn.317.1609623843329; Sat, 02 Jan 2021 13:44:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 3 Jan 2021 06:43:52 +0900 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000006758bd05b7f1c185" Subject: Re: Improving PRNG implementation. From: zeriyoshi@gmail.com (Go Kudo) --0000000000006758bd05b7f1c185 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Unfortunately, there is not much feedback on this proposal. To remedy the situation, we have updated the RFC and implemented it. https://wiki.php.net/rfc/object_scope_prng https://github.com/php/php-src/pull/6568 Currently, it seems to work generally as expected, although it has failed to be tested on Windows. However, I am not sure if it is correctly with the new serialize / unserialize mechanism of PHP. (Of course we've tested the behavior) 2020=E5=B9=B412=E6=9C=8816=E6=97=A5(=E6=B0=B4) 23:46 zeriyoshi : > Nice to meet you, internals. > > PHP 8.0 has been released. With the inclusion of JIT, PHP is about to be > extended beyond the web. > > So I'd like to make a few suggestions. > > First , PHP has the historical Mersenne Twister PRNG. However, this > implementation keeps its state in a global and cannot be handled as an > object like other languages (e.g. Java). > > So, I created a PHP Extension and proposed it to PECL. > > https://marc.info/?l=3Dpecl-dev&m=3D160795415604102&w=3D2 > https://github.com/zeriyoshi/php-ext-orng > > But, Then I looked at the mailing list archives and noticed that a simila= r > proposal had been made before. > > https://externals.io/message/98021#98130 > > I feel that this suggestion is needed now to expand PHP beyond the web. > > Second suggestion is to stop using the Combined LCG as the default seed > value for each function. > > PHP's Combined LCG only uses PID (or ZTS Thread ID) and time as entropy. > https://github.com/php/php-src/blob/master/ext/standard/lcg.c#L72 > > With the development of container technology, this problem seems to be > getting more serious. So I think we should use the random numbers provide= d > by the OS (getrandom on Linux) if available. > > I would like to hear your opinions. > > Regards > Go Kudo > --0000000000006758bd05b7f1c185--