Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98735 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20534 invoked from network); 5 Apr 2017 15:58:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2017 15:58:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.128.175 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.128.175 mail-wr0-f175.google.com Received: from [209.85.128.175] ([209.85.128.175:34752] helo=mail-wr0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CD/02-08240-A1415E85 for ; Wed, 05 Apr 2017 11:58:19 -0400 Received: by mail-wr0-f175.google.com with SMTP id t20so21264257wra.1 for ; Wed, 05 Apr 2017 08:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=lfAR2svHhf+a2a48SJ2Hw8RnjALOwMafssDgSHG7XrI=; b=eFmC79BQA166HmSXNsshMt+l4L4C2MAR+o6T86doURo3h5XVMEPcJuBD+Ebeo4gNp7 4aPGC6ogqhS/DAYUr1LOOWfHYsr4x+fsqhiIxhCyWfuIoeLVXKpHLln7mv+6bpscpywj vCIqj7OvjAVTeEBXOhHcALO4hlk9d3fZMECst3L3T59e92Y2xsW2DW67u/fVljfWiF/b gsER58sGXibJgt/S4jmY6yuOnegx/Q3UzQexSmMocfTsxvBpkq7aYJMEK19xMPUcrthK PaMO3KBgdI4ReM7y6ZLQjW9lP1w0dDCdhUTOjfNbxc7fQ3WzayDibbNmC5FwfmV6fwah /4Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=lfAR2svHhf+a2a48SJ2Hw8RnjALOwMafssDgSHG7XrI=; b=p4UuZQJopXpyBPxLvgD1NFx3Bd+CeH4dFEv5qImBuy1y2vnCcMSmgdchsBf9B/ZyrU XPLoywkGBrJKBl9xP9NkszNk4wuoc9n1y4uI21sl651TNjET6V3+8N0YZLXNpueCEZ0t Yz3mLZK3vZdcWe2ywsNjuse1kqJJYNWN/2rYygLXUaY/ycYgLn26JvurghnX62Xi6l/J w7I9eBQaGlx3uZsC9rxT/re4gHDAa8sIU2BR+i8pA8q4LCKhC4ekwoxmeeUfd/qJZG8p umvBzvaLXcDyyw9vxrLFE10nfmcKBZCVgVjKIxTo6GRJY9fmrbRc1N1amueF503SCgLb N22g== X-Gm-Message-State: AFeK/H2qKToAZccXHIbjhKErXMIkqsZN1U7Xs+ev3lMsKTQyJ9Cr2pRhIzCQ+pM+TXoQFDYZxj8E6BAPqYGUpw== X-Received: by 10.223.170.66 with SMTP id q2mr25178085wrd.179.1491407895927; Wed, 05 Apr 2017 08:58:15 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.223.179.24 with HTTP; Wed, 5 Apr 2017 08:58:15 -0700 (PDT) X-Originating-IP: [73.9.224.155] In-Reply-To: <0B2BAD15-48AB-4095-A675-C2763ED2D91D@cschneid.com> References: <45858E8B-05A8-4EAB-97B0-A17C3D8BDD96@cschneid.com> <0B2BAD15-48AB-4095-A675-C2763ED2D91D@cschneid.com> Date: Wed, 5 Apr 2017 10:58:15 -0500 X-Google-Sender-Auth: dAiPqReD2HHS3dXRqqLFUTDqDdg Message-ID: To: Christian Schneider Cc: Yasuo Ohgaki , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] SHA3 is very slow From: pollita@php.net (Sara Golemon) On a similarly superficial scan, I have no issues with this. The only tiny thing which gives me pause is https://github.com/php/php-src/pull/2453/files#diff-0bb62bbdac4073ae183a857= 299826533R24 as I don't recall 100% if that redefinition will leak out to other parts of the runtime (my instinct says it will, so that might need to live in a different spot). As long as the unit tests continue to pass (I assume they do) and the licensing on the bundled library is favorable (it seems to be), it's just one fast implementation in exchange for a slow one. -Sara On Wed, Apr 5, 2017 at 10:45 AM, Christian Schneider wrote: > 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/gvana= s/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 vers= ion from KeccakCodePackage with around a dozen files would be acceptable. > > I put the (part which is used from the) KeccakCodePackage code (without m= odifications!) in a separate directory under ext/hash/sha3 and I also imple= mented 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-i= s-the-kcp-distributed > but it looked like it should be ok. Not an expert on this though ;-) > > Regards, > - Chris > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >