Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
65cad34b
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看板
提交
65cad34b
编写于
6月 06, 2014
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
aesv8-armx.pl update:
- fix 32-bit build (submitted by Ard Biesheuvel); - fix performance issue in CTR;
上级
5111672b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
17 deletion
+24
-17
crypto/aes/asm/aesv8-armx.pl
crypto/aes/asm/aesv8-armx.pl
+24
-17
未找到文件。
crypto/aes/asm/aesv8-armx.pl
浏览文件 @
65cad34b
...
...
@@ -18,9 +18,9 @@
#
# Performance in cycles per byte processed with 128-bit key:
#
# CBC enc CBC dec
# Apple A7 2.39 1.20
# Cortex-A5x n/a n/a
# CBC enc CBC dec
CTR
# Apple A7 2.39 1.20
1.20
# Cortex-A5x n/a n/a
n/a
$flavour
=
shift
;
open
STDOUT
,"
>
"
.
shift
;
...
...
@@ -733,12 +733,11 @@ $code.=<<___;
subs $len,$len,#2
aesmc $tmp0,$tmp0
aesmc $tmp1,$tmp1
vld1.32 {q8
},[$key_],#16 // re-pre-load rndkey[0
]
vld1.32 {q8
-q9},[$key_],#32 // re-pre-load rndkey[0-1
]
aese $tmp0,q13
aese $tmp1,q13
aesmc $tmp0,$tmp0
aesmc $tmp1,$tmp1
vld1.32 {q9},[$key_],#16 // re-pre-load rndkey[1]
aese $tmp0,q14
aese $tmp1,q14
vmov.32 ${dat0}[3], $tctr
...
...
@@ -878,14 +877,14 @@ if ($flavour =~ /64/) { ######## 64-bit code
"
aesd
"
=>
0x4e285800
,
"
aese
"
=>
0x4e284800
,
"
aesimc
"
=>
0x4e287800
,
"
aesmc
"
=>
0x4e286800
);
sub
unaes
{
local
*unaes
=
sub
{
my
(
$mnemonic
,
$arg
)
=
@_
;
$arg
=~
m/[qv]([0-9]+)[^,]*,\s*[qv]([0-9]+)/o
&&
sprintf
"
.
long
\t
0x%08x
\t
//%s %s
",
sprintf
"
.
inst
\t
0x%08x
\t
//%s %s
",
$opcode
{
$mnemonic
}
|
$
1
|
(
$
2
<<
5
),
$mnemonic
,
$arg
;
}
}
;
foreach
(
split
("
\n
",
$code
))
{
s/\`([^\`]*)\`/eval($1)/g
eo
;
...
...
@@ -917,35 +916,42 @@ if ($flavour =~ /64/) { ######## 64-bit code
"
aesd
"
=>
0xf3b00340
,
"
aese
"
=>
0xf3b00300
,
"
aesimc
"
=>
0xf3b003c0
,
"
aesmc
"
=>
0xf3b00380
);
sub
unaes
{
local
*unaes
=
sub
{
my
(
$mnemonic
,
$arg
)
=
@_
;
$arg
=~
m/[qv]([0-9]+)[^,]*,\s*[qv]([0-9]+)/o
&&
sprintf
"
.long
\t
0x%08x
\t
@ %s %s
",
$opcode
{
$mnemonic
}
|
((
$
1
&
7
)
<<
13
)
|
((
$
1
&
8
)
<<
19
)
|
((
$
2
&
7
)
<<
1
)
|
((
$
2
&
8
)
<<
2
),
if
(
$arg
=~
m/[qv]([0-9]+)[^,]*,\s*[qv]([0-9]+)/o
)
{
my
$word
=
$opcode
{
$mnemonic
}
|
((
$
1
&
7
)
<<
13
)
|
((
$
1
&
8
)
<<
19
)
|
((
$
2
&
7
)
<<
1
)
|
((
$
2
&
8
)
<<
2
);
# since ARMv7 instructions are always encoded little-endian.
# correct solution is to use .inst directive, but older
# assemblers don't implement it:-(
sprintf
"
.byte
\t
0x%02x,0x%02x,0x%02x,0x%02x
\t
@ %s %s
",
$word
&
0xff
,(
$word
>>
8
)
&
0xff
,
(
$word
>>
16
)
&
0xff
,(
$word
>>
24
)
&
0xff
,
$mnemonic
,
$arg
;
}
}
};
sub
unvtbl
{
my
$arg
=
shift
;
$arg
=~
m/q([0-9]+),\s*\{q([0-9]+)\},\s*q([0-9]+)/o
&&
sprintf
"
vtbl.8 d%d,{q%d},d%d
\n\t
vtbl.8 d%d,{q%d},d%d
",
2
*
$
1
,
$
2
,
2
*
$
3
,
2
*
$
1
+
1
,
$
2
,
2
*
$
3
+
1
;
sprintf
"
vtbl.8 d%d,{q%d},d%d
\n\t
"
.
"
vtbl.8 d%d,{q%d},d%d
",
2
*
$
1
,
$
2
,
2
*
$
3
,
2
*
$
1
+
1
,
$
2
,
2
*
$
3
+
1
;
}
sub
unvdup32
{
my
$arg
=
shift
;
$arg
=~
m/q([0-9]+),\s*q([0-9]+)\[([0-3])\]/o
&&
sprintf
"
vdup.32 q%d,d%d[%d]
",
$
1
,
2
*
$
2
+
$
3
>>
1
,
$
3
&
1
;
sprintf
"
vdup.32 q%d,d%d[%d]
",
$
1
,
2
*
$
2
+
(
$
3
>>
1
)
,
$
3
&
1
;
}
sub
unvmov32
{
my
$arg
=
shift
;
$arg
=~
m/q([0-9]+)\[([0-3])\],(.*)/o
&&
sprintf
"
vmov.32 d%d[%d],%s
",
2
*
$
1
+
$
2
>>
1
,
$
2
&
1
,
$
3
;
sprintf
"
vmov.32 d%d[%d],%s
",
2
*
$
1
+
(
$
2
>>
1
)
,
$
2
&
1
,
$
3
;
}
foreach
(
split
("
\n
",
$code
))
{
...
...
@@ -956,6 +962,7 @@ if ($flavour =~ /64/) { ######## 64-bit code
s/\/\/\s?/@ /o
;
# new->old style commentary
# fix up remainig new-style suffixes
s/\{q([0-9]+)\},\s*\[(.+)\],#8/sprintf "{d%d},[$2]!",2*$1/
eo
or
s/\],#[0-9]+/]!/o
;
s/[v]?(aes\w+)\s+([qv].*)/unaes($1,$2)/g
eo
or
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录