Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
3edc26a2
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看板
提交
3edc26a2
编写于
10月 01, 2011
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
e_padlock-x86.pl: make it work on VIA C3 (which doesn't support SSE2).
上级
10465aca
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
20 deletion
+17
-20
engines/asm/e_padlock-x86.pl
engines/asm/e_padlock-x86.pl
+17
-20
未找到文件。
engines/asm/e_padlock-x86.pl
浏览文件 @
3edc26a2
...
...
@@ -177,7 +177,7 @@ my ($mode,$opcode) = @_;
&lea
(
$ctx
,
&DWP
(
16
,
$ctx
));
# control word
&xor
("
eax
","
eax
");
if
(
$mode
eq
"
ctr16
")
{
&mov
dqa
("
xmm0
",
&QWP
(
-
16
,
$ctx
));
# load iv
&mov
q
("
xmm0
",
&QWP
(
-
16
,
$ctx
));
# load [upper part of] counter
}
else
{
&xor
("
ebx
","
ebx
");
&test
(
&DWP
(
0
,
$ctx
),
1
<<
5
);
# align bit in control word
...
...
@@ -210,20 +210,21 @@ my ($mode,$opcode) = @_;
&mov
(
$len
,
$chunk
);
&mov
(
&DWP
(
12
,"
ebp
"),
$chunk
);
# chunk
if
(
$mode
eq
"
ctr16
")
{
&pextrw
("
ecx
","
xmm0
",
7
);
# borrow $len
&mov
(
$inp
,
1
);
&mov
("
ecx
",
&DWP
(
-
4
,
$ctx
));
&xor
(
$out
,
$out
);
&
xchg
("
ch
","
cl
");
&
mov
("
eax
",
&DWP
(
-
8
,
$ctx
));
# borrow $len
&set_label
("
${mode}
_prepare
");
&movdqa
(
&QWP
(
0
,"
esp
",
$out
),"
xmm0
");
&lea
("
eax
",
&DWP
(
0
,"
ecx
",
$inp
));
&xchg
("
ah
","
al
");
&mov
(
&DWP
(
12
,"
esp
",
$out
),"
ecx
");
&bswap
("
ecx
");
&movq
(
&QWP
(
0
,"
esp
",
$out
),"
xmm0
");
&inc
("
ecx
");
&mov
(
&DWP
(
8
,"
esp
",
$out
),"
eax
");
&bswap
("
ecx
");
&lea
(
$out
,
&DWP
(
16
,
$out
));
&pinsrw
("
xmm0
","
eax
",
7
);
&lea
(
$inp
,
&DWP
(
1
,
$inp
));
&cmp
(
$out
,
$chunk
);
&jb
(
&label
("
${mode}
_prepare
"));
&mov
(
&DWP
(
-
4
,
$ctx
),"
ecx
");
&lea
(
$inp
,
&DWP
(
0
,"
esp
"));
&lea
(
$out
,
&DWP
(
0
,"
esp
"));
&mov
(
$len
,
$chunk
);
...
...
@@ -244,8 +245,8 @@ my ($mode,$opcode) = @_;
&shr
(
$len
,
4
);
# len/=AES_BLOCK_SIZE
&data_byte
(
0xf3
,
0x0f
,
0xa7
,
$opcode
);
# rep xcrypt*
if
(
$mode
!~
/ecb|ctr/
)
{
&mov
dqa
("
xmm0
",
&QWP
(
0
,"
eax
"));
&mov
dqa
(
&QWP
(
-
16
,
$ctx
),"
xmm0
");
# copy [or refresh] iv
&mov
aps
("
xmm0
",
&QWP
(
0
,"
eax
"));
&mov
aps
(
&QWP
(
-
16
,
$ctx
),"
xmm0
");
# copy [or refresh] iv
}
&mov
(
$out
,
&DWP
(
0
,"
ebp
"));
# restore parameters
&mov
(
$chunk
,
&DWP
(
12
,"
ebp
"));
...
...
@@ -253,10 +254,10 @@ my ($mode,$opcode) = @_;
&mov
(
$inp
,
&DWP
(
4
,"
ebp
"));
&xor
(
$len
,
$len
);
&set_label
("
${mode}
_xor
");
&mov
dqu
("
xmm1
",
&QWP
(
0
,
$inp
,
$len
));
&mov
ups
("
xmm1
",
&QWP
(
0
,
$inp
,
$len
));
&lea
(
$len
,
&DWP
(
16
,
$len
));
&pxor
("
xmm1
",
&QWP
(
-
16
,"
esp
",
$len
));
&mov
dqu
(
&QWP
(
-
16
,
$out
,
$len
),"
xmm1
");
&mov
ups
(
&QWP
(
-
16
,
$out
,
$len
),"
xmm1
");
&cmp
(
$len
,
$chunk
);
&jb
(
&label
("
${mode}
_xor
"));
}
else
{
...
...
@@ -276,11 +277,7 @@ my ($mode,$opcode) = @_;
&sub
(
$len
,
$chunk
);
&mov
(
$chunk
,
$PADLOCK_CHUNK
);
&jnz
(
&label
("
${mode}
_loop
"));
if
(
$mode
eq
"
ctr16
")
{
&movdqa
(
&QWP
(
-
16
,
$ctx
),"
xmm0
");
# write out iv
&pxor
("
xmm0
","
xmm0
");
&pxor
("
xmm1
","
xmm1
");
}
else
{
if
(
$mode
ne
"
ctr16
")
{
&test
(
$out
,
0x0f
);
# out_misaligned
&jz
(
&label
("
${mode}
_done
"));
}
...
...
@@ -301,8 +298,8 @@ my ($mode,$opcode) = @_;
&shr
(
$len
,
4
);
# len/=AES_BLOCK_SIZE
&data_byte
(
0xf3
,
0x0f
,
0xa7
,
$opcode
);
# rep xcrypt*
if
(
$mode
ne
"
ecb
")
{
&mov
dqa
("
xmm0
",
&QWP
(
0
,"
eax
"));
&mov
dqa
(
&QWP
(
-
16
,
$ctx
),"
xmm0
");
# copy [or refresh] iv
&mov
aps
("
xmm0
",
&QWP
(
0
,"
eax
"));
&mov
aps
(
&QWP
(
-
16
,
$ctx
),"
xmm0
");
# copy [or refresh] iv
}
&set_label
("
${mode}
_exit
");
}
&mov
("
eax
",
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录