Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118267 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46906 invoked from network); 15 Jul 2022 14:17:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Jul 2022 14:17:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C2B1A1804C6 for ; Fri, 15 Jul 2022 09:12:34 -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=-0.2 required=5.0 tests=BAYES_20,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,T_SCC_BODY_TEXT_LINE 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: Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 15 Jul 2022 09:12:34 -0700 (PDT) Received: by mail-ej1-f54.google.com with SMTP id mf4so9810946ejc.3 for ; Fri, 15 Jul 2022 09:12:34 -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=3Otd0POLkLEtG7Q7RvX/ruIa9qLW1OcYRKcdxAJdW+0=; b=WVTahXp9O02YvCYL8yuPG4rd9c2BqwnZmSY+p3sDZHs8jYUtwR1hPFigFfQZ4P7Q2M R5P7pqtlwuArQWKsLb11LscSbfYdTH4x3vpR0ZMZ0GiJh54YtR+3qH5KX4ORI+hqquwi cXFvj78AqlCobwpPd+rt7GV3Hz4KsLnglBwM0wI6J8D8AJ/VS8a22X9F/Lx9EUmfDYFI Hh0fu4/b9tqdnSfDNzovOjaNmjatuzobZYZN5sQ8CUxaSwZ4LMk/e6Cp3VZBckkMRs0G YW9OIpJADfBX79JaulyK4Yn6szb9hsyWMQM8Gg51pkhyqqkBfvmLqXBNwt9DtpY5D7i4 mrbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=3Otd0POLkLEtG7Q7RvX/ruIa9qLW1OcYRKcdxAJdW+0=; b=atqMvPl+nfwcz/5iZPWlgyd0/UI0dnT+SE08vDrII7bJEQNx25dzf4Tw2WusrdrmQO ANhaoVL4hPmf18qSnWP/fArygjEtrt30U/OzrJAYmJbZqNFPcbWe/82F3VyGUerVMzBP Z5cFzr8jZIrLAT3LXoiVeI/HDU/zOHcGVJf/AjTx5MXQTd467/KzWTobsX5K5L7UuxQt f1nwGbhocHNqu5yspqX8+xiyvScFyv+g36D8+vKSXIRIiZIjTSPG+PAm9xVfn3sXnG8J 0VS8dLaNzgZY0zKd4JT0Ys9KUIdfLEKWb/F+mdPZJa5omFIpFwe9MARIkicQPkjCmzSB Acgg== X-Gm-Message-State: AJIora9ESfeAyOVAOaTfuyHiw5zem+A2zWGqhdyDSwhk6C9GuHwKNOIk UwUrLq/PCgxwYwXKYbg8lYKZg9fH5k4ns52C3zBqmb3AOTY= X-Google-Smtp-Source: AGRyM1sSNUiaiO3QJhd1mVdQdgd9RV5M6y9xOCYRR9d3PnP2OXOKDnK2pTVFhBZR8+agYFlu7R3dQQvzNdmYm25MMy8= X-Received: by 2002:a17:907:7348:b0:72b:44bf:96b6 with SMTP id dq8-20020a170907734800b0072b44bf96b6mr14638877ejc.7.1657901553010; Fri, 15 Jul 2022 09:12:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 16 Jul 2022 01:12:21 +0900 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000023cbaa05e3da49b2" Subject: Re: What do you think CSPRNG in PHP From: zeriyoshi@gmail.com (Go Kudo) --00000000000023cbaa05e3da49b2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2022=E5=B9=B47=E6=9C=8816=E6=97=A5(=E5=9C=9F) 0:54 Go Kudo : > Hi Internals. > > Random Extension is accepted and being implemented in PHP 8.2. Many thank= s > for the review. > > The changes to enable arc4random in glibc were recently merged. > > https://github.com/php/php-src/pull/8984 > > This has the effect of reducing the number of getrandom system calls > issued on Linux, which is effective in improving performance. > > However, this will only work in environments that use GNU libc, and will > not work on Linuxes that use other libc (e.g. Alpine Linux that uses musl= ). > > As we discussed a bit above in PR (which is inherently a bad thing, > because it's not a good thing), the following is an example of a "good" P= R > campaign Apologies), if we could implement CSPRNG on PHP, for example, it > would improve performance on all platforms. > > However, there are several challenges to this. > > - Increased maintenance costs > - Requires optimization for CPU architecture > - Requires familiarity with CSPRNG > > PHP already bundles xxHash and appears ready to make this happen. > > Also, an appropriate CSPRNG implementation may be able to resolve the > current complex macro branching. > > What do you think about this? > > Regards > Go Kudo > xxHash has nothing to do with it. Forget it. --00000000000023cbaa05e3da49b2--