Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
7a3240e3
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
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看板
提交
7a3240e3
编写于
11月 29, 2004
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Final touches to rc4/asm/rc4-596.pl, +52% better performance on AMD core.
上级
5022e4ec
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
16 deletion
+32
-16
crypto/rc4/asm/rc4-586.pl
crypto/rc4/asm/rc4-586.pl
+32
-16
未找到文件。
crypto/rc4/asm/rc4-586.pl
浏览文件 @
7a3240e3
#!/usr/local/bin/perl
#!/usr/local/bin/perl
# define for pentium pro friendly version
# At some point it became apparent that the original SSLeay RC4
# assembler implementation performs suboptimal on latest IA-32
# microarchitectures. After re-tuning performance has changed as
# following:
#
# Pentium +0%
# Pentium III +17%
# AMD +52%(*)
# P4 +180%(**)
#
# (*) This number is actually a trade-off:-) It's possible to
# achieve +72%, but at the cost of -48% off PIII performance.
# In other words code performing further 13% faster on AMD
# would perform almost 2 times slower on Intel PIII...
# For reference! This code delivers ~80% of rc4-amd64.pl
# performance on same Opteron machine.
# (**) This number requires compressed key schedule set up by
# RC4_set_key, see commentary section in rc4_skey.c for
# further details.
# <appro@fy.chalmers.se>
push
(
@INC
,"
perlasm
","
../../perlasm
");
push
(
@INC
,"
perlasm
","
../../perlasm
");
require
"
x86asm.pl
";
require
"
x86asm.pl
";
...
@@ -46,20 +65,16 @@ sub RC4_loop
...
@@ -46,20 +65,16 @@ sub RC4_loop
# Moved out
# Moved out
# &mov( $tx, &DWP(0,$d,$x,4)) if $p < 0;
# &mov( $tx, &DWP(0,$d,$x,4)) if $p < 0;
&add
(
$y
,
$tx
);
&add
(
&LB
(
$y
),
&LB
(
$tx
));
&and
(
$y
,
0xff
);
&inc
(
&LB
(
$x
));
# NEXT ROUND
&inc
(
$x
);
# NEXT ROUND
&mov
(
$ty
,
&DWP
(
0
,
$d
,
$y
,
4
));
&mov
(
$ty
,
&DWP
(
0
,
$d
,
$y
,
4
));
# XXX
# XXX
&mov
(
&DWP
(
-
4
,
$d
,
$x
,
4
),
$ty
);
# AGI
&mov
(
&DWP
(
-
4
,
$d
,
$x
,
4
),
$ty
);
# AGI
&add
(
$ty
,
$tx
);
&add
(
$ty
,
$tx
);
&and
(
$x
,
0xff
);
# NEXT ROUND
&and
(
$ty
,
0xff
);
&mov
(
&DWP
(
0
,
$d
,
$y
,
4
),
$tx
);
&mov
(
&DWP
(
0
,
$d
,
$y
,
4
),
$tx
);
&nop
();
&and
(
$ty
,
0xff
);
&mov
(
$ty
,
&DWP
(
0
,
$d
,
$ty
,
4
));
&mov
(
$tx
,
&DWP
(
0
,
$d
,
$x
,
4
))
if
$p
<
1
;
# NEXT ROUND
&mov
(
$tx
,
&DWP
(
0
,
$d
,
$x
,
4
))
if
$p
<
1
;
# NEXT ROUND
&mov
(
$ty
,
&DWP
(
0
,
$d
,
$ty
,
4
));
# XXX
if
(
!
$char
)
if
(
!
$char
)
{
{
...
@@ -99,19 +114,20 @@ sub RC4
...
@@ -99,19 +114,20 @@ sub RC4
&push
("
ebp
");
&push
("
ebp
");
&push
("
ebx
");
&push
("
ebx
");
&push
("
esi
");
&push
("
esi
");
&push
("
edi
");
&xor
(
$x
,
$x
);
# avoid partial register stalls
&push
("
edi
");
&xor
(
$y
,
$y
);
# avoid partial register stalls
&mov
(
$d
,
&wparam
(
0
));
# key
&mov
(
$d
,
&wparam
(
0
));
# key
&mov
(
$in
,
&wparam
(
2
));
&mov
(
$in
,
&wparam
(
2
));
&mov
(
$x
,
&DW
P
(
0
,
$d
,"",
1
));
&mov
b
(
&LB
(
$x
),
&B
P
(
0
,
$d
,"",
1
));
&mov
(
$y
,
&DW
P
(
4
,
$d
,"",
1
));
&mov
b
(
&LB
(
$y
),
&B
P
(
4
,
$d
,"",
1
));
&mov
(
$out
,
&wparam
(
3
));
&mov
(
$out
,
&wparam
(
3
));
&inc
(
$x
);
&inc
(
&LB
(
$x
)
);
&stack_push
(
3
);
# 3 temp variables
&stack_push
(
3
);
# 3 temp variables
&add
(
$d
,
8
);
&add
(
$d
,
8
);
&and
(
$x
,
0xff
);
# detect compressed schedule, see commentary section in rc4_skey.c...
# detect compressed schedule, see commentary section in rc4_skey.c...
&cmp
(
&DWP
(
256
,
$d
),
-
1
);
&cmp
(
&DWP
(
256
,
$d
),
-
1
);
...
@@ -200,7 +216,7 @@ sub RC4
...
@@ -200,7 +216,7 @@ sub RC4
&set_label
("
finished
");
&set_label
("
finished
");
&dec
(
$x
);
&dec
(
$x
);
&stack_pop
(
3
);
&stack_pop
(
3
);
&mov
(
&DWP
(
-
4
,
$d
,"",
0
),
$y
);
&mov
b
(
&BP
(
-
4
,
$d
,"",
0
),
&LB
(
$y
)
);
&movb
(
&BP
(
-
8
,
$d
,"",
0
),
&LB
(
$x
));
&movb
(
&BP
(
-
8
,
$d
,"",
0
),
&LB
(
$x
));
&function_end
(
$name
);
&function_end
(
$name
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录