mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
Rename des_SPtrans to DES_SPtrans to differentiate from libdes and avoid certain linkage clashes.
This commit is contained in:
parent
5c5143de48
commit
3bac6d9479
@ -14,7 +14,7 @@ require "x86asm.pl";
|
||||
$L="edi";
|
||||
$R="esi";
|
||||
|
||||
&external_label("des_SPtrans");
|
||||
&external_label("DES_SPtrans");
|
||||
&fcrypt_body("fcrypt_body");
|
||||
&asm_finish();
|
||||
|
||||
@ -22,7 +22,7 @@ sub fcrypt_body
|
||||
{
|
||||
local($name,$do_ip)=@_;
|
||||
|
||||
&function_begin($name,"EXTRN _des_SPtrans:DWORD");
|
||||
&function_begin($name,"EXTRN _DES_SPtrans:DWORD");
|
||||
|
||||
&comment("");
|
||||
&comment("Load the 2 words");
|
||||
@ -39,11 +39,11 @@ sub fcrypt_body
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$ks,"des_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i+1));
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$ks,"des_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
}
|
||||
&mov("ebx", &swtmp(0));
|
||||
&mov("eax", $L);
|
||||
|
@ -19,7 +19,7 @@ require "desboth.pl";
|
||||
$L="edi";
|
||||
$R="esi";
|
||||
|
||||
&external_label("des_SPtrans");
|
||||
&external_label("DES_SPtrans");
|
||||
&DES_encrypt("DES_encrypt1",1);
|
||||
&DES_encrypt("DES_encrypt2",0);
|
||||
&DES_encrypt3("DES_encrypt3",1);
|
||||
@ -33,7 +33,7 @@ sub DES_encrypt
|
||||
{
|
||||
local($name,$do_ip)=@_;
|
||||
|
||||
&function_begin_B($name,"EXTRN _des_SPtrans:DWORD");
|
||||
&function_begin_B($name,"EXTRN _DES_SPtrans:DWORD");
|
||||
|
||||
&push("esi");
|
||||
&push("edi");
|
||||
@ -80,11 +80,11 @@ sub DES_encrypt
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$ks,"des_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i,$L,$R,$i*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i+1));
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$ks,"des_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT($i+1,$R,$L,($i+1)*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
}
|
||||
&jmp(&label("end"));
|
||||
|
||||
@ -94,10 +94,10 @@ sub DES_encrypt
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT(15-$i,$L,$R,$i*2,$ks,"des_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT(15-$i,$L,$R,$i*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i-1));
|
||||
&D_ENCRYPT(15-$i+1,$R,$L,($i-1)*2,$ks,"des_SPtrans","eax","ebx","ecx","edx");
|
||||
&D_ENCRYPT(15-$i+1,$R,$L,($i-1)*2,$ks,"DES_SPtrans","eax","ebx","ecx","edx");
|
||||
}
|
||||
|
||||
&set_label("end");
|
||||
|
@ -58,7 +58,7 @@ sub DES_encrypt
|
||||
{
|
||||
local($name,$do_ip)=@_;
|
||||
|
||||
&function_begin($name,"EXTRN _des_SPtrans:DWORD");
|
||||
&function_begin($name,"EXTRN _DES_SPtrans:DWORD");
|
||||
|
||||
&comment("");
|
||||
&comment("Load the 2 words");
|
||||
@ -94,11 +94,11 @@ sub DES_encrypt
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT($L,$R,$i*2,"ebp","des_SPtrans","ecx","edx","eax","ebx");
|
||||
&D_ENCRYPT($L,$R,$i*2,"ebp","DES_SPtrans","ecx","edx","eax","ebx");
|
||||
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i+1));
|
||||
&D_ENCRYPT($R,$L,($i+1)*2,"ebp","des_SPtrans","ecx","edx","eax","ebx");
|
||||
&D_ENCRYPT($R,$L,($i+1)*2,"ebp","DES_SPtrans","ecx","edx","eax","ebx");
|
||||
}
|
||||
&jmp(&label("end"));
|
||||
|
||||
@ -108,10 +108,10 @@ sub DES_encrypt
|
||||
{
|
||||
&comment("");
|
||||
&comment("Round $i");
|
||||
&D_ENCRYPT($L,$R,$i*2,"ebp","des_SPtrans","ecx","edx","eax","ebx");
|
||||
&D_ENCRYPT($L,$R,$i*2,"ebp","DES_SPtrans","ecx","edx","eax","ebx");
|
||||
&comment("");
|
||||
&comment("Round ".sprintf("%d",$i-1));
|
||||
&D_ENCRYPT($R,$L,($i-1)*2,"ebp","des_SPtrans","ecx","edx","eax","ebx");
|
||||
&D_ENCRYPT($R,$L,($i-1)*2,"ebp","DES_SPtrans","ecx","edx","eax","ebx");
|
||||
}
|
||||
|
||||
&set_label("end");
|
||||
|
@ -62,7 +62,7 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
|
||||
{
|
||||
register DES_LONG l,r,t,u;
|
||||
#ifdef DES_PTR
|
||||
register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
|
||||
register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
|
||||
#endif
|
||||
#ifndef DES_UNROLL
|
||||
register int i;
|
||||
@ -75,7 +75,7 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
|
||||
IP(r,l);
|
||||
/* Things have been modified so that the initial rotate is
|
||||
* done outside the loop. This required the
|
||||
* des_SPtrans values in sp.h to be rotated 1 bit to the right.
|
||||
* DES_SPtrans values in sp.h to be rotated 1 bit to the right.
|
||||
* One perl script later and things have a 5% speed up on a sparc2.
|
||||
* Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
|
||||
* for pointing this out. */
|
||||
@ -160,7 +160,7 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
|
||||
{
|
||||
register DES_LONG l,r,t,u;
|
||||
#ifdef DES_PTR
|
||||
register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
|
||||
register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
|
||||
#endif
|
||||
#ifndef DES_UNROLL
|
||||
register int i;
|
||||
@ -172,7 +172,7 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
|
||||
|
||||
/* Things have been modified so that the initial rotate is
|
||||
* done outside the loop. This required the
|
||||
* des_SPtrans values in sp.h to be rotated 1 bit to the right.
|
||||
* DES_SPtrans values in sp.h to be rotated 1 bit to the right.
|
||||
* One perl script later and things have a 5% speed up on a sparc2.
|
||||
* Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
|
||||
* for pointing this out. */
|
||||
|
@ -283,24 +283,24 @@
|
||||
u1=(int)u&0x3f; \
|
||||
u2&=0x3f; \
|
||||
u>>=16L; \
|
||||
LL^=des_SPtrans[0][u1]; \
|
||||
LL^=des_SPtrans[2][u2]; \
|
||||
LL^=DES_SPtrans[0][u1]; \
|
||||
LL^=DES_SPtrans[2][u2]; \
|
||||
u3=(int)u>>8L; \
|
||||
u1=(int)u&0x3f; \
|
||||
u3&=0x3f; \
|
||||
LL^=des_SPtrans[4][u1]; \
|
||||
LL^=des_SPtrans[6][u3]; \
|
||||
LL^=DES_SPtrans[4][u1]; \
|
||||
LL^=DES_SPtrans[6][u3]; \
|
||||
u2=(int)t>>8L; \
|
||||
u1=(int)t&0x3f; \
|
||||
u2&=0x3f; \
|
||||
t>>=16L; \
|
||||
LL^=des_SPtrans[1][u1]; \
|
||||
LL^=des_SPtrans[3][u2]; \
|
||||
LL^=DES_SPtrans[1][u1]; \
|
||||
LL^=DES_SPtrans[3][u2]; \
|
||||
u3=(int)t>>8L; \
|
||||
u1=(int)t&0x3f; \
|
||||
u3&=0x3f; \
|
||||
LL^=des_SPtrans[5][u1]; \
|
||||
LL^=des_SPtrans[7][u3]; }
|
||||
LL^=DES_SPtrans[5][u1]; \
|
||||
LL^=DES_SPtrans[7][u3]; }
|
||||
#endif
|
||||
#ifdef DES_RISC2
|
||||
#define D_ENCRYPT(LL,R,S) {\
|
||||
@ -311,25 +311,25 @@
|
||||
u2=(int)u>>8L; \
|
||||
u1=(int)u&0x3f; \
|
||||
u2&=0x3f; \
|
||||
LL^=des_SPtrans[0][u1]; \
|
||||
LL^=des_SPtrans[2][u2]; \
|
||||
LL^=DES_SPtrans[0][u1]; \
|
||||
LL^=DES_SPtrans[2][u2]; \
|
||||
s1=(int)u>>16L; \
|
||||
s2=(int)u>>24L; \
|
||||
s1&=0x3f; \
|
||||
s2&=0x3f; \
|
||||
LL^=des_SPtrans[4][s1]; \
|
||||
LL^=des_SPtrans[6][s2]; \
|
||||
LL^=DES_SPtrans[4][s1]; \
|
||||
LL^=DES_SPtrans[6][s2]; \
|
||||
u2=(int)t>>8L; \
|
||||
u1=(int)t&0x3f; \
|
||||
u2&=0x3f; \
|
||||
LL^=des_SPtrans[1][u1]; \
|
||||
LL^=des_SPtrans[3][u2]; \
|
||||
LL^=DES_SPtrans[1][u1]; \
|
||||
LL^=DES_SPtrans[3][u2]; \
|
||||
s1=(int)t>>16; \
|
||||
s2=(int)t>>24L; \
|
||||
s1&=0x3f; \
|
||||
s2&=0x3f; \
|
||||
LL^=des_SPtrans[5][s1]; \
|
||||
LL^=des_SPtrans[7][s2]; }
|
||||
LL^=DES_SPtrans[5][s1]; \
|
||||
LL^=DES_SPtrans[7][s2]; }
|
||||
#endif
|
||||
|
||||
#else
|
||||
@ -338,14 +338,14 @@
|
||||
LOAD_DATA_tmp(R,S,u,t,E0,E1); \
|
||||
t=ROTATE(t,4); \
|
||||
LL^=\
|
||||
des_SPtrans[0][(u>> 2L)&0x3f]^ \
|
||||
des_SPtrans[2][(u>>10L)&0x3f]^ \
|
||||
des_SPtrans[4][(u>>18L)&0x3f]^ \
|
||||
des_SPtrans[6][(u>>26L)&0x3f]^ \
|
||||
des_SPtrans[1][(t>> 2L)&0x3f]^ \
|
||||
des_SPtrans[3][(t>>10L)&0x3f]^ \
|
||||
des_SPtrans[5][(t>>18L)&0x3f]^ \
|
||||
des_SPtrans[7][(t>>26L)&0x3f]; }
|
||||
DES_SPtrans[0][(u>> 2L)&0x3f]^ \
|
||||
DES_SPtrans[2][(u>>10L)&0x3f]^ \
|
||||
DES_SPtrans[4][(u>>18L)&0x3f]^ \
|
||||
DES_SPtrans[6][(u>>26L)&0x3f]^ \
|
||||
DES_SPtrans[1][(t>> 2L)&0x3f]^ \
|
||||
DES_SPtrans[3][(t>>10L)&0x3f]^ \
|
||||
DES_SPtrans[5][(t>>18L)&0x3f]^ \
|
||||
DES_SPtrans[7][(t>>26L)&0x3f]; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -410,7 +410,7 @@
|
||||
PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
|
||||
}
|
||||
|
||||
OPENSSL_EXTERN const DES_LONG des_SPtrans[8][64];
|
||||
OPENSSL_EXTERN const DES_LONG DES_SPtrans[8][64];
|
||||
|
||||
void fcrypt_body(DES_LONG *out,DES_key_schedule *ks,
|
||||
DES_LONG Eswap0, DES_LONG Eswap1);
|
||||
|
@ -82,7 +82,7 @@ void fcrypt_body(DES_LONG *out, DES_key_schedule *ks, DES_LONG Eswap0,
|
||||
{
|
||||
register DES_LONG l,r,t,u;
|
||||
#ifdef DES_PTR
|
||||
register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
|
||||
register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
|
||||
#endif
|
||||
register DES_LONG *s;
|
||||
register int j;
|
||||
|
@ -56,7 +56,7 @@
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
OPENSSL_GLOBAL const DES_LONG des_SPtrans[8][64]={
|
||||
OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64]={
|
||||
{
|
||||
/* nibble 0 */
|
||||
0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L,
|
||||
|
Loading…
Reference in New Issue
Block a user