Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
6f7ac8e1
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6f7ac8e1
编写于
12月 13, 2002
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IA-32 assembler modules (primarily DES) PIC-ification. Idea is to keep
shared libraries shared.
上级
a1457874
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
118 addition
and
79 deletion
+118
-79
Configure
Configure
+10
-9
crypto/des/Makefile.ssl
crypto/des/Makefile.ssl
+12
-4
crypto/des/asm/crypt586.pl
crypto/des/asm/crypt586.pl
+24
-21
crypto/des/asm/des-586.pl
crypto/des/asm/des-586.pl
+23
-26
crypto/perlasm/cbc.pl
crypto/perlasm/cbc.pl
+24
-17
crypto/perlasm/x86ms.pl
crypto/perlasm/x86ms.pl
+2
-0
crypto/perlasm/x86nasm.pl
crypto/perlasm/x86nasm.pl
+2
-0
crypto/perlasm/x86unix.pl
crypto/perlasm/x86unix.pl
+21
-2
未找到文件。
Configure
浏览文件 @
6f7ac8e1
...
...
@@ -1104,6 +1104,11 @@ if ($no_asm)
$sha1_obj=$md5_obj=$rmd160_obj="";
}
if (!$no_shared)
{
$cast_obj=""; # CAST assembler is not PIC
}
if ($threads)
{
$cflags=$thread_cflags;
...
...
@@ -1119,20 +1124,16 @@ if ($zlib)
# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
my $shared_mark = "";
if ($shared_target ne "")
if ($shared_target eq "")
{
$no_shared = 1;
}
if (!$no_shared)
{
if ($shared_cflag ne "")
{
$cflags = "$shared_cflag $cflags";
}
if (!$no_shared)
{
#$shared_mark = "\$(SHARED_LIBS)";
}
}
else
{
$no_shared = 1;
}
if ($no_shared)
...
...
crypto/des/Makefile.ssl
浏览文件 @
6f7ac8e1
...
...
@@ -67,19 +67,27 @@ des: des.o cbc3_enc.o lib
# elf
asm/dx86-elf.o
:
asm/dx86unix.cpp
$(CPP)
-DELF
-x
c asm/dx86unix.cpp | as
-o
asm/dx86-elf.o
$(CPP)
-DELF
\
`
(
echo
$(CFLAGS)
| egrep
-ie
'-[fK]PIC'
)
>
/dev/null 2>&1
&&
echo
-DPIC
`
\
-x
c asm/dx86unix.cpp | as
-o
asm/dx86-elf.o
asm/yx86-elf.o
:
asm/yx86unix.cpp
$(CPP)
-DELF
-x
c asm/yx86unix.cpp | as
-o
asm/yx86-elf.o
$(CPP)
-DELF
\
`
(
echo
$(CFLAGS)
| egrep
-ie
'-[fK]PIC'
)
>
/dev/null 2>&1
&&
echo
-DPIC
`
\
-x
c asm/yx86unix.cpp | as
-o
asm/yx86-elf.o
# solaris
asm/dx86-sol.o
:
asm/dx86unix.cpp
$(CC)
-E
-DSOL
asm/dx86unix.cpp |
sed
's/^#.*//'
>
asm/dx86-sol.s
$(CC)
-E
-DSOL
\
`
(
echo
$(CFLAGS)
| egrep
-ie
'-[fK]PIC'
)
>
/dev/null 2>&1
&&
echo
-DPIC
`
\
asm/dx86unix.cpp |
sed
's/^#.*//'
>
asm/dx86-sol.s
as
-o
asm/dx86-sol.o asm/dx86-sol.s
rm
-f
asm/dx86-sol.s
asm/yx86-sol.o
:
asm/yx86unix.cpp
$(CC)
-E
-DSOL
asm/yx86unix.cpp |
sed
's/^#.*//'
>
asm/yx86-sol.s
$(CC)
-E
-DSOL
\
`
(
echo
$(CFLAGS)
| egrep
-ie
'-[fK]PIC'
)
>
/dev/null 2>&1
&&
echo
-DPIC
`
\
asm/yx86unix.cpp |
sed
's/^#.*//'
>
asm/yx86-sol.s
as
-o
asm/yx86-sol.o asm/yx86-sol.s
rm
-f
asm/yx86-sol.s
...
...
crypto/des/asm/crypt586.pl
浏览文件 @
6f7ac8e1
...
...
@@ -26,11 +26,17 @@ sub fcrypt_body
&comment
("");
&comment
("
Load the 2 words
");
$
k
s
=
"
ebp
";
$
tran
s
=
"
ebp
";
&xor
(
$L
,
$L
);
&xor
(
$R
,
$R
);
&mov
(
$ks
,
&wparam
(
1
));
# PIC-ification:-)
if
(
$cpp
)
{
&picmeup
("
edx
","
DES_SPtrans
");
}
else
{
&lea
("
edx
",
&DWP
("
DES_SPtrans
"));
}
&push
("
edx
");
# becomes &swtmp(1)
#
&mov
(
$trans
,
&wparam
(
1
));
# reloaded with DES_SPtrans in D_ENCRYPT
&push
(
&DWC
(
25
));
# add a variable
...
...
@@ -39,11 +45,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
,
$
trans
,"
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
,
$
trans
,"
eax
","
ebx
","
ecx
","
edx
");
}
&mov
("
ebx
",
&swtmp
(
0
));
&mov
("
eax
",
$L
);
...
...
@@ -61,14 +67,14 @@ sub fcrypt_body
&mov
(
&DWP
(
0
,"
edx
","",
0
),"
eax
");
&mov
(
&DWP
(
4
,"
edx
","",
0
),
$L
);
&
pop
("
ecx
");
# remove variable
&
add
("
esp
",
8
);
# remove variables
&function_end
(
$name
);
}
sub
D_ENCRYPT
{
local
(
$r
,
$L
,
$R
,
$S
,
$
ks
,
$desSP
,
$u
,
$tmp1
,
$tmp2
,
$t
)
=
@_
;
local
(
$r
,
$L
,
$R
,
$S
,
$
trans
,
$u
,
$tmp1
,
$tmp2
,
$t
)
=
@_
;
&mov
(
$u
,
&wparam
(
2
));
# 2
&mov
(
$t
,
$R
);
...
...
@@ -85,9 +91,9 @@ sub D_ENCRYPT
&shl
(
$tmp2
,
16
);
# 1
&xor
(
$u
,
$tmp1
);
# 2
&xor
(
$t
,
$tmp2
);
# 2
&mov
(
$tmp1
,
&DWP
(
&n2a
(
$S
*
4
),
$
k
s
,"",
0
));
# 2
&mov
(
$tmp1
,
&DWP
(
&n2a
(
$S
*
4
),
$
tran
s
,"",
0
));
# 2
&xor
(
$u
,
$tmp1
);
&mov
(
$tmp2
,
&DWP
(
&n2a
((
$S
+
1
)
*
4
),
$
k
s
,"",
0
));
# 2
&mov
(
$tmp2
,
&DWP
(
&n2a
((
$S
+
1
)
*
4
),
$
tran
s
,"",
0
));
# 2
&xor
(
$u
,
$R
);
&xor
(
$t
,
$R
);
&xor
(
$t
,
$tmp2
);
...
...
@@ -99,31 +105,28 @@ sub D_ENCRYPT
&movb
(
&LB
(
$tmp1
),
&LB
(
$u
)
);
&movb
(
&LB
(
$tmp2
),
&HB
(
$u
)
);
&rotr
(
$t
,
4
);
&mov
(
$ks
,
&DWP
("
$desSP
",
$tmp1
,"",
0
));
&mov
(
$trans
,
&swtmp
(
1
));
&xor
(
$L
,
&DWP
("
",
$trans
,
$tmp1
,
0
));
&movb
(
&LB
(
$tmp1
),
&LB
(
$t
)
);
&xor
(
$L
,
$ks
);
&mov
(
$ks
,
&DWP
("
0x200+
$desSP
",
$tmp2
,"",
0
));
&xor
(
$L
,
$ks
);
&xor
(
$L
,
&DWP
("
0x200
",
$trans
,
$tmp2
,
0
));
&movb
(
&LB
(
$tmp2
),
&HB
(
$t
)
);
&shr
(
$u
,
16
);
&mov
(
$ks
,
&DWP
("
0x100+
$desSP
",
$tmp1
,"",
0
));
&xor
(
$L
,
$ks
);
&xor
(
$L
,
&DWP
("
0x100
",
$trans
,
$tmp1
,
0
));
&movb
(
&LB
(
$tmp1
),
&HB
(
$u
)
);
&shr
(
$t
,
16
);
&mov
(
$ks
,
&DWP
("
0x300+
$desSP
",
$tmp2
,"",
0
));
&xor
(
$L
,
$ks
);
&mov
(
$ks
,
&wparam
(
1
));
&xor
(
$L
,
&DWP
("
0x300
",
$trans
,
$tmp2
,
0
));
&movb
(
&LB
(
$tmp2
),
&HB
(
$t
)
);
&and
(
$u
,
"
0xff
"
);
&and
(
$t
,
"
0xff
"
);
&mov
(
$tmp1
,
&DWP
("
0x600
+
$desSP
",
$tmp1
,""
,
0
));
&mov
(
$tmp1
,
&DWP
("
0x600
",
$trans
,
$tmp1
,
0
));
&xor
(
$L
,
$tmp1
);
&mov
(
$tmp1
,
&DWP
("
0x700
+
$desSP
",
$tmp2
,""
,
0
));
&mov
(
$tmp1
,
&DWP
("
0x700
",
$trans
,
$tmp2
,
0
));
&xor
(
$L
,
$tmp1
);
&mov
(
$tmp1
,
&DWP
("
0x400
+
$desSP
",
$u
,""
,
0
));
&mov
(
$tmp1
,
&DWP
("
0x400
",
$trans
,
$u
,
0
));
&xor
(
$L
,
$tmp1
);
&mov
(
$tmp1
,
&DWP
("
0x500
+
$desSP
",
$t
,""
,
0
));
&mov
(
$tmp1
,
&DWP
("
0x500
",
$trans
,
$t
,
0
));
&xor
(
$L
,
$tmp1
);
&mov
(
$trans
,
&wparam
(
1
));
}
sub
n2a
...
...
crypto/des/asm/des-586.pl
浏览文件 @
6f7ac8e1
...
...
@@ -40,7 +40,7 @@ sub DES_encrypt
&comment
("");
&comment
("
Load the 2 words
");
$
k
s
=
"
ebp
";
$
tran
s
=
"
ebp
";
if
(
$do_ip
)
{
...
...
@@ -72,7 +72,11 @@ sub DES_encrypt
&rotl
(
$L
,
3
);
}
&mov
(
$ks
,
&wparam
(
1
)
);
# PIC-ification:-)
if
(
$cpp
)
{
&picmeup
(
$trans
,"
DES_SPtrans
");
}
else
{
&lea
(
$trans
,
&DWP
("
DES_SPtrans
"));
}
&mov
(
"
ecx
",
&wparam
(
1
)
);
&cmp
("
ebx
","
0
");
&je
(
&label
("
start_decrypt
"));
...
...
@@ -80,11 +84,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
,
$
trans
,"
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
,
$
trans
,"
eax
","
ebx
","
ecx
","
edx
");
}
&jmp
(
&label
("
end
"));
...
...
@@ -94,10 +98,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
,
$
trans
,"
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
,
$
trans
,"
eax
","
ebx
","
ecx
","
edx
");
}
&set_label
("
end
");
...
...
@@ -134,43 +138,36 @@ sub DES_encrypt
sub
D_ENCRYPT
{
local
(
$r
,
$L
,
$R
,
$S
,
$
ks
,
$desSP
,
$u
,
$tmp1
,
$tmp2
,
$t
)
=
@_
;
local
(
$r
,
$L
,
$R
,
$S
,
$
trans
,
$u
,
$tmp1
,
$tmp2
,
$t
)
=
@_
;
&mov
(
$u
,
&DWP
(
&n2a
(
$S
*
4
),
$
ks
,"",
0
));
&mov
(
$u
,
&DWP
(
&n2a
(
$S
*
4
),
$
tmp2
,"",
0
));
&xor
(
$tmp1
,
$tmp1
);
&mov
(
$t
,
&DWP
(
&n2a
((
$S
+
1
)
*
4
),
$
ks
,"",
0
));
&mov
(
$t
,
&DWP
(
&n2a
((
$S
+
1
)
*
4
),
$
tmp2
,"",
0
));
&xor
(
$u
,
$R
);
&xor
(
$tmp2
,
$tmp2
);
&xor
(
$t
,
$R
);
&and
(
$u
,
"
0xfcfcfcfc
"
);
&and
(
$t
,
"
0xcfcfcfcf
"
);
&movb
(
&LB
(
$tmp1
),
&LB
(
$u
)
);
&movb
(
&LB
(
$tmp2
),
&HB
(
$u
)
);
&rotr
(
$t
,
4
);
&
mov
(
$ks
,
&DWP
("
$desSP
",
$tmp1
,""
,
0
));
&
xor
(
$L
,
&DWP
("
",
$trans
,
$tmp1
,
0
));
&movb
(
&LB
(
$tmp1
),
&LB
(
$t
)
);
&xor
(
$L
,
$ks
);
&mov
(
$ks
,
&DWP
("
0x200+
$desSP
",
$tmp2
,"",
0
));
&xor
(
$L
,
$ks
);
######
&xor
(
$L
,
&DWP
("
0x200
",
$trans
,
$tmp2
,
0
));
&movb
(
&LB
(
$tmp2
),
&HB
(
$t
)
);
&shr
(
$u
,
16
);
&mov
(
$ks
,
&DWP
("
0x100+
$desSP
",
$tmp1
,"",
0
));
&xor
(
$L
,
$ks
);
######
&xor
(
$L
,
&DWP
("
0x100
",
$trans
,
$tmp1
,
0
));
&movb
(
&LB
(
$tmp1
),
&HB
(
$u
)
);
&shr
(
$t
,
16
);
&mov
(
$ks
,
&DWP
("
0x300+
$desSP
",
$tmp2
,"",
0
));
&xor
(
$L
,
$ks
);
&mov
(
$ks
,
&wparam
(
1
)
);
&xor
(
$L
,
&DWP
("
0x300
",
$trans
,
$tmp2
,
0
));
&movb
(
&LB
(
$tmp2
),
&HB
(
$t
)
);
&and
(
$u
,
"
0xff
"
);
&and
(
$t
,
"
0xff
"
);
&mov
(
$tmp1
,
&DWP
("
0x600+
$desSP
",
$tmp1
,"",
0
));
&xor
(
$L
,
$tmp1
);
&mov
(
$tmp1
,
&DWP
("
0x700+
$desSP
",
$tmp2
,"",
0
));
&xor
(
$L
,
$tmp1
);
&mov
(
$tmp1
,
&DWP
("
0x400+
$desSP
",
$u
,"",
0
));
&xor
(
$L
,
$tmp1
);
&mov
(
$tmp1
,
&DWP
("
0x500+
$desSP
",
$t
,"",
0
));
&xor
(
$L
,
$tmp1
);
&xor
(
$L
,
&DWP
("
0x600
",
$trans
,
$tmp1
,
0
));
&xor
(
$L
,
&DWP
("
0x700
",
$trans
,
$tmp2
,
0
));
&mov
(
$tmp2
,
&wparam
(
1
)
);
&xor
(
$L
,
&DWP
("
0x400
",
$trans
,
$u
,
0
));
&xor
(
$L
,
&DWP
("
0x500
",
$trans
,
$t
,
0
));
}
sub
n2a
...
...
crypto/perlasm/cbc.pl
浏览文件 @
6f7ac8e1
...
...
@@ -146,9 +146,15 @@ sub cbc
&mov
(
$count
,
&wparam
(
2
));
# length
&and
(
$count
,
7
);
&jz
(
&label
("
finish
"));
&call
(
&label
("
PIC_point
"));
&set_label
("
PIC_point
");
&blindpop
("
edx
");
&lea
("
ecx
",
&DWP
(
&label
("
cbc_enc_jmp_table
")
.
"
-
"
.
&label
("
PIC_point
"),"
edx
"));
&mov
(
$count
,
&DWP
(
0
,"
ecx
",
$count
,
4
))
&add
(
$count
,"
edx
");
&xor
("
ecx
","
ecx
");
&xor
("
edx
","
edx
");
&mov
(
$count
,
&DWP
(
&label
("
cbc_enc_jmp_table
"),"",
$count
,
4
));
#
&mov($count,&DWP(&label("cbc_enc_jmp_table"),"",$count,4));
&jmp_ptr
(
$count
);
&set_label
("
ej7
");
...
...
@@ -318,22 +324,23 @@ sub cbc
&set_label
("
cbc_enc_jmp_table
",
1
);
&data_word
("
0
");
&data_word
(
&label
("
ej1
"));
&data_word
(
&label
("
ej2
"));
&data_word
(
&label
("
ej3
"));
&data_word
(
&label
("
ej4
"));
&data_word
(
&label
("
ej5
"));
&data_word
(
&label
("
ej6
"));
&data_word
(
&label
("
ej7
"));
&set_label
("
cbc_dec_jmp_table
",
1
);
&data_word
("
0
");
&data_word
(
&label
("
dj1
"));
&data_word
(
&label
("
dj2
"));
&data_word
(
&label
("
dj3
"));
&data_word
(
&label
("
dj4
"));
&data_word
(
&label
("
dj5
"));
&data_word
(
&label
("
dj6
"));
&data_word
(
&label
("
dj7
"));
&data_word
(
&label
("
ej1
")
.
"
-
"
.
&label
("
PIC_point
"));
&data_word
(
&label
("
ej2
")
.
"
-
"
.
&label
("
PIC_point
"));
&data_word
(
&label
("
ej3
")
.
"
-
"
.
&label
("
PIC_point
"));
&data_word
(
&label
("
ej4
")
.
"
-
"
.
&label
("
PIC_point
"));
&data_word
(
&label
("
ej5
")
.
"
-
"
.
&label
("
PIC_point
"));
&data_word
(
&label
("
ej6
")
.
"
-
"
.
&label
("
PIC_point
"));
&data_word
(
&label
("
ej7
")
.
"
-
"
.
&label
("
PIC_point
"));
# not used
#&set_label("cbc_dec_jmp_table",1);
#&data_word("0");
#&data_word(&label("dj1")."-".&label("PIC_point"));
#&data_word(&label("dj2")."-".&label("PIC_point"));
#&data_word(&label("dj3")."-".&label("PIC_point"));
#&data_word(&label("dj4")."-".&label("PIC_point"));
#&data_word(&label("dj5")."-".&label("PIC_point"));
#&data_word(&label("dj6")."-".&label("PIC_point"));
#&data_word(&label("dj7")."-".&label("PIC_point"));
&function_end_B
(
$name
);
...
...
crypto/perlasm/x86ms.pl
浏览文件 @
6f7ac8e1
...
...
@@ -363,3 +363,5 @@ sub out1p
push
(
@out
,"
\t
$name
\t
"
.
&conv
(
$p1
)
.
"
\n
");
}
sub
main
'blindpop {
&out1
("
pop
",
@
_
);
}
crypto/perlasm/x86nasm.pl
浏览文件 @
6f7ac8e1
...
...
@@ -340,3 +340,5 @@ sub out1p
push
(
@out
,"
\t
$name
\t
"
.
&conv
(
$p1
)
.
"
\n
");
}
sub
main
'blindpop {
&out1
("
pop
",
@
_
);
}
crypto/perlasm/x86unix.pl
浏览文件 @
6f7ac8e1
...
...
@@ -87,12 +87,12 @@ sub main'DWP
$ret
.=
$addr
if
(
$addr
ne
"")
&&
(
$addr
ne
0
);
if
(
$reg2
ne
"")
{
if
(
$idx
ne
"")
if
(
$idx
ne
""
&&
$idx
!=
0
)
{
$ret
.=
"
(
$reg1
,
$reg2
,
$idx
)
";
}
else
{
$ret
.=
"
(
$reg1
,
$reg2
)
";
}
}
els
e
els
if
(
$reg1
ne
"")
{
$ret
.=
"
(
$reg1
)
"
}
return
(
$ret
);
}
...
...
@@ -542,3 +542,22 @@ sub popvars
&main
'
pop
("
edx
");
&main
'
popf();
}
sub main
'
picmeup
{
local
(
$dst
,
$sym
)
=
@_
;
local
(
$tmp
)
=
<<___;
#if (defined(ELF) || defined(SOL)) && defined(PIC)
.align 8
call 1f
1: popl $regs{$dst}
addl \$_GLOBAL_OFFSET_TABLE_+[.-1b],$regs{$dst}
movl $sym\@GOT($regs{$dst}),$regs{$dst}
#else
movl \$$sym,$regs{$dst}
#endif
___
push
(
@out
,
$tmp
);
}
sub
main
'blindpop {
&out1
("
popl
",
@
_
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录