Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
6b6981ef
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
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看板
提交
6b6981ef
编写于
1月 29, 2018
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
poly1305/poly1305_ieee754.c: add support for MIPS.
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
adeb4bc7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
1 deletion
+17
-1
crypto/poly1305/poly1305_ieee754.c
crypto/poly1305/poly1305_ieee754.c
+17
-1
未找到文件。
crypto/poly1305/poly1305_ieee754.c
浏览文件 @
6b6981ef
/*
* Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016
-20018
The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
...
...
@@ -101,6 +101,8 @@ static const u64 one = 1;
static
const
u32
fpc
=
1
;
#elif defined(__sparc__)
static
const
u64
fsr
=
1ULL
<<
30
;
#elif defined(__mips__)
static
const
u32
fcsr
=
1
;
#else
#error "unrecognized platform"
#endif
...
...
@@ -147,6 +149,11 @@ int poly1305_init(void *ctx, const unsigned char key[16])
asm
volatile
(
"stx %%fsr,%0"
:
"=m"
(
fsr_orig
));
asm
volatile
(
"ldx %0,%%fsr"
::
"m"
(
fsr
));
#elif defined(__mips__)
u32
fcsr_orig
;
asm
volatile
(
"cfc1 %0,$31"
:
"=r"
(
fcsr_orig
));
asm
volatile
(
"ctc1 %0,$31"
::
"r"
(
fcsr
));
#endif
/* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
...
...
@@ -206,6 +213,8 @@ int poly1305_init(void *ctx, const unsigned char key[16])
asm
volatile
(
"lfpc %0"
::
"m"
(
fpc_orig
));
#elif defined(__sparc__)
asm
volatile
(
"ldx %0,%%fsr"
::
"m"
(
fsr_orig
));
#elif defined(__mips__)
asm
volatile
(
"ctc1 %0,$31"
::
"r"
(
fcsr_orig
));
#endif
}
...
...
@@ -262,6 +271,11 @@ void poly1305_blocks(void *ctx, const unsigned char *inp, size_t len,
asm
volatile
(
"stx %%fsr,%0"
:
"=m"
(
fsr_orig
));
asm
volatile
(
"ldx %0,%%fsr"
::
"m"
(
fsr
));
#elif defined(__mips__)
u32
fcsr_orig
;
asm
volatile
(
"cfc1 %0,$31"
:
"=r"
(
fcsr_orig
));
asm
volatile
(
"ctc1 %0,$31"
::
"r"
(
fcsr
));
#endif
/*
...
...
@@ -408,6 +422,8 @@ void poly1305_blocks(void *ctx, const unsigned char *inp, size_t len,
asm
volatile
(
"lfpc %0"
::
"m"
(
fpc_orig
));
#elif defined(__sparc__)
asm
volatile
(
"ldx %0,%%fsr"
::
"m"
(
fsr_orig
));
#elif defined(__mips__)
asm
volatile
(
"ctc1 %0,$31"
::
"r"
(
fcsr_orig
));
#endif
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录