note
loofort
I'm not sure that example brings any clearence.
I'm not the author and I use it as black box.
here is little part::
<c>
for ($h = 16; $h < 80; $h++) {
$i[$h] = a2 ($i[$h - 3] ^ $i[$h - 8] ^ $i[$h - 14] ^ $i[$h - 16], 1);
}
sub a2 {
my ($b, $a) = @_;
my $c = $b >> 32 - $a;
my $e = (1 << 32 - $a) - 1;
my $d = $b & $e;
return tos($d << $a | $c);
}
sub tos {
my ($num) = @_;
$num = $num - 4294967296 if $num > 4294967295;
$num = $num + 4294967296 if $num < -2147483648;
if ($num >= 0) {
$num = $num - 2 ** 32 if ($num >> 31);
}
return $num;
}
</c>
947353
947355