cast-586.pl revision 7c478bd95313f5f23a4c958a745db2134aa03244
# define for pentium pro friendly version
$ppro=1;
require "x86asm.pl";
require "cbc.pl";
$CAST_ROUNDS=16;
$L="edi";
$R="esi";
$K="ebp";
$tmp1="ecx";
$tmp2="ebx";
$tmp3="eax";
$tmp4="edx";
$S1="CAST_S_table0";
$S2="CAST_S_table1";
$S3="CAST_S_table2";
$S4="CAST_S_table3";
&asm_finish();
sub CAST_encrypt {
local($win_ex)=<<"EOF";
"CAST_S_table0",
"CAST_S_table1",
"CAST_S_table2",
"CAST_S_table3",
);
&comment("");
&push("ebp");
&push("ebx");
&push("esi");
&push("edi");
&comment("Load the 2 words");
&comment('Get short key flag');
if($enc) {
} else {
}
# encrypting part
if ($enc) {
&comment('test short key flag');
} else {
&set_label('cast_dec_skip');
}
# Why the nop? - Ben 17/1/99
&nop();
&function_end($name);
}
sub E_CAST {
# Ri needs to have 16 pre added.
&comment("round $i");
if ($ppro) {
} else {
}
# XXX
# XXX
}