Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98734 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18799 invoked from network); 5 Apr 2017 15:45:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2017 15:45:32 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Received: from [195.226.6.51] ([195.226.6.51:44802] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/B1-08240-41115E85 for ; Wed, 05 Apr 2017 11:45:26 -0400 Received: from [10.183.1.94] (ls-zhfoer [217.192.174.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 9E6EBDC0EE3; Wed, 5 Apr 2017 17:45:21 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) In-Reply-To: Date: Wed, 5 Apr 2017 17:45:20 +0200 Cc: "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <0B2BAD15-48AB-4095-A675-C2763ED2D91D@cschneid.com> References: <45858E8B-05A8-4EAB-97B0-A17C3D8BDD96@cschneid.com> To: Yasuo Ohgaki X-Mailer: Apple Mail (2.3273) Subject: Re: [PHP-DEV] SHA3 is very slow From: cschneid@cschneid.com (Christian Schneider) Am 05.04.2017 um 04:31 schrieb Yasuo Ohgaki : > PHP's sha3 seems slower than it could be. I created a pull request at https://github.com/php/php-src/pull/2453 for = a version using the KeccakCodePackage version from = https://github.com/gvanas/KeccakCodePackage which yields ~30 times = faster results for a simple test. I don't know whether the PHP maintainers prefer to keep the (very short) = inline reference implementation which is slow or whether the optimised = version from KeccakCodePackage with around a dozen files would be = acceptable. I put the (part which is used from the) KeccakCodePackage code (without = modifications!) in a separate directory under ext/hash/sha3 and I also = implemented switching between a 64bit and a 32bit version. Don't know if = this is necessary and following all the guidelines. Oh, I also only superficially scanned = https://github.com/gvanas/KeccakCodePackage#under-which-license-is-the-kcp= -distributed but it looked like it should be ok. Not an expert on this though ;-) Regards, - Chris