Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
ea71ec1b
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看板
提交
ea71ec1b
编写于
10月 28, 2008
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ec2_mult.c readability update.
上级
f1455b30
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
9 deletion
+10
-9
crypto/ec/ec2_mult.c
crypto/ec/ec2_mult.c
+10
-9
未找到文件。
crypto/ec/ec2_mult.c
浏览文件 @
ea71ec1b
...
...
@@ -216,8 +216,8 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
const
EC_POINT
*
point
,
BN_CTX
*
ctx
)
{
BIGNUM
*
x1
,
*
x2
,
*
z1
,
*
z2
;
int
ret
=
0
,
i
,
j
;
BN_ULONG
mask
;
int
ret
=
0
,
i
;
BN_ULONG
mask
,
word
;
if
(
r
==
point
)
{
...
...
@@ -251,22 +251,24 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
if
(
!
BN_GF2m_add
(
x2
,
x2
,
&
group
->
b
))
goto
err
;
/* x2 = x^4 + b */
/* find top most bit and go one past it */
i
=
scalar
->
top
-
1
;
j
=
BN_BITS2
-
1
;
i
=
scalar
->
top
-
1
;
mask
=
BN_TBIT
;
while
(
!
(
scalar
->
d
[
i
]
&
mask
))
{
mask
>>=
1
;
j
--
;
}
mask
>>=
1
;
j
--
;
word
=
scalar
->
d
[
i
];
while
(
!
(
word
&
mask
))
mask
>>=
1
;
mask
>>=
1
;
/* if top most bit was at word break, go to next word */
if
(
!
mask
)
{
i
--
;
j
=
BN_BITS2
-
1
;
i
--
;
mask
=
BN_TBIT
;
}
for
(;
i
>=
0
;
i
--
)
{
for
(;
j
>=
0
;
j
--
)
word
=
scalar
->
d
[
i
];
while
(
mask
)
{
if
(
scalar
->
d
[
i
]
&
mask
)
if
(
word
&
mask
)
{
if
(
!
gf2m_Madd
(
group
,
&
point
->
X
,
x1
,
z1
,
x2
,
z2
,
ctx
))
goto
err
;
if
(
!
gf2m_Mdouble
(
group
,
x2
,
z2
,
ctx
))
goto
err
;
...
...
@@ -278,7 +280,6 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r,
}
mask
>>=
1
;
}
j
=
BN_BITS2
-
1
;
mask
=
BN_TBIT
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录