bf-586.pl revision 7c478bd95313f5f23a4c958a745db2134aa03244
require "x86asm.pl";
require "cbc.pl";
$BF_ROUNDS=16;
$L="edi";
$R="esi";
$P="ebp";
$tmp1="eax";
$tmp2="ebx";
$tmp3="ecx";
$tmp4="edx";
&asm_finish();
sub BF_encrypt
{
&comment("");
&push("ebp");
&push("ebx");
&push("esi");
&push("edi");
&comment("Load the 2 words");
# encrypting part
if ($enc)
{
{
&comment("");
&comment("Round $i");
&comment("");
}
# &mov($tmp1,&wparam(0)); In last loop
}
else
{
{
&comment("");
&comment("Round $i");
&comment("");
}
# &mov($tmp1,&wparam(0)); In last loop
}
&function_end($name);
}
sub BF_ENCRYPT
{
else
{
&comment("Load parameter 0 ($i) enc=$enc");
} # In last loop
# delay
}
sub n2a
{
sprintf("%d",$_[0]);
}