Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
149ca712
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看板
提交
149ca712
编写于
10月 04, 2011
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
e_padlock-x86*.pl: Nano-related update.
上级
4cc2bbab
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
21 deletion
+49
-21
engines/asm/e_padlock-x86.pl
engines/asm/e_padlock-x86.pl
+32
-13
engines/asm/e_padlock-x86_64.pl
engines/asm/e_padlock-x86_64.pl
+17
-8
未找到文件。
engines/asm/e_padlock-x86.pl
浏览文件 @
149ca712
...
...
@@ -15,14 +15,21 @@
# mode and ~75% in CBC mode. For aligned data improvement can be
# observed for short inputs only, e.g. 45% for 64-byte messages in
# ECB mode, 20% in CBC. Difference in performance for aligned vs.
# misaligned data depends on misalignment and is either ~1.8x or
# ~2.9x. These are approximately same factors as for hardware support,
# so there is little reason to rely on the latter. It might actually
# hurt performance in mixture of aligned and misaligned buffers,
# because a) if you choose to flip 'align' flag on per-buffer basis,
# then you'd have to reload key context; b) if you choose to set
# 'align' flag permanently, it limits performance for aligned data
# to ~1/2. All results were collected on 1.5GHz C7.
# misaligned data depends on misalignment and is either ~1.8x or 2.9x.
# These are approximately same factors as for hardware support, so
# there is little reason to rely on the latter. On the contrary, it
# might actually hurt performance in mixture of aligned and misaligned
# buffers, because a) if you choose to flip 'align' flag in control
# word on per-buffer basis, then you'd have to reload key context,
# which incurs penalty; b) if you choose to set 'align' flag
# permanently, it limits performance even for aligned data to ~1/2.
# All above mentioned results were collected on 1.5GHz C7. Nano on the
# other hand handles unaligned data more gracefully. Depending on
# algorithm and how unaligned data is, hardware can be up to 70% more
# efficient than below software alignment procedures, nor does 'align'
# flag have affect on aligned performance [if has any meaning at all].
# Therefore suggestion is to unconditionally set 'align' flag on Nano
# for optimal performance.
$
0
=~
m/(.*[\/\\])[^\/\\]+$/
;
$dir
=
$
1
;
push
(
@INC
,"
${dir}
","
${dir}
../../crypto/perlasm
");
...
...
@@ -362,7 +369,7 @@ my ($mode,$opcode) = @_;
&ret
();
&function_end_B
("
padlock_sha1_oneshot
");
&function_begin_B
("
padlock_sha1
");
&function_begin_B
("
padlock_sha1
_blocks
");
&push
("
edi
");
&push
("
esi
");
&mov
("
eax
",
-
1
);
...
...
@@ -373,7 +380,7 @@ my ($mode,$opcode) = @_;
&pop
("
esi
");
&pop
("
edi
");
&ret
();
&function_end_B
("
padlock_sha1
");
&function_end_B
("
padlock_sha1
_blocks
");
&function_begin_B
("
padlock_sha256_oneshot
");
&push
("
edi
");
...
...
@@ -397,7 +404,7 @@ my ($mode,$opcode) = @_;
&ret
();
&function_end_B
("
padlock_sha256_oneshot
");
&function_begin_B
("
padlock_sha256
");
&function_begin_B
("
padlock_sha256
_blocks
");
&push
("
edi
");
&push
("
esi
");
&mov
("
eax
",
-
1
);
...
...
@@ -408,7 +415,19 @@ my ($mode,$opcode) = @_;
&pop
("
esi
");
&pop
("
edi
");
&ret
();
&function_end_B
("
padlock_sha256
");
&function_end_B
("
padlock_sha256_blocks
");
&function_begin_B
("
padlock_sha512_blocks
");
&push
("
edi
");
&push
("
esi
");
&mov
("
edi
",
&wparam
(
0
));
&mov
("
esi
",
&wparam
(
1
));
&mov
("
ecx
",
&wparam
(
2
));
&data_byte
(
0xf3
,
0x0f
,
0xa6
,
0xe0
);
# rep xsha512
&pop
("
esi
");
&pop
("
edi
");
&ret
();
&function_end_B
("
padlock_sha512_blocks
");
&asciz
("
VIA Padlock x86 module, CRYPTOGAMS by <appro
\@
openssl.org>
");
&align
(
16
);
...
...
@@ -417,7 +436,7 @@ my ($mode,$opcode) = @_;
# Essentially this variable belongs in thread local storage.
# Having this variable global on the other hand can only cause
# few bogus key reloads [if any at all on signle-CPU system],
# so we accept the p
a
nalty...
# so we accept the p
e
nalty...
&set_label
("
padlock_saved_context
",
4
);
&data_word
(
0
);
...
...
engines/asm/e_padlock-x86_64.pl
浏览文件 @
149ca712
...
...
@@ -151,15 +151,15 @@ padlock_sha1_oneshot:
ret
.size padlock_sha1_oneshot,.-padlock_sha1_oneshot
.globl padlock_sha1
.type padlock_sha1,\@function,3
.globl padlock_sha1
_blocks
.type padlock_sha1
_blocks
,\@function,3
.align 16
padlock_sha1:
padlock_sha1
_blocks
:
mov \$-1,%rax
mov %rdx,%rcx
.byte 0xf3,0x0f,0xa6,0xc8 # rep xsha1
ret
.size padlock_sha1
,.-padlock_sha1
.size padlock_sha1
_blocks,.-padlock_sha1_blocks
.globl padlock_sha256_oneshot
.type padlock_sha256_oneshot,\@function,3
...
...
@@ -171,15 +171,23 @@ padlock_sha256_oneshot:
ret
.size padlock_sha256_oneshot,.-padlock_sha256_oneshot
.globl padlock_sha256
.type padlock_sha256,\@function,3
.globl padlock_sha256
_blocks
.type padlock_sha256
_blocks
,\@function,3
.align 16
padlock_sha256:
padlock_sha256
_blocks
:
mov \$-1,%rax
mov %rdx,%rcx
.byte 0xf3,0x0f,0xa6,0xd0 # rep xsha256
ret
.size padlock_sha256,.-padlock_sha256
.size padlock_sha256_blocks,.-padlock_sha256_blocks
.globl padlock_sha512_blocks,\@function,3
.align 16
padlock_sha512_blocks:
mov %rdx,%rcx
.byte 0xf3,0x0f,0xa6,0xe0 # rep xha512
ret
.size padlock_sha512_blocks,.-padlock_sha512_blocks
___
sub
generate_mode
{
...
...
@@ -207,6 +215,7 @@ padlock_${mode}_encrypt:
xor %eax,%eax
xor %ebx,%ebx
testl \$`1<<5`,($ctx) # align bit in control word
jnz .L${mode}_aligned
test \$0x0f,$out
setz %al # !out_misaligned
test \$0x0f,$inp
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录