Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
08e1cbc6
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看板
提交
08e1cbc6
编写于
4月 28, 2004
作者:
G
Geoff Thorpe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The new BN_CTX code makes this sort of abuse unnecessary.
上级
b6b4fdc9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
19 deletion
+15
-19
crypto/dsa/dsa_gen.c
crypto/dsa/dsa_gen.c
+15
-19
未找到文件。
crypto/dsa/dsa_gen.c
浏览文件 @
08e1cbc6
...
...
@@ -111,7 +111,7 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
int
k
,
n
=
0
,
i
,
b
,
m
=
0
;
int
counter
=
0
;
int
r
=
0
;
BN_CTX
*
ctx
=
NULL
,
*
ctx2
=
NULL
,
*
ctx3
=
NULL
;
BN_CTX
*
ctx
=
NULL
;
unsigned
int
h
=
2
;
if
(
bits
<
512
)
bits
=
512
;
...
...
@@ -126,20 +126,18 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
memcpy
(
seed
,
seed_in
,
seed_len
);
if
((
ctx
=
BN_CTX_new
())
==
NULL
)
goto
err
;
if
((
ctx2
=
BN_CTX_new
())
==
NULL
)
goto
err
;
if
((
ctx3
=
BN_CTX_new
())
==
NULL
)
goto
err
;
if
((
mont
=
BN_MONT_CTX_new
())
==
NULL
)
goto
err
;
BN_CTX_start
(
ctx
2
);
r0
=
BN_CTX_get
(
ctx
2
);
g
=
BN_CTX_get
(
ctx
2
);
W
=
BN_CTX_get
(
ctx
2
);
q
=
BN_CTX_get
(
ctx
2
);
X
=
BN_CTX_get
(
ctx
2
);
c
=
BN_CTX_get
(
ctx
2
);
p
=
BN_CTX_get
(
ctx
2
);
test
=
BN_CTX_get
(
ctx
2
);
BN_CTX_start
(
ctx
);
r0
=
BN_CTX_get
(
ctx
);
g
=
BN_CTX_get
(
ctx
);
W
=
BN_CTX_get
(
ctx
);
q
=
BN_CTX_get
(
ctx
);
X
=
BN_CTX_get
(
ctx
);
c
=
BN_CTX_get
(
ctx
);
p
=
BN_CTX_get
(
ctx
);
test
=
BN_CTX_get
(
ctx
);
BN_lshift
(
test
,
BN_value_one
(),
bits
-
1
);
...
...
@@ -184,7 +182,7 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
if
(
!
BN_bin2bn
(
md
,
SHA_DIGEST_LENGTH
,
q
))
goto
err
;
/* step 4 */
r
=
BN_is_prime_fasttest_ex
(
q
,
DSS_prime_checks
,
ctx
3
,
r
=
BN_is_prime_fasttest_ex
(
q
,
DSS_prime_checks
,
ctx
,
seed_is_random
,
cb
);
if
(
r
>
0
)
break
;
...
...
@@ -247,7 +245,7 @@ static int dsa_builtin_paramgen(DSA *ret, int bits,
{
/* step 11 */
r
=
BN_is_prime_fasttest_ex
(
p
,
DSS_prime_checks
,
ctx
3
,
1
,
cb
);
ctx
,
1
,
cb
);
if
(
r
>
0
)
goto
end
;
/* found it */
if
(
r
!=
0
)
...
...
@@ -300,13 +298,11 @@ err:
if
(
counter_ret
!=
NULL
)
*
counter_ret
=
counter
;
if
(
h_ret
!=
NULL
)
*
h_ret
=
h
;
}
if
(
ctx
!=
NULL
)
BN_CTX_free
(
ctx
);
if
(
ctx2
!=
NULL
)
if
(
ctx
)
{
BN_CTX_end
(
ctx
2
);
BN_CTX_free
(
ctx
2
);
BN_CTX_end
(
ctx
);
BN_CTX_free
(
ctx
);
}
if
(
ctx3
!=
NULL
)
BN_CTX_free
(
ctx3
);
if
(
mont
!=
NULL
)
BN_MONT_CTX_free
(
mont
);
return
ok
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录