Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
a078d9df
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a078d9df
编写于
6月 26, 2017
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sha/asm/keccak1600-x86_64.pl: remove redundant moves.
Reviewed-by:
N
Richard Levitte
<
levitte@openssl.org
>
上级
64aef3f5
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
50 addition
and
28 deletion
+50
-28
crypto/sha/asm/keccak1600-x86_64.pl
crypto/sha/asm/keccak1600-x86_64.pl
+50
-28
未找到文件。
crypto/sha/asm/keccak1600-x86_64.pl
浏览文件 @
a078d9df
...
@@ -22,6 +22,36 @@
...
@@ -22,6 +22,36 @@
# instead of actually unrolling the loop pair-wise I simply flip
# instead of actually unrolling the loop pair-wise I simply flip
# pointers to T[][] and A[][] at the end of round. Since number of
# pointers to T[][] and A[][] at the end of round. Since number of
# rounds is even, last round writes to A[][] and everything works out.
# rounds is even, last round writes to A[][] and everything works out.
#
########################################################################
# Numbers are cycles per processed byte out of large message.
#
# r=1088
#
# P4 45.8
# Core 2 14.2
# Sandy Bridge 13.0
# Haswell 9.8
# Skylake 9.4
# Silvermont 22.4
# Goldmont 18.0
# VIA Nano 19.1
# Sledgehammer 13.8
# Bulldozer 16.7
$flavour
=
shift
;
$output
=
shift
;
if
(
$flavour
=~
/\./
)
{
$output
=
$flavour
;
undef
$flavour
;
}
$win64
=
0
;
$win64
=
1
if
(
$flavour
=~
/[nm]asm|mingw64/
||
$output
=~
/\.asm$/
);
$
0
=~
m/(.*[\/\\])[^\/\\]+$/
;
$dir
=
$
1
;
(
$xlate
=
"
${dir}
x86_64-xlate.pl
"
and
-
f
$xlate
)
or
(
$xlate
=
"
${dir}
../../perlasm/x86_64-xlate.pl
"
and
-
f
$xlate
)
or
die
"
can't locate x86_64-xlate.pl
";
open
OUT
,"
|
\"
$^X
\"
\"
$xlate
\"
$flavour
\"
$output
\"
";
*STDOUT
=
*OUT
;
my
@A
=
map
([
8
*
$_
-
100
,
8
*
(
$_
+
1
)
-
100
,
8
*
(
$_
+
2
)
-
100
,
my
@A
=
map
([
8
*
$_
-
100
,
8
*
(
$_
+
1
)
-
100
,
8
*
(
$_
+
2
)
-
100
,
8
*
(
$_
+
3
)
-
100
,
8
*
(
$_
+
4
)
-
100
],
(
0
,
5
,
10
,
15
,
20
));
8
*
(
$_
+
3
)
-
100
,
8
*
(
$_
+
4
)
-
100
],
(
0
,
5
,
10
,
15
,
20
));
...
@@ -78,30 +108,29 @@ __KeccakF1600:
...
@@ -78,30 +108,29 @@ __KeccakF1600:
mov @C[2],@T[0]
mov @C[2],@T[0]
rol \$1,@C[2]
rol \$1,@C[2]
mov $A[0][0](%rdi),@D[0]
xor @C[0],@C[2] # D[1] = ROL64(C[2], 1) ^ C[0]
xor @C[0],@C[2] # D[1] = ROL64(C[2], 1) ^ C[0]
rol \$1,@C[0]
rol \$1,@C[0]
mov $A[1][1](%rdi),@D[1]
xor @C[3],@C[0] # D[4] = ROL64(C[0], 1) ^ C[3]
xor @C[3],@C[0] # D[4] = ROL64(C[0], 1) ^ C[3]
rol \$1,@C[3]
rol \$1,@C[3]
mov $A[2][2](%rdi),@D[2]
xor @C[1],@C[3] # D[2] = ROL64(C[3], 1) ^ C[1]
xor @C[1],@C[3] # D[2] = ROL64(C[3], 1) ^ C[1]
rol \$1,@C[1]
rol \$1,@C[1]
mov $A[3][3](%rdi),@D[3]
xor @C[4],@C[1] # D[0] = ROL64(C[1], 1) ^ C[4]
xor @C[4],@C[1] # D[0] = ROL64(C[1], 1) ^ C[4]
rol \$1,@C[4]
rol \$1,@C[4]
mov $A[4][4](%rdi),@D[4]
xor @T[0],@C[4] # D[3] = ROL64(C[4], 1) ^ C[2]
xor @T[0],@C[4] # D[3] = ROL64(C[4], 1) ^ C[2]
___
___
my
@E
=
@D
;
my
@E
=
@D
;
@D
=
(
@C
[
1
],
@C
[
2
],
@C
[
3
],
@C
[
4
],
@C
[
0
]);
@D
=
(
@C
[
1
],
@C
[
2
],
@C
[
3
],
@C
[
4
],
@C
[
0
]);
@C
=
@E
;
@C
=
@E
;
$code
.=
<<___;
$code
.=
<<___;
mov $A[0][0](%rdi),@C[0]
mov $A[1][1](%rdi),@C[1]
mov $A[2][2](%rdi),@C[2]
mov $A[3][3](%rdi),@C[3]
mov $A[4][4](%rdi),@C[4]
xor @D[0],@C[0]
xor @D[0],@C[0]
xor @D[1],@C[1]
xor @D[1],@C[1]
xor @D[2],@C[2]
xor @D[2],@C[2]
...
@@ -265,25 +294,21 @@ $code.=<<___;
...
@@ -265,25 +294,21 @@ $code.=<<___;
mov @C[0],$A[3][3](%rsi) # R[3][3] = ~C[3] ^ ( C[0] & C[4])
mov @C[0],$A[3][3](%rsi) # R[3][3] = ~C[3] ^ ( C[0] & C[4])
mov $A[0][2](%rdi),@C[0
]
xor $A[0][2](%rdi),@D[2
]
mov $A[1][3](%rdi),@C[1
]
xor $A[1][3](%rdi),@D[3
]
mov $A[2][4](%rdi),@C[2
]
xor $A[2][4](%rdi),@D[4
]
mov $A[3][0](%rdi),@C[3
]
xor $A[3][0](%rdi),@D[0
]
mov $A[4][1](%rdi),@C[4
]
xor $A[4][1](%rdi),@D[1
]
xchg %rsi,%rdi
xchg %rsi,%rdi
xor @D[2],@C[0]
rol \$$rhotates[0][2],@D[2]
xor @D[3],@C[1]
rol \$$rhotates[1][3],@D[3]
xor @D[4],@C[2]
rol \$$rhotates[2][4],@D[4]
xor @D[0],@C[3]
rol \$$rhotates[3][0],@D[0]
xor @D[1],@C[4]
rol \$$rhotates[4][1],@D[1]
___
rol \$$rhotates[0][2],@C[0]
@C
=
(
@D
[
2
],
@D
[
3
],
@D
[
4
],
@D
[
0
],
@D
[
1
]);
rol \$$rhotates[1][3],@C[1]
$code
.=
<<___;
rol \$$rhotates[2][4],@C[2]
rol \$$rhotates[3][0],@C[3]
rol \$$rhotates[4][1],@C[4]
mov @C[0],@T[0]
mov @C[0],@T[0]
and @C[1],@C[0]
and @C[1],@C[0]
xor @C[4],@C[0] # C[4] ^ ( C[0] & C[1])
xor @C[4],@C[0] # C[4] ^ ( C[0] & C[1])
...
@@ -307,11 +332,8 @@ $code.=<<___;
...
@@ -307,11 +332,8 @@ $code.=<<___;
xor @C[1],@C[3] # ~C[1] ^ ( C[2] | C[3])
xor @C[1],@C[3] # ~C[1] ^ ( C[2] | C[3])
mov @C[3],$A[4][1](%rdi) # R[4][1] = ~C[1] ^ ( C[2] | C[3])
mov @C[3],$A[4][1](%rdi) # R[4][1] = ~C[1] ^ ( C[2] | C[3])
mov @C[2],@D[4] # harmonize with the loop top
mov @C[0],@C[1] # harmonize with the loop top
mov @C[3],@D[0]
mov @T[0],@C[0]
mov @C[4],@D[1]
mov @T[0],@D[2]
mov @C[0],@D[3]
test \$255,$iotas
test \$255,$iotas
jnz .Loop
jnz .Loop
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录