Re: faster & public domain MD5 implementation
| From: | Solar Designer | Date: | Thu, 07 Feb 2008 11:50:27 +0000 |
| Subject: | Re: faster & public domain MD5 implementation | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35294@lists.php.net to get a copy of this message | ||
I wrote:
> Oh, I am able to reproduce this with my original patch:
>
> PASS hmac-md5 algorithm [ext/hash/tests/hmac-md5.phpt]
> PASS md2 algorithm [ext/hash/tests/md2.phpt]
> FAIL md4 algorithm [ext/hash/tests/md4.phpt]
> PASS md5 algorithm [ext/hash/tests/md5.phpt]
> PASS ripemd128 algorithm [ext/hash/tests/ripemd128.phpt]
>
> It didn't occur to me to pay attention to the MD4 test after patching
> MD5. Really weird. I'll look into it.
OK, I think I found it. ext/hash/php_hash_md.h has this:
#define PHP_MD4Init PHP_MD5Init
which breaks when the two implementations are not that similar anymore.
Replacing the MD4 implementation with mine as well would fix this (or
hide the bug, depending on your point of view), but for now I think the
right fix would be to define a PHP_MD4Init() function explicitly.
Alexander