Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117299 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72941 invoked from network); 9 Mar 2022 17:34:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Mar 2022 17:34:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 79B1518053B for ; Wed, 9 Mar 2022 10:57:31 -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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 9 Mar 2022 10:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1646852249; bh=Du2vObpufCs1O1FSwhwwrFKagp+xA7FiHDyafdqaZs0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bsIIw5bCZDylKXoIPap+MV5KwWtCFFCxSXdOIDR/bgDrvglbdqPF5N27yDjbilYqb Dwk2r7aKcweq3qL/JVAs0aT8KBSm2LDRJGvWaqfga9+KJEDfYHxO1iZE5KxQj0vXwd egTKWzxRHwpub5khhpZkLbSbg3y1A1Mi8gkiFrdHtMeGxQkbjmjW7rBT0K4UqlazwO YihmhnYkcTGk1mH/LJEuO7t9x4g6D4QGaIKRKu3YhK0zJDAbSYEAzJVqc1GfauiVZW MdzIbcWmpk0mExDCGFrmKGlxepQk/ygImu7dFrj0JXVoRPa9LIHLesz/vURyGgFLIL qr8EWK1LaW7hg== Message-ID: <540c90b6-39cc-8cae-7912-602e5bf559c6@bastelstu.be> Date: Wed, 9 Mar 2022 19:57:28 +0100 MIME-Version: 1.0 Content-Language: en-US To: Go Kudo , internals@lists.php.net Cc: mel@dafert.at References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Under Discussion] Random Extension 5.x From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 3/9/22 11:48, Go Kudo wrote: > Proposed RFCs and implementations have been reorganized. The main changes > are as follows > > https://wiki.php.net/rfc/rng_extension > https://github.com/php/php-src/pull/8094 > I've compared the RFC against the implementation once more: - The RFC should clarify that returning an empty string in Engine::generate() is not allowed. - The corresponding test 'ext/random/tests/03_randomizer/user_unsafe.phpt' should verify not just an exception is thrown, but also the exception message (I'll add a review comment). - PCG64 effectively has 256 Bits of internal state (128 Bits for 's' and 128 Bits for 'inc'), but it only accepts 128 Bits for 's'. 'inc' cannot be provided by the user. The purpose of 'inc' is not entirely clear to me, but the user likely should be able to specify it for full reproducibility. - The default initialization of PCG64 with a null seed will fill 'inc', not 's'. This likely is a bug? At least it's inconsistent with the previous point. - The RFC is missing an explanation of the guarantees the implementation will (or will not) make. This is important for the user if they are relying on reproducibility of the sequences and outputs. The more guarantees we give, the less can be changed in the future. I've previously mentioned that in the thread for '4.x': https://externals.io/message/117026#117061 Best regards Tim Düsterhus