Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
688938fb
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看板
提交
688938fb
编写于
2月 27, 2000
作者:
U
Ulf Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bug fix!
上级
9b95f1df
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
53 addition
and
6 deletion
+53
-6
CHANGES
CHANGES
+5
-0
crypto/bn/bn_mul.c
crypto/bn/bn_mul.c
+48
-6
未找到文件。
CHANGES
浏览文件 @
688938fb
...
...
@@ -4,6 +4,11 @@
Changes between 0.9.4 and 0.9.5 [xx XXX 2000]
*) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n]
case was implemented. This caused BN_div_recp() to fail occasionally
on 32 bit machines.
[Ulf Möller]
*) Add an optional second argument to the set_label() in the perl
assembly language builder. If this argument exists and is set
to 1 it signals that the assembler should use a symbol whose
...
...
crypto/bn/bn_mul.c
浏览文件 @
688938fb
...
...
@@ -221,7 +221,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
int
n
,
BN_ULONG
*
t
)
{
int
i
,
j
,
n2
=
n
*
2
;
unsigned
int
c1
;
unsigned
int
c1
,
c2
,
neg
,
zero
;
BN_ULONG
ln
,
lo
,
*
p
;
# ifdef BN_COUNT
...
...
@@ -235,9 +235,43 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
}
/* r=(a[0]-a[1])*(b[1]-b[0]) */
bn_sub_words
(
t
,
a
,
&
(
a
[
n
]),
n
);
/* + */
bn_sub_words
(
&
(
t
[
n
]),
b
,
&
(
b
[
n
]),
n
);
/* - */
c1
=
bn_cmp_words
(
a
,
&
(
a
[
n
]),
n
);
c2
=
bn_cmp_words
(
&
(
b
[
n
]),
b
,
n
);
zero
=
neg
=
0
;
switch
(
c1
*
3
+
c2
)
{
case
-
4
:
bn_sub_words
(
t
,
&
(
a
[
n
]),
a
,
n
);
/* - */
bn_sub_words
(
&
(
t
[
n
]),
b
,
&
(
b
[
n
]),
n
);
/* - */
break
;
case
-
3
:
zero
=
1
;
/* break; */
case
-
2
:
bn_sub_words
(
t
,
&
(
a
[
n
]),
a
,
n
);
/* - */
bn_sub_words
(
&
(
t
[
n
]),
&
(
b
[
n
]),
b
,
n
);
/* + */
neg
=
1
;
break
;
case
-
1
:
case
0
:
case
1
:
zero
=
1
;
/* break; */
case
2
:
bn_sub_words
(
t
,
a
,
&
(
a
[
n
]),
n
);
/* + */
bn_sub_words
(
&
(
t
[
n
]),
b
,
&
(
b
[
n
]),
n
);
/* - */
neg
=
1
;
break
;
case
3
:
zero
=
1
;
/* break; */
case
4
:
bn_sub_words
(
t
,
a
,
&
(
a
[
n
]),
n
);
bn_sub_words
(
&
(
t
[
n
]),
&
(
b
[
n
]),
b
,
n
);
break
;
}
/* The zero case isn't yet implemented here. The speedup
would probably be negligible. */
# if 0
if
(
n
==
4
)
{
...
...
@@ -313,7 +347,16 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
*/
c1
=
(
int
)(
bn_add_words
(
t
,
r
,
&
(
r
[
n2
]),
n2
));
c1
-=
(
int
)(
bn_sub_words
(
&
(
t
[
n2
]),
t
,
&
(
t
[
n2
]),
n2
));
if
(
neg
)
/* if t[32] is negative */
{
c1
-=
(
int
)(
bn_sub_words
(
&
(
t
[
n2
]),
t
,
&
(
t
[
n2
]),
n2
));
}
else
{
/* Might have a carry */
c1
+=
(
int
)(
bn_add_words
(
&
(
t
[
n2
]),
&
(
t
[
n2
]),
t
,
n2
));
}
/* t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
* r[10] holds (a[0]*b[0])
...
...
@@ -674,7 +717,6 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
}
}
#endif
/* BN_RECURSION */
if
(
bn_wexpand
(
rr
,
top
)
==
NULL
)
goto
err
;
rr
->
top
=
top
;
bn_mul_normal
(
rr
->
d
,
a
->
d
,
al
,
b
->
d
,
bl
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录