iliaa Thu Nov 28 09:13:44 2002 EDT Modified files: /php4/ext/mhash/tests 003.phpt 001.phpt Log: Fixed mhash tests, apparently the TIGER algorithm was updated (fixed?) in later mhash releases and consequently returns a different hash. I've updated the hash to the one generated by latter releases. Removed useless \r from ext/mhash/tests/003.phpt. Index: php4/ext/mhash/tests/003.phpt diff -u php4/ext/mhash/tests/003.phpt:1.2 php4/ext/mhash/tests/003.phpt:1.3 --- php4/ext/mhash/tests/003.phpt:1.2 Fri Nov 22 09:07:29 2002 +++ php4/ext/mhash/tests/003.phpt Thu Nov 28 09:13:44 2002 @@ -9,63 +9,63 @@ $supported_hash_al = array( "MHASH_MD5" => "\x15N24zPF\x06栔\x0CTyzcght^W\x09-sA7Y:\x10wݲxdqS^҃&U,: aǙz\x06\x1CS\x01", -"MHASH_SHA1" => "1\\p\x06\x1D\x07E]S\x0B\x08\x0Caf\\\x1A\x01\x10T#\$2\x06xc\x0A=\x16\"IJ\x0E'NΚԽn\x08J3\x15<+H\x13\x1D0[\x00[Y\x12qء\x19KmI", +"MHASH_SHA1" => +"1\\p\x06\x1D\x07E]S\x0B\x08\x0Caf\\\x1A\x01\x10T#\$2\x06xc\x0A=\x16\"IJ\x0E'NΚԽn\x08J3\x15<+H\x13\x1D0[\x00[Y\x12qء\x19KmI", "MHASH_HAVAL256" => "G\x00NPw\x0CH6Wل+,\x1C\x0DgdZU\x07)oAi[NadT\x17\x1F2ZU46}IYb,C\x17\x1Au{[x", "MHASH_HAVAL224" => "\\J=Z\x08\x08y8ha\x0Apg|yܫq\x19\x1E\x06)˼lnjG\x0CB@kwºQv52OP-05\x00L m`G-2I", "MHASH_HAVAL192" => "\"q&\x02<.A\x07/\x1E2d\x17\x1C2Xv\x0Bpű%\x03\x16(C;+\x08pz8\x12\x15\x13N\x08udd)qهv_MINxLtLJ", "MHASH_HAVAL160" => "\x07dn6GXm\x06\x1E\x00η#5M\"mi\x1D1\$\x0E|X<O)Y;=ʰy.`\"`\x02ٴB ԯҵk>G\x19\x17~\x0D~", "MHASH_RIPEMD160" => "Fx\x0D5\x02\x0a\x1D[\x19gDXgwܡD&bjB7]G[\x14G`^\x1B\x08K\x11\x173C-AB%\x04K\x03??K", -"MHASH_GOST" => "Di~C=wƂ\x17B\x15}sM\x01d|\x014hY\"\x0AI*b@фxc@sިyN%d\x09FD\x0a\x12\x12P\x0F}E~:pO\x0DpwR{\x19M", -"MHASH_TIGER" => "!p+##f6y!p+##f6y!p+##f6y!p+##f6y!", +"MHASH_GOST" => +"Di~C=wƂ\x17B\x15}sM\x01d|\x014hY\"\x0AI*b@фxc@sިyN%d\x09FD\x0a\x12\x12P\x0F}E~:pO\x0DpwR{\x19M", +"MHASH_TIGER" => +"g{\nG&/3d#7`2UBQ/y)X#k'hn/Ep*M1 VKyO` + M6|\"", "MHASH_CRC32" => "H@&_YoQ1[Fq\"\x08fV8\x08EE<M:Ⱥrk*Hu/}h3iWJ?vui=W\"", "MHASH_CRC32B" => "le>}*]Fכ6\x13bCˏ. I\x0FjΥ0\x0D\x1F<.Qy疾tixb\$}\x0Bȴ ϬȌDDK\x131uL6`ɏ|Ec\x04", ); -foreach ($supported_hash_al as $hash=>$wanted) { +foreach ($supported_hash_al as $hash=>$wanted) { $passwd = str_repeat($hash, 10); $salt = str_repeat($hash, 2); - $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100); - if (!strcmp($result, $wanted)) { - echo "$hash\nok\n"; - } else { - echo "$hash: "; - var_dump(bin2hex($wanted)); - echo "$hash: "; - var_dump(bin2hex($result)); - } - echo "\n"; -} -?> ---EXPECT-- -MHASH_MD5 -ok - -MHASH_SHA1 -ok - -MHASH_HAVAL256 -ok - -MHASH_HAVAL224 -ok - -MHASH_HAVAL192 -ok - -MHASH_HAVAL160 -ok - -MHASH_RIPEMD160 -ok - -MHASH_GOST -ok - -MHASH_TIGER -ok - -MHASH_CRC32 -ok - -MHASH_CRC32B -ok + $result = mhash_keygen_s2k(constant($hash), $passwd, $salt, 100); + if (!strcmp($result, $wanted)) { + echo "$hash\nok\n"; + } else { + echo "$hash: "; + var_dump(bin2hex($wanted)); + echo "$hash: "; + var_dump(bin2hex($result)); + } + echo "\n"; +} +?> +--EXPECT-- +MHASH_MD5 +ok + +MHASH_SHA1 +ok + +MHASH_HAVAL256 +ok + +MHASH_HAVAL224 +ok + +MHASH_HAVAL192 +ok + +MHASH_HAVAL160 +ok + +MHASH_RIPEMD160 +ok + +MHASH_GOST +ok + +MHASH_TIGER +ok + +MHASH_CRC32 +ok + +MHASH_CRC32B +ok Index: php4/ext/mhash/tests/001.phpt diff -u php4/ext/mhash/tests/001.phpt:1.2 php4/ext/mhash/tests/001.phpt:1.3 --- php4/ext/mhash/tests/001.phpt:1.2 Fri Nov 22 09:07:29 2002 +++ php4/ext/mhash/tests/001.phpt Thu Nov 28 09:13:44 2002 @@ -18,7 +18,7 @@ "MHASH_HAVAL160" => "ƳouWi\"q{", "MHASH_RIPEMD160" => "lGCZYķƯF4\x0C>XX=", "MHASH_GOST" => "\x0A%Rν|QGUC)5,-", -"MHASH_TIGER" => ":y\x01둮 ~g9\\T0\x0D", +"MHASH_TIGER" => "y:g~ 0T\9", "MHASH_CRC32" => "", "MHASH_CRC32B" => "Z" );
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php