php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61291 tiger is broken
Submitted: 2012-03-05 16:29 UTC Modified: 2012-03-06 12:01 UTC
From: remi@php.net Assigned: mike (profile)
Status: Not a bug Package: hash related
PHP Version: 5.4.0 OS: GNU/Linux (Fedora 16)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: remi@php.net
New email:
PHP Version: OS:

 

 [2012-03-05 16:29 UTC] remi@php.net
Description:
------------
mhash_001 and mash_003 fails.

For mhash 001
025+ MHASH_TIGER: string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"
026+ MHASH_TIGER: string(48) "953ac3799a01b9fdeb91aeab97207e67395cbb54300be00d"

Some tests


==== PHP 5.1.6

php -r 'var_dump(bin2hex(mhash(MHASH_TIGER,"This is the test of the mhash extension...")));'
string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"

php -r 'var_dump(bin2hex(mhash(MHASH_TIGER,"This is the test of the mhash extension...")));'
string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"

==== PHP 5.3.10

php -r 'var_dump(bin2hex(mhash(MHASH_TIGER,"This is the test of the mhash extension...")));'
string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"

php -r 'var_dump(bin2hex(hash("tiger192,3","This is the test of the mhash extension...",true)));'
string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"

==== PHP 5.4.0

php -r 'var_dump(bin2hex(mhash(MHASH_TIGER,"This is the test of the mhash extension...")));'
string(48) "953ac3799a01b9fdeb91aeab97207e67395cbb54300be00d"

php -r 'var_dump(bin2hex(hash("tiger192,3","This is the test of the mhash extension...",true)));'
string(48) "953ac3799a01b9fdeb91aeab97207e67395cbb54300be00d"

=== PHP 5.4.0 with patch

php -r 'var_dump(bin2hex(mhash(MHASH_TIGER,"This is the test of the mhash extension...")));'
string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"

php -r  'var_dump(bin2hex(hash("tiger192,3","This is the test of the mhash extension...",true)));'
string(48) "fdb9019a79c33a95677e2097abae91eb0de00b3054bb5c39"




Patches

hash-tiger.patch (last revision 2012-03-05 16:29 UTC by remi)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-05 16:34 UTC] remi@php.net
Seems related to 
http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/ext/hash/hash_tiger.c?r1=321634&r2=322437

(8 * (0%8)) != 56


The patch fixes this, and the "old" tests.

I think, this will break the "new" tests (added after the regression was introduce)
 [2012-03-05 17:56 UTC] mike@php.net
-Assigned To: +Assigned To: mike
 [2012-03-06 08:50 UTC] mike@php.net
Hi Remi,

this is not a bug, it's the result of a fix for bug #60221
See alos bug #32463

Thanks,
Mike
 [2012-03-06 08:50 UTC] mike@php.net
-Status: Assigned +Status: Not a bug
 [2012-03-06 12:01 UTC] mike@php.net
To clarify the situation, it's just a matter of how to display the hash:

http://pastie.org/3532887
 [2012-03-06 18:13 UTC] remi@php.net
So, to clarify the fix for bug #60221

The new result is ok.

So, mhash_001.phpt and mash_003.phpt tests need to be fixed

So, if I have store hash results somewhere with php < 5.4.0, I won't be able to check this with php >= 5.4.0 ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 03:01:28 2024 UTC