Bug #73127 [Com]: gost-crypto hash incorrect if input data contains long 0xFF sequence
| From: | grundik at ololo dot cc | Date: | Fri, 03 Feb 2017 09:13:42 +0000 |
| Subject: | Bug #73127 [Com]: gost-crypto hash incorrect if input data contains long 0xFF sequence | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207146@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73127&edit=1
ID: 73127
Comment by: grundik at ololo dot cc
Reported by: grundik at ololo dot cc
Summary: gost-crypto hash incorrect if input data contains
long 0xFF sequence
Status: Open
Type: Bug
Package: hash related
Operating System: Linux
PHP Version: 7.0.11
Block user comment: N
Private report: N
New Comment:
Same issue in gost hash:
Test script:
---------------
$test = str_repeat("\xFF", 40);
echo hash('gost', $test);
Expected result:
----------------
9eaf96ba62f90fae6707f1d4274d1a9d6680f5a121d4387815aa3a6ec42439c5
Actual result:
--------------
140da043c3c8c9355b73de375ba23ce82cd0aa7c2ba334a25b7058fbe3efaba2
Previous Comments:
------------------------------------------------------------------------
[2016-10-31 15:17:06] iofeed at yandex dot ru
This problem is easily reproduced when you try to create hash for an XLS file.
------------------------------------------------------------------------
[2016-09-20 12:11:47] grundik at ololo dot cc
Description:
------------
If input data contains long sequence of 0xFF bytes (40+ bytes), then calculated hash using
gost-crypto algorithm becomes incorrect. That affects at least these functions:
* hash;
* hash_file;
* hash_stream.
Test script:
---------------
$test = str_repeat("\xFF", 40);
echo hash('gost-crypto', $test);
Expected result:
----------------
231d8bb980d3faa30fee6ec475df5669cf6c24bbce22f46d6737470043a99f8e
Actual result:
--------------
8e0be2995864c40f8111feaa9df6fc4830632fdf61e365d9feca87f1e485d1f7
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73127&edit=1