Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
9912ab67
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看板
提交
9912ab67
编写于
4月 18, 2008
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resolve __DECC warning and keep disclaiming support for 16-bit platforms.
上级
299ab428
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
3 addition
and
69 deletion
+3
-69
crypto/bn/bn_nist.c
crypto/bn/bn_nist.c
+3
-69
未找到文件。
crypto/bn/bn_nist.c
浏览文件 @
9912ab67
...
...
@@ -99,41 +99,6 @@ static const BN_ULONG _nist_p_521[] = {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0x000001FF
};
#elif BN_BITS2 == 16
static
const
BN_ULONG
_nist_p_192
[]
=
{
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFE
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
};
static
const
BN_ULONG
_nist_p_224
[]
=
{
0x0001
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
};
static
const
BN_ULONG
_nist_p_256
[]
=
{
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0x0001
,
0x0000
,
0xFFFF
,
0xFFFF
};
static
const
BN_ULONG
_nist_p_384
[]
=
{
0xFFFF
,
0xFFFF
,
0x0000
,
0x0000
,
0x0000
,
0x0000
,
0xFFFF
,
0xFFFF
,
0xFFFE
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
};
static
const
BN_ULONG
_nist_p_521
[]
=
{
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0xFFFF
,
0x01FF
};
#elif BN_BITS2 == 8
static
const
BN_ULONG
_nist_p_192
[]
=
{
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFE
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
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0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0xFF
,
0x01
};
#endif
const
BIGNUM
*
BN_get0_nist_prime_192
(
void
)
...
...
@@ -192,10 +157,10 @@ static void nist_cp_bn(BN_ULONG *buf, BN_ULONG *a, int top)
}
#if BN_BITS2 == 64
#define bn_cp_64(to, n, from, m) (to)[n] = (
from)[m]
;
#define bn_cp_64(to, n, from, m) (to)[n] = (
m>=0)?((from)[m]):0
;
#define bn_64_set_0(to, n) (to)[n] = (BN_ULONG)0;
/* TBD */
#define bn_cp_32(to, n, from, m) (to)[n] = (
from)[m]
;
#define bn_cp_32(to, n, from, m) (to)[n] = (
m>=0)?((from)[m]):0
;
#define bn_32_set_0(to, n) (to)[n] = (BN_ULONG)0;
#else
#define bn_cp_64(to, n, from, m) \
...
...
@@ -209,26 +174,8 @@ static void nist_cp_bn(BN_ULONG *buf, BN_ULONG *a, int top)
bn_32_set_0(to, (n)*2+1); \
}
#if BN_BITS2 == 32
#define bn_cp_32(to, n, from, m) (to)[n] = (
from)[m]
;
#define bn_cp_32(to, n, from, m) (to)[n] = (
m>=0)?((from)[m]):0
;
#define bn_32_set_0(to, n) (to)[n] = (BN_ULONG)0;
#elif BN_BITS2 == 16
#define bn_cp_32(to, n, from, m) \
{ \
(to)[(n)*2] = (from)[(m)*2]; \
(to)[(n)*2+1] = (from)[(m)*2+1];\
}
#define bn_32_set_0(to, n) { (to)[(n)*2] = 0; (to)[(n)*2+1] = 0; }
#elif BN_BITS2 == 8
#define bn_cp_32(to, n, from, m) \
{ \
(to)[(n)*4] = (from)[(m)*4]; \
(to)[(n)*4+1] = (from)[(m)*4+1];\
(to)[(n)*4+2] = (from)[(m)*4+2];\
(to)[(n)*4+3] = (from)[(m)*4+3];\
}
#define bn_32_set_0(to, n) \
{ (to)[(n)*4] = (BN_ULONG)0; (to)[(n)*4+1] = (BN_ULONG)0; \
(to)[(n)*4+2] = (BN_ULONG)0; (to)[(n)*4+3] = (BN_ULONG)0; }
#endif
#endif
/* BN_BITS2 != 64 */
...
...
@@ -276,11 +223,6 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
nist_cp_bn_0
(
buf
,
a_d
+
BN_NIST_192_TOP
,
top
-
BN_NIST_192_TOP
,
BN_NIST_192_TOP
);
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
# pragma message save
# pragma message disable BADSUBSCRIPT
#endif
nist_set_192
(
t_d
,
buf
,
0
,
3
,
3
);
carry
=
bn_add_words
(
r_d
,
r_d
,
t_d
,
BN_NIST_192_TOP
);
mask
=
0
-
(
size_t
)
bn_sub_words
(
c_d
,
r_d
,
_nist_p_192
,
BN_NIST_192_TOP
);
...
...
@@ -293,10 +235,6 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
mask
=
~
mask
|
(
0
-
(
size_t
)
carry
);
res
=
(
BN_ULONG
*
)(((
size_t
)
c_d
&
mask
)
|
((
size_t
)
r_d
&~
mask
));
#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
# pragma message restore
#endif
nist_set_192
(
t_d
,
buf
,
5
,
5
,
5
)
carry
=
bn_add_words
(
r_d
,
res
,
t_d
,
BN_NIST_192_TOP
);
mask
=
0
-
(
size_t
)
bn_sub_words
(
c_d
,
r_d
,
_nist_p_192
,
BN_NIST_192_TOP
);
...
...
@@ -706,10 +644,6 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
#define BN_NIST_521_TOP_MASK (BN_ULONG)0x1FF
#elif BN_BITS2 == 32
#define BN_NIST_521_TOP_MASK (BN_ULONG)0x1FF
#elif BN_BITS2 == 16
#define BN_NIST_521_TOP_MASK (BN_ULONG)0x1FF
#elif BN_BITS2 == 8
#define BN_NIST_521_TOP_MASK (BN_ULONG)0x1
#endif
int
top
,
ret
=
0
;
BN_ULONG
*
r_d
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录