Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
ae93dc13
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看板
提交
ae93dc13
编写于
12月 01, 2006
作者:
N
Nils Larsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add support for whirlpool in apps/speed
PR: 1338 Submitted by: justin@soze.net
上级
77e87e61
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
3 deletion
+35
-3
apps/speed.c
apps/speed.c
+35
-3
未找到文件。
apps/speed.c
浏览文件 @
ae93dc13
...
@@ -144,6 +144,9 @@
...
@@ -144,6 +144,9 @@
#ifndef OPENSSL_NO_RIPEMD
#ifndef OPENSSL_NO_RIPEMD
#include <openssl/ripemd.h>
#include <openssl/ripemd.h>
#endif
#endif
#ifndef OPENSSL_NO_WHIRLPOOL
#include <openssl/whrlpool.h>
#endif
#ifndef OPENSSL_NO_RC4
#ifndef OPENSSL_NO_RC4
#include <openssl/rc4.h>
#include <openssl/rc4.h>
#endif
#endif
...
@@ -198,7 +201,7 @@ static void print_result(int alg,int run_no,int count,double time_used);
...
@@ -198,7 +201,7 @@ static void print_result(int alg,int run_no,int count,double time_used);
static
int
do_multi
(
int
multi
);
static
int
do_multi
(
int
multi
);
#endif
#endif
#define ALGOR_NUM 2
4
#define ALGOR_NUM 2
5
#define SIZE_NUM 5
#define SIZE_NUM 5
#define RSA_NUM 4
#define RSA_NUM 4
#define DSA_NUM 3
#define DSA_NUM 3
...
@@ -212,7 +215,7 @@ static const char *names[ALGOR_NUM]={
...
@@ -212,7 +215,7 @@ static const char *names[ALGOR_NUM]={
"rc2 cbc"
,
"rc5-32/12 cbc"
,
"blowfish cbc"
,
"cast cbc"
,
"rc2 cbc"
,
"rc5-32/12 cbc"
,
"blowfish cbc"
,
"cast cbc"
,
"aes-128 cbc"
,
"aes-192 cbc"
,
"aes-256 cbc"
,
"aes-128 cbc"
,
"aes-192 cbc"
,
"aes-256 cbc"
,
"camellia-128 cbc"
,
"camellia-192 cbc"
,
"camellia-256 cbc"
,
"camellia-128 cbc"
,
"camellia-192 cbc"
,
"camellia-256 cbc"
,
"evp"
,
"sha256"
,
"sha512"
};
"evp"
,
"sha256"
,
"sha512"
,
"whirlpool"
};
static
double
results
[
ALGOR_NUM
][
SIZE_NUM
];
static
double
results
[
ALGOR_NUM
][
SIZE_NUM
];
static
int
lengths
[
SIZE_NUM
]
=
{
16
,
64
,
256
,
1024
,
8
*
1024
};
static
int
lengths
[
SIZE_NUM
]
=
{
16
,
64
,
256
,
1024
,
8
*
1024
};
static
double
rsa_results
[
RSA_NUM
][
2
];
static
double
rsa_results
[
RSA_NUM
][
2
];
...
@@ -349,6 +352,9 @@ int MAIN(int argc, char **argv)
...
@@ -349,6 +352,9 @@ int MAIN(int argc, char **argv)
unsigned
char
sha512
[
SHA512_DIGEST_LENGTH
];
unsigned
char
sha512
[
SHA512_DIGEST_LENGTH
];
#endif
#endif
#endif
#endif
#ifndef OPENSSL_NO_WHIRLPOOL
unsigned
char
whirlpool
[
WHIRLPOOL_DIGEST_LENGTH
];
#endif
#ifndef OPENSSL_NO_RIPEMD
#ifndef OPENSSL_NO_RIPEMD
unsigned
char
rmd160
[
RIPEMD160_DIGEST_LENGTH
];
unsigned
char
rmd160
[
RIPEMD160_DIGEST_LENGTH
];
#endif
#endif
...
@@ -441,6 +447,7 @@ int MAIN(int argc, char **argv)
...
@@ -441,6 +447,7 @@ int MAIN(int argc, char **argv)
#define D_EVP 21
#define D_EVP 21
#define D_SHA256 22
#define D_SHA256 22
#define D_SHA512 23
#define D_SHA512 23
#define D_WHIRLPOOL 24
double
d
=
0
.
0
;
double
d
=
0
.
0
;
long
c
[
ALGOR_NUM
][
SIZE_NUM
];
long
c
[
ALGOR_NUM
][
SIZE_NUM
];
#define R_DSA_512 0
#define R_DSA_512 0
...
@@ -760,6 +767,10 @@ int MAIN(int argc, char **argv)
...
@@ -760,6 +767,10 @@ int MAIN(int argc, char **argv)
else
else
#endif
#endif
#endif
#endif
#ifndef OPENSSL_NO_WHIRLPOOL
if
(
strcmp
(
*
argv
,
"whirlpool"
)
==
0
)
doit
[
D_WHIRLPOOL
]
=
1
;
else
#endif
#ifndef OPENSSL_NO_RIPEMD
#ifndef OPENSSL_NO_RIPEMD
if
(
strcmp
(
*
argv
,
"ripemd"
)
==
0
)
doit
[
D_RMD160
]
=
1
;
if
(
strcmp
(
*
argv
,
"ripemd"
)
==
0
)
doit
[
D_RMD160
]
=
1
;
else
else
...
@@ -963,12 +974,16 @@ int MAIN(int argc, char **argv)
...
@@ -963,12 +974,16 @@ int MAIN(int argc, char **argv)
#ifndef OPENSSL_NO_SHA512
#ifndef OPENSSL_NO_SHA512
BIO_printf
(
bio_err
,
"sha512 "
);
BIO_printf
(
bio_err
,
"sha512 "
);
#endif
#endif
#ifndef OPENSSL_NO_WHIRLPOOL
BIO_printf
(
bio_err
,
"whirlpool"
);
#endif
#ifndef OPENSSL_NO_RIPEMD160
#ifndef OPENSSL_NO_RIPEMD160
BIO_printf
(
bio_err
,
"rmd160"
);
BIO_printf
(
bio_err
,
"rmd160"
);
#endif
#endif
#if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \
#if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \
!defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \
!defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \
!defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160)
!defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) || \
!defined(OPENSSL_NO_WHIRLPOOL)
BIO_printf
(
bio_err
,
"
\n
"
);
BIO_printf
(
bio_err
,
"
\n
"
);
#endif
#endif
...
@@ -1199,6 +1214,7 @@ int MAIN(int argc, char **argv)
...
@@ -1199,6 +1214,7 @@ int MAIN(int argc, char **argv)
c
[
D_CBC_256_CML
][
0
]
=
count
;
c
[
D_CBC_256_CML
][
0
]
=
count
;
c
[
D_SHA256
][
0
]
=
count
;
c
[
D_SHA256
][
0
]
=
count
;
c
[
D_SHA512
][
0
]
=
count
;
c
[
D_SHA512
][
0
]
=
count
;
c
[
D_WHIRLPOOL
][
0
]
=
count
;
for
(
i
=
1
;
i
<
SIZE_NUM
;
i
++
)
for
(
i
=
1
;
i
<
SIZE_NUM
;
i
++
)
{
{
...
@@ -1211,6 +1227,7 @@ int MAIN(int argc, char **argv)
...
@@ -1211,6 +1227,7 @@ int MAIN(int argc, char **argv)
c
[
D_RMD160
][
i
]
=
c
[
D_RMD160
][
0
]
*
4
*
lengths
[
0
]
/
lengths
[
i
];
c
[
D_RMD160
][
i
]
=
c
[
D_RMD160
][
0
]
*
4
*
lengths
[
0
]
/
lengths
[
i
];
c
[
D_SHA256
][
i
]
=
c
[
D_SHA256
][
0
]
*
4
*
lengths
[
0
]
/
lengths
[
i
];
c
[
D_SHA256
][
i
]
=
c
[
D_SHA256
][
0
]
*
4
*
lengths
[
0
]
/
lengths
[
i
];
c
[
D_SHA512
][
i
]
=
c
[
D_SHA512
][
0
]
*
4
*
lengths
[
0
]
/
lengths
[
i
];
c
[
D_SHA512
][
i
]
=
c
[
D_SHA512
][
0
]
*
4
*
lengths
[
0
]
/
lengths
[
i
];
c
[
D_WHIRLPOOL
][
i
]
=
c
[
D_WHIRLPOOL
][
0
]
*
4
*
lengths
[
0
]
/
lengths
[
i
];
}
}
for
(
i
=
1
;
i
<
SIZE_NUM
;
i
++
)
for
(
i
=
1
;
i
<
SIZE_NUM
;
i
++
)
{
{
...
@@ -1522,8 +1539,23 @@ int MAIN(int argc, char **argv)
...
@@ -1522,8 +1539,23 @@ int MAIN(int argc, char **argv)
}
}
}
}
#endif
#endif
#endif
#ifndef OPENSSL_NO_WHIRLPOOL
if
(
doit
[
D_WHIRLPOOL
])
{
for
(
j
=
0
;
j
<
SIZE_NUM
;
j
++
)
{
print_message
(
names
[
D_WHIRLPOOL
],
c
[
D_WHIRLPOOL
][
j
],
lengths
[
j
]);
Time_F
(
START
);
for
(
count
=
0
,
run
=
1
;
COND
(
c
[
D_WHIRLPOOL
][
j
]);
count
++
)
WHIRLPOOL
(
buf
,
lengths
[
j
],
whirlpool
);
d
=
Time_F
(
STOP
);
print_result
(
D_WHIRLPOOL
,
j
,
count
,
d
);
}
}
#endif
#endif
#ifndef OPENSSL_NO_RIPEMD
#ifndef OPENSSL_NO_RIPEMD
if
(
doit
[
D_RMD160
])
if
(
doit
[
D_RMD160
])
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录