Hi Guys,
I have a problem wich I hope has been solved by someone :-)
Here's the deal,
I have to convert a perl script to PHP trying to do so I get negative
values from hexdec(), If I use (int)hexdec() the numbers aren't negative
anymore, but they do not add up to what they should.
Here's the perl line:
$a = FF ($a, $b, $c, $d, $temparr[8],  $S11, hex("698098d8"));
this is PHP:
$a = FF ($a, $b, $c, $d, $temparr[8],  $S11, hexdec("698098d8"));
FF is a function:
function FF($a,$b,$c,$d,$x,$s,$ac)
         $a += F($b,$c,$d) + $x + $ac;
         if ($a > hexdec("ffffffff"))
                   $a = substr($a,strlen($a)-9,9) ;
         $a = RL($a,$s);
         $a += $b;
         return $a;
F is also a function:
function F($x, $y, $z)
         return ((($x) & ($y)) | ((~$x) & ($z)));
Could anybody tell me what I am missing here?

Reply via email to