aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/des/asm/desboth.pl
diff options
context:
space:
mode:
authorRalf S. Engelschall <rse@openssl.org>1998-12-21 10:52:47 +0000
committerRalf S. Engelschall <rse@openssl.org>1998-12-21 10:52:47 +0000
commitd02b48c63a58ea4367a0e905979f140b7d090f86 (patch)
tree504f62ed3d84799f785b9cd9fab255a21b0e1b0e /crypto/des/asm/desboth.pl
downloadopenssl-d02b48c63a58ea4367a0e905979f140b7d090f86.tar.gz
Import of old SSLeay release: SSLeay 0.8.1b
Diffstat (limited to 'crypto/des/asm/desboth.pl')
-rw-r--r--crypto/des/asm/desboth.pl67
1 files changed, 67 insertions, 0 deletions
diff --git a/crypto/des/asm/desboth.pl b/crypto/des/asm/desboth.pl
new file mode 100644
index 0000000000..b94138ce63
--- /dev/null
+++ b/crypto/des/asm/desboth.pl
@@ -0,0 +1,67 @@
+#!/usr/local/bin/perl
+
+$L="edi";
+$R="esi";
+
+sub des_encrypt3
+ {
+ local($name,$enc)=@_;
+
+ &function_begin($name,4,"");
+
+ &comment("");
+ &comment("Load the data words");
+ &mov("ebx",&wparam(0));
+ &mov($L,&DWP(0,"ebx","",0));
+ &mov($R,&DWP(4,"ebx","",0));
+
+ &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));
+ }
+ &push(($enc)?"1":"0");
+ &push("eax");
+ &push("ebx");
+ &call("des_encrypt2");
+ &push(($enc)?"0":"1");
+ &push("edi");
+ &push("ebx");
+ &call("des_encrypt2");
+ &push(($enc)?"1":"0");
+ &push("esi");
+ &push("ebx");
+ &call("des_encrypt2");
+
+ &mov($L,&DWP(0,"ebx","",0));
+ &add("esp",36);
+ &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);
+
+ &function_end($name);
+ }
+
+