Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
79ba545c
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,发现更多精彩内容 >>
提交
79ba545c
编写于
10月 17, 2011
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bn_shift.c: minimize reallocations, which allows BN_FLG_STATIC_DATA to
be shifted in specific cases.
上级
993adc05
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
12 deletion
+15
-12
crypto/bn/bn_shift.c
crypto/bn/bn_shift.c
+15
-12
未找到文件。
crypto/bn/bn_shift.c
浏览文件 @
79ba545c
...
...
@@ -99,7 +99,7 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a)
int
BN_rshift1
(
BIGNUM
*
r
,
const
BIGNUM
*
a
)
{
BN_ULONG
*
ap
,
*
rp
,
t
,
c
;
int
i
;
int
i
,
j
;
bn_check_top
(
r
);
bn_check_top
(
a
);
...
...
@@ -109,22 +109,25 @@ int BN_rshift1(BIGNUM *r, const BIGNUM *a)
BN_zero
(
r
);
return
(
1
);
}
i
=
a
->
top
;
ap
=
a
->
d
;
j
=
i
-
(
ap
[
i
-
1
]
==
1
);
if
(
a
!=
r
)
{
if
(
bn_wexpand
(
r
,
a
->
top
)
==
NULL
)
return
(
0
);
r
->
top
=
a
->
top
;
if
(
bn_wexpand
(
r
,
j
)
==
NULL
)
return
(
0
);
r
->
neg
=
a
->
neg
;
}
ap
=
a
->
d
;
rp
=
r
->
d
;
c
=
0
;
for
(
i
=
a
->
top
-
1
;
i
>=
0
;
i
--
)
t
=
ap
[
--
i
];
c
=
(
t
&
1
)
?
BN_TBIT
:
0
;
if
(
t
>>=
1
)
rp
[
i
]
=
t
;
while
(
i
>
0
)
{
t
=
ap
[
i
];
t
=
ap
[
--
i
];
rp
[
i
]
=
((
t
>>
1
)
&
BN_MASK2
)
|
c
;
c
=
(
t
&
1
)
?
BN_TBIT
:
0
;
}
bn_correct_top
(
r
)
;
r
->
top
=
j
;
bn_check_top
(
r
);
return
(
1
);
}
...
...
@@ -182,10 +185,11 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
BN_zero
(
r
);
return
(
1
);
}
i
=
(
BN_num_bits
(
a
)
-
n
+
(
BN_BITS2
-
1
))
/
BN_BITS2
;
if
(
r
!=
a
)
{
r
->
neg
=
a
->
neg
;
if
(
bn_wexpand
(
r
,
a
->
top
-
nw
+
1
)
==
NULL
)
return
(
0
);
if
(
bn_wexpand
(
r
,
i
)
==
NULL
)
return
(
0
);
}
else
{
...
...
@@ -196,7 +200,7 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
f
=
&
(
a
->
d
[
nw
]);
t
=
r
->
d
;
j
=
a
->
top
-
nw
;
r
->
top
=
j
;
r
->
top
=
i
;
if
(
rb
==
0
)
{
...
...
@@ -212,9 +216,8 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
l
=
*
(
f
++
);
*
(
t
++
)
=
(
tmp
|
(
l
<<
lb
))
&
BN_MASK2
;
}
*
(
t
++
)
=
(
l
>>
rb
)
&
BN_MASK2
;
if
((
l
=
(
l
>>
rb
)
&
BN_MASK2
))
*
(
t
)
=
l
;
}
bn_correct_top
(
r
);
bn_check_top
(
r
);
return
(
1
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录