Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
5afc296a
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5afc296a
编写于
2月 10, 2015
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ec/ecp_nistz256.c: fix compiler warnings.
Reviewed-by:
N
Matt Caswell
<
matt@openssl.org
>
上级
ea5f8411
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
25 deletion
+24
-25
crypto/ec/ecp_nistz256.c
crypto/ec/ecp_nistz256.c
+24
-25
未找到文件。
crypto/ec/ecp_nistz256.c
浏览文件 @
5afc296a
...
@@ -28,11 +28,8 @@
...
@@ -28,11 +28,8 @@
#include <string.h>
#include <string.h>
#include "internal/bn_int.h"
#include <openssl/err.h>
#include <openssl/ec.h>
#include "cryptlib.h"
#include "cryptlib.h"
#include "internal/bn_int.h"
#include "ec_lcl.h"
#include "ec_lcl.h"
#if BN_BITS2 != 64
#if BN_BITS2 != 64
...
@@ -166,7 +163,7 @@ static unsigned int _booth_recode_w7(unsigned int in)
...
@@ -166,7 +163,7 @@ static unsigned int _booth_recode_w7(unsigned int in)
static
void
copy_conditional
(
BN_ULONG
dst
[
P256_LIMBS
],
static
void
copy_conditional
(
BN_ULONG
dst
[
P256_LIMBS
],
const
BN_ULONG
src
[
P256_LIMBS
],
BN_ULONG
move
)
const
BN_ULONG
src
[
P256_LIMBS
],
BN_ULONG
move
)
{
{
BN_ULONG
mask1
=
-
move
;
BN_ULONG
mask1
=
0
-
move
;
BN_ULONG
mask2
=
~
mask1
;
BN_ULONG
mask2
=
~
mask1
;
dst
[
0
]
=
(
src
[
0
]
&
mask1
)
^
(
dst
[
0
]
&
mask2
);
dst
[
0
]
=
(
src
[
0
]
&
mask1
)
^
(
dst
[
0
]
&
mask2
);
...
@@ -560,9 +557,10 @@ static void ecp_nistz256_windowed_mul(const EC_GROUP *group,
...
@@ -560,9 +557,10 @@ static void ecp_nistz256_windowed_mul(const EC_GROUP *group,
P256_POINT
*
r
,
P256_POINT
*
r
,
const
BIGNUM
**
scalar
,
const
BIGNUM
**
scalar
,
const
EC_POINT
**
point
,
const
EC_POINT
**
point
,
in
t
num
,
BN_CTX
*
ctx
)
size_
t
num
,
BN_CTX
*
ctx
)
{
{
int
i
,
j
;
size_t
i
;
int
j
;
unsigned
int
idx
;
unsigned
int
idx
;
unsigned
char
(
*
p_str
)[
33
]
=
NULL
;
unsigned
char
(
*
p_str
)[
33
]
=
NULL
;
const
unsigned
int
window_size
=
5
;
const
unsigned
int
window_size
=
5
;
...
@@ -573,8 +571,9 @@ static void ecp_nistz256_windowed_mul(const EC_GROUP *group,
...
@@ -573,8 +571,9 @@ static void ecp_nistz256_windowed_mul(const EC_GROUP *group,
P256_POINT
(
*
table
)[
16
]
=
NULL
;
P256_POINT
(
*
table
)[
16
]
=
NULL
;
void
*
table_storage
=
NULL
;
void
*
table_storage
=
NULL
;
if
((
table_storage
=
if
((
num
*
16
+
6
)
>
OPENSSL_MALLOC_MAX_NELEMS
(
P256_POINT
)
OPENSSL_malloc
((
num
*
16
+
5
)
*
sizeof
(
P256_POINT
)
+
64
))
==
NULL
||
(
table_storage
=
OPENSSL_malloc
((
num
*
16
+
5
)
*
sizeof
(
P256_POINT
)
+
64
))
==
NULL
||
(
p_str
=
||
(
p_str
=
OPENSSL_malloc
(
num
*
33
*
sizeof
(
unsigned
char
)))
==
NULL
OPENSSL_malloc
(
num
*
33
*
sizeof
(
unsigned
char
)))
==
NULL
||
(
scalars
=
OPENSSL_malloc
(
num
*
sizeof
(
BIGNUM
*
)))
==
NULL
)
{
||
(
scalars
=
OPENSSL_malloc
(
num
*
sizeof
(
BIGNUM
*
)))
==
NULL
)
{
...
@@ -604,16 +603,16 @@ static void ecp_nistz256_windowed_mul(const EC_GROUP *group,
...
@@ -604,16 +603,16 @@ static void ecp_nistz256_windowed_mul(const EC_GROUP *group,
for
(
j
=
0
;
j
<
bn_get_top
(
scalars
[
i
])
*
BN_BYTES
;
j
+=
BN_BYTES
)
{
for
(
j
=
0
;
j
<
bn_get_top
(
scalars
[
i
])
*
BN_BYTES
;
j
+=
BN_BYTES
)
{
BN_ULONG
d
=
bn_get_words
(
scalars
[
i
])[
j
/
BN_BYTES
];
BN_ULONG
d
=
bn_get_words
(
scalars
[
i
])[
j
/
BN_BYTES
];
p_str
[
i
][
j
+
0
]
=
d
&
0xff
;
p_str
[
i
][
j
+
0
]
=
(
unsigned
char
)
d
;
p_str
[
i
][
j
+
1
]
=
(
d
>>
8
)
&
0xff
;
p_str
[
i
][
j
+
1
]
=
(
unsigned
char
)(
d
>>
8
)
;
p_str
[
i
][
j
+
2
]
=
(
d
>>
16
)
&
0xff
;
p_str
[
i
][
j
+
2
]
=
(
unsigned
char
)(
d
>>
16
)
;
p_str
[
i
][
j
+
3
]
=
(
d
>>=
24
)
&
0xff
;
p_str
[
i
][
j
+
3
]
=
(
unsigned
char
)(
d
>>=
24
)
;
if
(
BN_BYTES
==
8
)
{
if
(
BN_BYTES
==
8
)
{
d
>>=
8
;
d
>>=
8
;
p_str
[
i
][
j
+
4
]
=
d
&
0xff
;
p_str
[
i
][
j
+
4
]
=
(
unsigned
char
)
d
;
p_str
[
i
][
j
+
5
]
=
(
d
>>
8
)
&
0xff
;
p_str
[
i
][
j
+
5
]
=
(
unsigned
char
)(
d
>>
8
)
;
p_str
[
i
][
j
+
6
]
=
(
d
>>
16
)
&
0xff
;
p_str
[
i
][
j
+
6
]
=
(
unsigned
char
)(
d
>>
16
)
;
p_str
[
i
][
j
+
7
]
=
(
d
>>
24
)
&
0xff
;
p_str
[
i
][
j
+
7
]
=
(
unsigned
char
)(
d
>>
24
)
;
}
}
}
}
for
(;
j
<
33
;
j
++
)
for
(;
j
<
33
;
j
++
)
...
@@ -1225,16 +1224,16 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group,
...
@@ -1225,16 +1224,16 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group,
for
(
i
=
0
;
i
<
bn_get_top
(
scalar
)
*
BN_BYTES
;
i
+=
BN_BYTES
)
{
for
(
i
=
0
;
i
<
bn_get_top
(
scalar
)
*
BN_BYTES
;
i
+=
BN_BYTES
)
{
BN_ULONG
d
=
bn_get_words
(
scalar
)[
i
/
BN_BYTES
];
BN_ULONG
d
=
bn_get_words
(
scalar
)[
i
/
BN_BYTES
];
p_str
[
i
+
0
]
=
d
&
0xff
;
p_str
[
i
+
0
]
=
(
unsigned
char
)
d
;
p_str
[
i
+
1
]
=
(
d
>>
8
)
&
0xff
;
p_str
[
i
+
1
]
=
(
unsigned
char
)(
d
>>
8
)
;
p_str
[
i
+
2
]
=
(
d
>>
16
)
&
0xff
;
p_str
[
i
+
2
]
=
(
unsigned
char
)(
d
>>
16
)
;
p_str
[
i
+
3
]
=
(
d
>>=
24
)
&
0xff
;
p_str
[
i
+
3
]
=
(
unsigned
char
)(
d
>>=
24
)
;
if
(
BN_BYTES
==
8
)
{
if
(
BN_BYTES
==
8
)
{
d
>>=
8
;
d
>>=
8
;
p_str
[
i
+
4
]
=
d
&
0xff
;
p_str
[
i
+
4
]
=
(
unsigned
char
)
d
;
p_str
[
i
+
5
]
=
(
d
>>
8
)
&
0xff
;
p_str
[
i
+
5
]
=
(
unsigned
char
)(
d
>>
8
)
;
p_str
[
i
+
6
]
=
(
d
>>
16
)
&
0xff
;
p_str
[
i
+
6
]
=
(
unsigned
char
)(
d
>>
16
)
;
p_str
[
i
+
7
]
=
(
d
>>
24
)
&
0xff
;
p_str
[
i
+
7
]
=
(
unsigned
char
)(
d
>>
24
)
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录