Req #65891 [Opn->Csd]: PHP is missing a sha3() function
| From: | nikic@php.net | Date: | Sat, 11 Mar 2017 17:21:59 +0000 |
| Subject: | Req #65891 [Opn->Csd]: PHP is missing a sha3() function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207784@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65891&edit=1
ID: 65891
Updated by: nikic@php.net
Reported by: scott dot baker at gmail dot com
Summary: PHP is missing a sha3() function
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: hash related
Operating System: Linux
PHP Version: 5.5.5RC1
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
The hash extension supports sha3 as of PHP 7.1, using the names sha3-224, sha3-256, sha3-384,
sha3-512. Relevant commit: https://github.com/php/php-src/commit/d244b54c67cc2725283b78d4bb128501ae7910d3
Previous Comments:
------------------------------------------------------------------------
[2015-11-11 14:06:50] divinity76 at gmail dot com
add it to the hash function and stop whining about sha3(), once its in the hash() it can _very_
easily be polyfilled if you want it. however, a slight problem is that sha3 is variable-length, so
hash() needs to be modified to take a new argument of output size
------------------------------------------------------------------------
[2014-07-12 19:57:29] ryacko at gmail dot com
Except that SHA-3 is a hash function with a variable length and variable security margin.
One could add the four SHA3 standards, but that wouldn't make available all the possible ways
to use SHA3.
It could be used as stream cipher for instance.
http://keccak.noekeon.org/tune.html
------------------------------------------------------------------------
[2013-10-15 17:18:29] nikic@php.net
I agree with Pierre. This is a hash function, so it belongs in the hash extension. There is no point
in adding an individual function for every single hash type.
------------------------------------------------------------------------
[2013-10-15 16:50:48] scott dot baker at gmail dot com
Perhaps we could have support for both hash() and sha3() methods?
I really like the sha3() method that strawbrary wrote. It's very logical and easy to remember.
hash() requires me to remember the order of parameters, and the hash name. sha3() seems more direct.
------------------------------------------------------------------------
[2013-10-14 06:04:09] pajoye@php.net
I would rather add it to the hash extension, more consistent.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=65891
--
Edit this bug report at https://bugs.php.net/bug.php?id=65891&edit=1