#!/usr/local/bin/perl
-\r
-$L="edi";\r
-$R="esi";\r
-\r
-sub des_encrypt3\r
- {\r
- local($name,$enc)=@_;\r
-\r
- &function_begin($name,4,"");\r
-\r
- &comment("");\r
- &comment("Load the data words");\r
- &mov("ebx",&wparam(0));\r
- &mov($L,&DWP(0,"ebx","",0));\r
- &mov($R,&DWP(4,"ebx","",0));\r
-\r
- &comment("");\r
- &comment("IP");\r
- &IP_new($L,$R,"edx",0);\r
-\r
- # put them back\r
- \r
- if ($enc)\r
- {\r
- &mov(&DWP(4,"ebx","",0),$R);\r
- &mov("eax",&wparam(1));\r
- &mov(&DWP(0,"ebx","",0),"edx");\r
- &mov("edi",&wparam(2));\r
- &mov("esi",&wparam(3));\r
- }\r
- else\r
- {\r
- &mov(&DWP(4,"ebx","",0),$R);\r
- &mov("esi",&wparam(1));\r
- &mov(&DWP(0,"ebx","",0),"edx");\r
- &mov("edi",&wparam(2));\r
- &mov("eax",&wparam(3));\r
- }\r
- &push(($enc)?"1":"0");\r
- &push("eax");\r
- &push("ebx");\r
- &call("des_encrypt2");\r
- &push(($enc)?"0":"1");\r
- &push("edi");\r
- &push("ebx");\r
- &call("des_encrypt2");\r
- &push(($enc)?"1":"0");\r
- &push("esi");\r
- &push("ebx");\r
- &call("des_encrypt2");\r
-\r
- &mov($L,&DWP(0,"ebx","",0));\r
- &add("esp",36);\r
- &mov($R,&DWP(4,"ebx","",0));\r
-\r
- &comment("");\r
- &comment("FP");\r
- &FP_new($L,$R,"eax",0);\r
-\r
- &mov(&DWP(0,"ebx","",0),"eax");\r
- &mov(&DWP(4,"ebx","",0),$R);\r
-\r
- &function_end($name);\r
- }\r
-\r
-\r
+
+$L="edi";
+$R="esi";
+
+sub DES_encrypt3
+ {
+ local($name,$enc)=@_;
+
+ &function_begin_B($name,"");
+ &push("ebx");
+ &mov("ebx",&wparam(0));
+
+ &push("ebp");
+ &push("esi");
+
+ &push("edi");
+
+ &comment("");
+ &comment("Load the data words");
+ &mov($L,&DWP(0,"ebx","",0));
+ &mov($R,&DWP(4,"ebx","",0));
+ &stack_push(3);
+
+ &comment("");
+ &comment("IP");
+ &IP_new($L,$R,"edx",0);
+
+ # put them back
+
+ if ($enc)
+ {
+ &mov(&DWP(4,"ebx","",0),$R);
+ &mov("eax",&wparam(1));
+ &mov(&DWP(0,"ebx","",0),"edx");
+ &mov("edi",&wparam(2));
+ &mov("esi",&wparam(3));
+ }
+ else
+ {
+ &mov(&DWP(4,"ebx","",0),$R);
+ &mov("esi",&wparam(1));
+ &mov(&DWP(0,"ebx","",0),"edx");
+ &mov("edi",&wparam(2));
+ &mov("eax",&wparam(3));
+ }
+ &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
+ &mov(&swtmp(1), "eax");
+ &mov(&swtmp(0), "ebx");
+ &call("DES_encrypt2");
+ &mov(&swtmp(2), (DWC(($enc)?"0":"1")));
+ &mov(&swtmp(1), "edi");
+ &mov(&swtmp(0), "ebx");
+ &call("DES_encrypt2");
+ &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
+ &mov(&swtmp(1), "esi");
+ &mov(&swtmp(0), "ebx");
+ &call("DES_encrypt2");
+
+ &stack_pop(3);
+ &mov($L,&DWP(0,"ebx","",0));
+ &mov($R,&DWP(4,"ebx","",0));
+
+ &comment("");
+ &comment("FP");
+ &FP_new($L,$R,"eax",0);
+
+ &mov(&DWP(0,"ebx","",0),"eax");
+ &mov(&DWP(4,"ebx","",0),$R);
+
+ &pop("edi");
+ &pop("esi");
+ &pop("ebp");
+ &pop("ebx");
+ &ret();
+ &function_end_B($name);
+ }
+
+