Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
9ccc00ef
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9ccc00ef
编写于
2月 02, 2015
作者:
R
Rich Salz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Dead code cleanup: #if 0 dropped from tests
Reviewed-by:
N
Andy Polyakov
<
appro@openssl.org
>
上级
7aa0b022
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
1 addition
and
366 deletion
+1
-366
crypto/bn/bntest.c
crypto/bn/bntest.c
+0
-140
crypto/cast/casttest.c
crypto/cast/casttest.c
+0
-28
crypto/des/destest.c
crypto/des/destest.c
+0
-5
crypto/ec/ectest.c
crypto/ec/ectest.c
+0
-157
crypto/ecdh/ecdhtest.c
crypto/ecdh/ecdhtest.c
+0
-22
crypto/evp/evp_test.c
crypto/evp/evp_test.c
+0
-3
ssl/ssltest.c
ssl/ssltest.c
+1
-11
未找到文件。
crypto/bn/bntest.c
浏览文件 @
9ccc00ef
...
@@ -1174,19 +1174,6 @@ int test_gf2m_add(BIO *bp)
...
@@ -1174,19 +1174,6 @@ int test_gf2m_add(BIO *bp)
a
->
neg
=
rand_neg
();
a
->
neg
=
rand_neg
();
b
->
neg
=
rand_neg
();
b
->
neg
=
rand_neg
();
BN_GF2m_add
(
c
,
a
,
b
);
BN_GF2m_add
(
c
,
a
,
b
);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" ^ "
);
BN_print
(
bp
,
b
);
BIO_puts
(
bp
,
" = "
);
}
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
"
\n
"
);
}
# endif
/* Test that two added values have the correct parity. */
/* Test that two added values have the correct parity. */
if
((
BN_is_odd
(
a
)
&&
BN_is_odd
(
c
))
if
((
BN_is_odd
(
a
)
&&
BN_is_odd
(
c
))
||
(
!
BN_is_odd
(
a
)
&&
!
BN_is_odd
(
c
)))
{
||
(
!
BN_is_odd
(
a
)
&&
!
BN_is_odd
(
c
)))
{
...
@@ -1229,19 +1216,6 @@ int test_gf2m_mod(BIO *bp)
...
@@ -1229,19 +1216,6 @@ int test_gf2m_mod(BIO *bp)
BN_bntest_rand
(
a
,
1024
,
0
,
0
);
BN_bntest_rand
(
a
,
1024
,
0
,
0
);
for
(
j
=
0
;
j
<
2
;
j
++
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
BN_GF2m_mod
(
c
,
a
,
b
[
j
]);
BN_GF2m_mod
(
c
,
a
,
b
[
j
]);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
" - "
);
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
BN_GF2m_add
(
d
,
a
,
c
);
BN_GF2m_add
(
d
,
a
,
c
);
BN_GF2m_mod
(
e
,
d
,
b
[
j
]);
BN_GF2m_mod
(
e
,
d
,
b
[
j
]);
/* Test that a + (a mod p) mod p == 0. */
/* Test that a + (a mod p) mod p == 0. */
...
@@ -1288,21 +1262,6 @@ int test_gf2m_mod_mul(BIO *bp, BN_CTX *ctx)
...
@@ -1288,21 +1262,6 @@ int test_gf2m_mod_mul(BIO *bp, BN_CTX *ctx)
BN_bntest_rand
(
d
,
1024
,
0
,
0
);
BN_bntest_rand
(
d
,
1024
,
0
,
0
);
for
(
j
=
0
;
j
<
2
;
j
++
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
BN_GF2m_mod_mul
(
e
,
a
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
e
,
a
,
c
,
b
[
j
],
ctx
);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" * "
);
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
" % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
" - "
);
BN_print
(
bp
,
e
);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
BN_GF2m_add
(
f
,
a
,
d
);
BN_GF2m_add
(
f
,
a
,
d
);
BN_GF2m_mod_mul
(
g
,
f
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
g
,
f
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
h
,
d
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
h
,
d
,
c
,
b
[
j
],
ctx
);
...
@@ -1352,21 +1311,6 @@ int test_gf2m_mod_sqr(BIO *bp, BN_CTX *ctx)
...
@@ -1352,21 +1311,6 @@ int test_gf2m_mod_sqr(BIO *bp, BN_CTX *ctx)
BN_GF2m_mod_sqr
(
c
,
a
,
b
[
j
],
ctx
);
BN_GF2m_mod_sqr
(
c
,
a
,
b
[
j
],
ctx
);
BN_copy
(
d
,
a
);
BN_copy
(
d
,
a
);
BN_GF2m_mod_mul
(
d
,
a
,
d
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
d
,
a
,
d
,
b
[
j
],
ctx
);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" ^ 2 % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
" = "
);
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
"; a * a = "
);
BN_print
(
bp
,
d
);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
BN_GF2m_add
(
d
,
c
,
d
);
BN_GF2m_add
(
d
,
c
,
d
);
/* Test that a*a = a^2. */
/* Test that a*a = a^2. */
if
(
!
BN_is_zero
(
d
))
{
if
(
!
BN_is_zero
(
d
))
{
...
@@ -1406,19 +1350,6 @@ int test_gf2m_mod_inv(BIO *bp, BN_CTX *ctx)
...
@@ -1406,19 +1350,6 @@ int test_gf2m_mod_inv(BIO *bp, BN_CTX *ctx)
for
(
j
=
0
;
j
<
2
;
j
++
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
BN_GF2m_mod_inv
(
c
,
a
,
b
[
j
],
ctx
);
BN_GF2m_mod_inv
(
c
,
a
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
d
,
a
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
d
,
a
,
c
,
b
[
j
],
ctx
);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" * "
);
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
" - 1 % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
/* Test that ((1/a)*a) = 1. */
/* Test that ((1/a)*a) = 1. */
if
(
!
BN_is_one
(
d
))
{
if
(
!
BN_is_one
(
d
))
{
fprintf
(
stderr
,
"GF(2^m) modular inversion test failed!
\n
"
);
fprintf
(
stderr
,
"GF(2^m) modular inversion test failed!
\n
"
);
...
@@ -1461,21 +1392,6 @@ int test_gf2m_mod_div(BIO *bp, BN_CTX *ctx)
...
@@ -1461,21 +1392,6 @@ int test_gf2m_mod_div(BIO *bp, BN_CTX *ctx)
BN_GF2m_mod_div
(
d
,
a
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_div
(
d
,
a
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
e
,
d
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
e
,
d
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_div
(
f
,
a
,
e
,
b
[
j
],
ctx
);
BN_GF2m_mod_div
(
f
,
a
,
e
,
b
[
j
],
ctx
);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" = "
);
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
" * "
);
BN_print
(
bp
,
d
);
BIO_puts
(
bp
,
" % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
/* Test that ((a/c)*c)/a = 1. */
/* Test that ((a/c)*c)/a = 1. */
if
(
!
BN_is_one
(
f
))
{
if
(
!
BN_is_one
(
f
))
{
fprintf
(
stderr
,
"GF(2^m) modular division test failed!
\n
"
);
fprintf
(
stderr
,
"GF(2^m) modular division test failed!
\n
"
);
...
@@ -1523,25 +1439,6 @@ int test_gf2m_mod_exp(BIO *bp, BN_CTX *ctx)
...
@@ -1523,25 +1439,6 @@ int test_gf2m_mod_exp(BIO *bp, BN_CTX *ctx)
BN_GF2m_mod_mul
(
e
,
e
,
f
,
b
[
j
],
ctx
);
BN_GF2m_mod_mul
(
e
,
e
,
f
,
b
[
j
],
ctx
);
BN_add
(
f
,
c
,
d
);
BN_add
(
f
,
c
,
d
);
BN_GF2m_mod_exp
(
f
,
a
,
f
,
b
[
j
],
ctx
);
BN_GF2m_mod_exp
(
f
,
a
,
f
,
b
[
j
],
ctx
);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" ^ ("
);
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
" + "
);
BN_print
(
bp
,
d
);
BIO_puts
(
bp
,
") = "
);
BN_print
(
bp
,
e
);
BIO_puts
(
bp
,
"; - "
);
BN_print
(
bp
,
f
);
BIO_puts
(
bp
,
" % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
BN_GF2m_add
(
f
,
e
,
f
);
BN_GF2m_add
(
f
,
e
,
f
);
/* Test that a^(c+d)=a^c*a^d. */
/* Test that a^(c+d)=a^c*a^d. */
if
(
!
BN_is_zero
(
f
))
{
if
(
!
BN_is_zero
(
f
))
{
...
@@ -1587,17 +1484,6 @@ int test_gf2m_mod_sqrt(BIO *bp, BN_CTX *ctx)
...
@@ -1587,17 +1484,6 @@ int test_gf2m_mod_sqrt(BIO *bp, BN_CTX *ctx)
BN_GF2m_mod
(
c
,
a
,
b
[
j
]);
BN_GF2m_mod
(
c
,
a
,
b
[
j
]);
BN_GF2m_mod_sqrt
(
d
,
a
,
b
[
j
],
ctx
);
BN_GF2m_mod_sqrt
(
d
,
a
,
b
[
j
],
ctx
);
BN_GF2m_mod_sqr
(
e
,
d
,
b
[
j
],
ctx
);
BN_GF2m_mod_sqr
(
e
,
d
,
b
[
j
],
ctx
);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
d
);
BIO_puts
(
bp
,
" ^ 2 - "
);
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
BN_GF2m_add
(
f
,
c
,
e
);
BN_GF2m_add
(
f
,
c
,
e
);
/* Test that d^2 = a, where d = sqrt(a). */
/* Test that d^2 = a, where d = sqrt(a). */
if
(
!
BN_is_zero
(
f
))
{
if
(
!
BN_is_zero
(
f
))
{
...
@@ -1644,19 +1530,6 @@ int test_gf2m_mod_solve_quad(BIO *bp, BN_CTX *ctx)
...
@@ -1644,19 +1530,6 @@ int test_gf2m_mod_solve_quad(BIO *bp, BN_CTX *ctx)
BN_GF2m_mod_sqr
(
d
,
c
,
b
[
j
],
ctx
);
BN_GF2m_mod_sqr
(
d
,
c
,
b
[
j
],
ctx
);
BN_GF2m_add
(
d
,
c
,
d
);
BN_GF2m_add
(
d
,
c
,
d
);
BN_GF2m_mod
(
e
,
a
,
b
[
j
]);
BN_GF2m_mod
(
e
,
a
,
b
[
j
]);
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BN_print
(
bp
,
c
);
BIO_puts
(
bp
,
" is root of z^2 + z = "
);
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
BN_GF2m_add
(
e
,
e
,
d
);
BN_GF2m_add
(
e
,
e
,
d
);
/*
/*
* Test that solution of quadratic c satisfies c^2 + c = a.
* Test that solution of quadratic c satisfies c^2 + c = a.
...
@@ -1667,19 +1540,6 @@ int test_gf2m_mod_solve_quad(BIO *bp, BN_CTX *ctx)
...
@@ -1667,19 +1540,6 @@ int test_gf2m_mod_solve_quad(BIO *bp, BN_CTX *ctx)
goto
err
;
goto
err
;
}
}
}
else
{
# if 0
/* make test uses ouput in bc but bc can't
* handle GF(2^m) arithmetic */
if
(
bp
!=
NULL
)
{
if
(
!
results
)
{
BIO_puts
(
bp
,
"There are no roots of z^2 + z = "
);
BN_print
(
bp
,
a
);
BIO_puts
(
bp
,
" % "
);
BN_print
(
bp
,
b
[
j
]);
BIO_puts
(
bp
,
"
\n
"
);
}
}
# endif
}
}
}
}
}
}
...
...
crypto/cast/casttest.c
浏览文件 @
9ccc00ef
...
@@ -112,34 +112,6 @@ static unsigned char c_b[16] = {
...
@@ -112,34 +112,6 @@ static unsigned char c_b[16] = {
0x80
,
0xAC
,
0x05
,
0xB8
,
0xE8
,
0x3D
,
0x69
,
0x6E
0x80
,
0xAC
,
0x05
,
0xB8
,
0xE8
,
0x3D
,
0x69
,
0x6E
};
};
# if 0
char
*
text
=
"Hello to all people out there"
;
static
unsigned
char
cfb_key
[
16
]
=
{
0xe1
,
0xf0
,
0xc3
,
0xd2
,
0xa5
,
0xb4
,
0x87
,
0x96
,
0x69
,
0x78
,
0x4b
,
0x5a
,
0x2d
,
0x3c
,
0x0f
,
0x1e
,
};
static
unsigned
char
cfb_iv
[
80
]
=
{
0x34
,
0x12
,
0x78
,
0x56
,
0xab
,
0x90
,
0xef
,
0xcd
};
static
unsigned
char
cfb_buf1
[
40
],
cfb_buf2
[
40
],
cfb_tmp
[
8
];
# define CFB_TEST_SIZE 24
static
unsigned
char
plain
[
CFB_TEST_SIZE
]
=
{
0x4e
,
0x6f
,
0x77
,
0x20
,
0x69
,
0x73
,
0x20
,
0x74
,
0x68
,
0x65
,
0x20
,
0x74
,
0x69
,
0x6d
,
0x65
,
0x20
,
0x66
,
0x6f
,
0x72
,
0x20
,
0x61
,
0x6c
,
0x6c
,
0x20
};
static
unsigned
char
cfb_cipher64
[
CFB_TEST_SIZE
]
=
{
0x59
,
0xD8
,
0xE2
,
0x65
,
0x00
,
0x58
,
0x6C
,
0x3F
,
0x2C
,
0x17
,
0x25
,
0xD0
,
0x1A
,
0x38
,
0xB7
,
0x2A
,
0x39
,
0x61
,
0x37
,
0xDC
,
0x79
,
0xFB
,
0x9F
,
0x45
/*- 0xF9,0x78,0x32,0xB5,0x42,0x1A,0x6B,0x38,
0x9A,0x44,0xD6,0x04,0x19,0x43,0xC4,0xD9,
0x3D,0x1E,0xAE,0x47,0xFC,0xCF,0x29,0x0B,*/
};
# endif
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
# ifdef FULL_TEST
# ifdef FULL_TEST
...
...
crypto/des/destest.c
浏览文件 @
9ccc00ef
...
@@ -345,12 +345,7 @@ static unsigned char ofb_cipher[24] = {
...
@@ -345,12 +345,7 @@ static unsigned char ofb_cipher[24] = {
0x35
,
0xf2
,
0x4a
,
0x24
,
0x2e
,
0xeb
,
0x3d
,
0x3f
,
0x35
,
0xf2
,
0x4a
,
0x24
,
0x2e
,
0xeb
,
0x3d
,
0x3f
,
0x3d
,
0x6d
,
0x5b
,
0xe3
,
0x25
,
0x5a
,
0xf8
,
0xc3
0x3d
,
0x6d
,
0x5b
,
0xe3
,
0x25
,
0x5a
,
0xf8
,
0xc3
};
};
# if 0
static
DES_LONG
cbc_cksum_ret
=
0xB462FEF7L
;
# else
static
DES_LONG
cbc_cksum_ret
=
0xF7FE62B4L
;
static
DES_LONG
cbc_cksum_ret
=
0xF7FE62B4L
;
# endif
static
unsigned
char
cbc_cksum_data
[
8
]
=
static
unsigned
char
cbc_cksum_data
[
8
]
=
{
0x1D
,
0x26
,
0x93
,
0x97
,
0xf7
,
0xfe
,
0x62
,
0xb4
};
{
0x1D
,
0x26
,
0x93
,
0x97
,
0xf7
,
0xfe
,
0x62
,
0xb4
};
...
...
crypto/ec/ectest.c
浏览文件 @
9ccc00ef
...
@@ -114,93 +114,6 @@ int main(int argc, char *argv[])
...
@@ -114,93 +114,6 @@ int main(int argc, char *argv[])
# define TIMING_RAND_PT 1
# define TIMING_RAND_PT 1
# define TIMING_SIMUL 2
# define TIMING_SIMUL 2
# if 0
static
void
timings
(
EC_GROUP
*
group
,
int
type
,
BN_CTX
*
ctx
)
{
clock_t
clck
;
int
i
,
j
;
BIGNUM
*
s
;
BIGNUM
*
r
[
10
],
*
r0
[
10
];
EC_POINT
*
P
;
s
=
BN_new
();
if
(
s
==
NULL
)
ABORT
;
fprintf
(
stdout
,
"Timings for %d-bit field, "
,
EC_GROUP_get_degree
(
group
));
if
(
!
EC_GROUP_get_order
(
group
,
s
,
ctx
))
ABORT
;
fprintf
(
stdout
,
"%d-bit scalars "
,
(
int
)
BN_num_bits
(
s
));
fflush
(
stdout
);
P
=
EC_POINT_new
(
group
);
if
(
P
==
NULL
)
ABORT
;
EC_POINT_copy
(
P
,
EC_GROUP_get0_generator
(
group
));
for
(
i
=
0
;
i
<
10
;
i
++
)
{
if
((
r
[
i
]
=
BN_new
())
==
NULL
)
ABORT
;
if
(
!
BN_pseudo_rand
(
r
[
i
],
BN_num_bits
(
s
),
0
,
0
))
ABORT
;
if
(
type
!=
TIMING_BASE_PT
)
{
if
((
r0
[
i
]
=
BN_new
())
==
NULL
)
ABORT
;
if
(
!
BN_pseudo_rand
(
r0
[
i
],
BN_num_bits
(
s
),
0
,
0
))
ABORT
;
}
}
clck
=
clock
();
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
j
=
0
;
j
<
10
;
j
++
)
{
if
(
!
EC_POINT_mul
(
group
,
P
,
(
type
!=
TIMING_RAND_PT
)
?
r
[
i
]
:
NULL
,
(
type
!=
TIMING_BASE_PT
)
?
P
:
NULL
,
(
type
!=
TIMING_BASE_PT
)
?
r0
[
i
]
:
NULL
,
ctx
))
ABORT
;
}
}
clck
=
clock
()
-
clck
;
fprintf
(
stdout
,
"
\n
"
);
# ifdef CLOCKS_PER_SEC
/*
* "To determine the time in seconds, the value returned by the clock
* function should be divided by the value of the macro CLOCKS_PER_SEC."
* -- ISO/IEC 9899
*/
# define UNIT "s"
# else
# define UNIT "units"
# define CLOCKS_PER_SEC 1
# endif
if
(
type
==
TIMING_BASE_PT
)
{
fprintf
(
stdout
,
"%i %s in %.2f "
UNIT
"
\n
"
,
i
*
j
,
"base point multiplications"
,
(
double
)
clck
/
CLOCKS_PER_SEC
);
}
else
if
(
type
==
TIMING_RAND_PT
)
{
fprintf
(
stdout
,
"%i %s in %.2f "
UNIT
"
\n
"
,
i
*
j
,
"random point multiplications"
,
(
double
)
clck
/
CLOCKS_PER_SEC
);
}
else
if
(
type
==
TIMING_SIMUL
)
{
fprintf
(
stdout
,
"%i %s in %.2f "
UNIT
"
\n
"
,
i
*
j
,
"s*P+t*Q operations"
,
(
double
)
clck
/
CLOCKS_PER_SEC
);
}
fprintf
(
stdout
,
"average: %.4f "
UNIT
"
\n
"
,
(
double
)
clck
/
(
CLOCKS_PER_SEC
*
i
*
j
));
EC_POINT_free
(
P
);
BN_free
(
s
);
for
(
i
=
0
;
i
<
10
;
i
++
)
{
BN_free
(
r
[
i
]);
if
(
type
!=
TIMING_BASE_PT
)
BN_free
(
r0
[
i
]);
}
}
# endif
/* test multiplication with group order, long and negative scalars */
/* test multiplication with group order, long and negative scalars */
static
void
group_order_tests
(
EC_GROUP
*
group
)
static
void
group_order_tests
(
EC_GROUP
*
group
)
{
{
...
@@ -443,18 +356,6 @@ static void prime_field_tests(void)
...
@@ -443,18 +356,6 @@ static void prime_field_tests(void)
if
(
!
EC_POINT_add
(
group
,
P
,
P
,
Q
,
ctx
))
if
(
!
EC_POINT_add
(
group
,
P
,
P
,
Q
,
ctx
))
ABORT
;
ABORT
;
# if 0
/* optional */
{
EC_POINT
*
points
[
3
];
points
[
0
]
=
R
;
points
[
1
]
=
Q
;
points
[
2
]
=
P
;
if
(
!
EC_POINTs_make_affine
(
group
,
2
,
points
,
ctx
))
ABORT
;
}
# endif
}
}
while
(
!
EC_POINT_is_at_infinity
(
group
,
P
));
while
(
!
EC_POINT_is_at_infinity
(
group
,
P
));
...
@@ -952,27 +853,6 @@ static void prime_field_tests(void)
...
@@ -952,27 +853,6 @@ static void prime_field_tests(void)
BN_free
(
scalar3
);
BN_free
(
scalar3
);
}
}
# if 0
timings
(
P_160
,
TIMING_BASE_PT
,
ctx
);
timings
(
P_160
,
TIMING_RAND_PT
,
ctx
);
timings
(
P_160
,
TIMING_SIMUL
,
ctx
);
timings
(
P_192
,
TIMING_BASE_PT
,
ctx
);
timings
(
P_192
,
TIMING_RAND_PT
,
ctx
);
timings
(
P_192
,
TIMING_SIMUL
,
ctx
);
timings
(
P_224
,
TIMING_BASE_PT
,
ctx
);
timings
(
P_224
,
TIMING_RAND_PT
,
ctx
);
timings
(
P_224
,
TIMING_SIMUL
,
ctx
);
timings
(
P_256
,
TIMING_BASE_PT
,
ctx
);
timings
(
P_256
,
TIMING_RAND_PT
,
ctx
);
timings
(
P_256
,
TIMING_SIMUL
,
ctx
);
timings
(
P_384
,
TIMING_BASE_PT
,
ctx
);
timings
(
P_384
,
TIMING_RAND_PT
,
ctx
);
timings
(
P_384
,
TIMING_SIMUL
,
ctx
);
timings
(
P_521
,
TIMING_BASE_PT
,
ctx
);
timings
(
P_521
,
TIMING_RAND_PT
,
ctx
);
timings
(
P_521
,
TIMING_SIMUL
,
ctx
);
# endif
if
(
ctx
)
if
(
ctx
)
BN_CTX_free
(
ctx
);
BN_CTX_free
(
ctx
);
BN_free
(
p
);
BN_free
(
p
);
...
@@ -1456,39 +1336,6 @@ static void char2_field_tests(void)
...
@@ -1456,39 +1336,6 @@ static void char2_field_tests(void)
fprintf
(
stdout
,
" ok
\n\n
"
);
fprintf
(
stdout
,
" ok
\n\n
"
);
}
}
# if 0
timings
(
C2_K163
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_K163
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_K163
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_B163
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_B163
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_B163
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_K233
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_K233
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_K233
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_B233
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_B233
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_B233
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_K283
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_K283
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_K283
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_B283
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_B283
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_B283
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_K409
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_K409
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_K409
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_B409
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_B409
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_B409
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_K571
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_K571
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_K571
,
TIMING_SIMUL
,
ctx
);
timings
(
C2_B571
,
TIMING_BASE_PT
,
ctx
);
timings
(
C2_B571
,
TIMING_RAND_PT
,
ctx
);
timings
(
C2_B571
,
TIMING_SIMUL
,
ctx
);
# endif
if
(
ctx
)
if
(
ctx
)
BN_CTX_free
(
ctx
);
BN_CTX_free
(
ctx
);
BN_free
(
p
);
BN_free
(
p
);
...
@@ -1783,10 +1630,6 @@ static void nistp_single_test(const struct nistp_test_params *test)
...
@@ -1783,10 +1630,6 @@ static void nistp_single_test(const struct nistp_test_params *test)
fprintf
(
stdout
,
"ok
\n
"
);
fprintf
(
stdout
,
"ok
\n
"
);
group_order_tests
(
NISTP
);
group_order_tests
(
NISTP
);
# if 0
timings
(
NISTP
,
TIMING_BASE_PT
,
ctx
);
timings
(
NISTP
,
TIMING_RAND_PT
,
ctx
);
# endif
EC_GROUP_free
(
NISTP
);
EC_GROUP_free
(
NISTP
);
EC_POINT_free
(
G
);
EC_POINT_free
(
G
);
EC_POINT_free
(
P
);
EC_POINT_free
(
P
);
...
...
crypto/ecdh/ecdhtest.c
浏览文件 @
9ccc00ef
...
@@ -92,10 +92,6 @@ int main(int argc, char *argv[])
...
@@ -92,10 +92,6 @@ int main(int argc, char *argv[])
# include <openssl/ec.h>
# include <openssl/ec.h>
# include <openssl/ecdh.h>
# include <openssl/ecdh.h>
# if 0
static
void
cb
(
int
p
,
int
n
,
void
*
arg
);
# endif
static
const
char
rnd_seed
[]
=
static
const
char
rnd_seed
[]
=
"string to make the random number generator think it has entropy"
;
"string to make the random number generator think it has entropy"
;
...
@@ -544,22 +540,4 @@ int main(int argc, char *argv[])
...
@@ -544,22 +540,4 @@ int main(int argc, char *argv[])
CRYPTO_mem_leaks_fp
(
stderr
);
CRYPTO_mem_leaks_fp
(
stderr
);
EXIT
(
ret
);
EXIT
(
ret
);
}
}
# if 0
static
void
cb
(
int
p
,
int
n
,
void
*
arg
)
{
char
c
=
'*'
;
if
(
p
==
0
)
c
=
'.'
;
if
(
p
==
1
)
c
=
'+'
;
if
(
p
==
2
)
c
=
'*'
;
if
(
p
==
3
)
c
=
'\n'
;
BIO_write
((
BIO
*
)
arg
,
&
c
,
1
);
(
void
)
BIO_flush
((
BIO
*
)
arg
);
}
# endif
#endif
#endif
crypto/evp/evp_test.c
浏览文件 @
9ccc00ef
...
@@ -480,9 +480,6 @@ int main(int argc, char **argv)
...
@@ -480,9 +480,6 @@ int main(int argc, char **argv)
/* Load all compiled-in ENGINEs */
/* Load all compiled-in ENGINEs */
ENGINE_load_builtin_engines
();
ENGINE_load_builtin_engines
();
#endif
#endif
#if 0
OPENSSL_config();
#endif
#ifndef OPENSSL_NO_ENGINE
#ifndef OPENSSL_NO_ENGINE
/*
/*
* Register all available ENGINE implementations of ciphers and digests.
* Register all available ENGINE implementations of ciphers and digests.
...
...
ssl/ssltest.c
浏览文件 @
9ccc00ef
...
@@ -740,13 +740,6 @@ static int custom_ext_3_srv_add_cb(SSL *s, unsigned int ext_type,
...
@@ -740,13 +740,6 @@ static int custom_ext_3_srv_add_cb(SSL *s, unsigned int ext_type,
static
char
*
cipher
=
NULL
;
static
char
*
cipher
=
NULL
;
static
int
verbose
=
0
;
static
int
verbose
=
0
;
static
int
debug
=
0
;
static
int
debug
=
0
;
#if 0
/* Not used yet. */
# ifdef FIONBIO
static int s_nbio = 0;
# endif
#endif
static
const
char
rnd_seed
[]
=
static
const
char
rnd_seed
[]
=
"string to make the random number generator think it has entropy"
;
"string to make the random number generator think it has entropy"
;
...
@@ -754,6 +747,7 @@ int doit_biopair(SSL *s_ssl, SSL *c_ssl, long bytes, clock_t *s_time,
...
@@ -754,6 +747,7 @@ int doit_biopair(SSL *s_ssl, SSL *c_ssl, long bytes, clock_t *s_time,
clock_t
*
c_time
);
clock_t
*
c_time
);
int
doit
(
SSL
*
s_ssl
,
SSL
*
c_ssl
,
long
bytes
);
int
doit
(
SSL
*
s_ssl
,
SSL
*
c_ssl
,
long
bytes
);
static
int
do_test_cipherlist
(
void
);
static
int
do_test_cipherlist
(
void
);
static
void
sv_usage
(
void
)
static
void
sv_usage
(
void
)
{
{
fprintf
(
stderr
,
"usage: ssltest [args ...]
\n
"
);
fprintf
(
stderr
,
"usage: ssltest [args ...]
\n
"
);
...
@@ -2487,10 +2481,6 @@ static int verify_callback(int ok, X509_STORE_CTX *ctx)
...
@@ -2487,10 +2481,6 @@ static int verify_callback(int ok, X509_STORE_CTX *ctx)
if
(
ok
==
1
)
{
if
(
ok
==
1
)
{
X509
*
xs
=
ctx
->
current_cert
;
X509
*
xs
=
ctx
->
current_cert
;
#if 0
X509 *xi = ctx->current_issuer;
#endif
if
(
xs
->
ex_flags
&
EXFLAG_PROXY
)
{
if
(
xs
->
ex_flags
&
EXFLAG_PROXY
)
{
unsigned
int
*
letters
=
X509_STORE_CTX_get_ex_data
(
ctx
,
unsigned
int
*
letters
=
X509_STORE_CTX_get_ex_data
(
ctx
,
get_proxy_auth_ex_data_idx
get_proxy_auth_ex_data_idx
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录