Bug #73127 [Com]: gost-crypto hash incorrect if input data contains long 0xFF sequence
| From: | iofeed at yandex dot ru | Date: | Mon, 31 Oct 2016 15:17:07 +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-205110@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: iofeed at yandex dot ru
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:
This problem is easily reproduced when you try to create hash for an XLS file.
Previous Comments:
------------------------------------------------------------------------
[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