Re: SHA3 is very slow
| From: | Christian Schneider | Date: | Wed, 05 Apr 2017 15:45:20 +0000 |
| Subject: | Re: SHA3 is very slow | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98734@lists.php.net to get a copy of this message | ||
Am 05.04.2017 um 04:31 schrieb Yasuo Ohgaki <yohgaki@ohgaki.net>:
> 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