Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
M
mbedtls
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
Wiki
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
产物
部署
发布
Package registry
容器镜像库
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
esp-mirror
Mbed-TLS
mbedtls
提交
fc36d16e
提交
fc36d16e
编辑于
14 years ago
作者:
Paul Bakker
浏览文件
操作
下载
补丁
差异文件
- Added random generation example application
上级
dbee2cad
No related branches found
No related tags found
无相关合并请求
变更
4
隐藏空白变更内容
行内
左右并排
显示
4 个更改的文件
programs/CMakeLists.txt
+1
-0
1 个添加, 0 个删除
programs/CMakeLists.txt
programs/Makefile
+8
-3
8 个添加, 3 个删除
programs/Makefile
programs/random/CMakeLists.txt
+6
-0
6 个添加, 0 个删除
programs/random/CMakeLists.txt
programs/random/gen_random.c
+72
-0
72 个添加, 0 个删除
programs/random/gen_random.c
有
87 个添加
和
3 个删除
programs/CMakeLists.txt
+
1
−
0
浏览文件 @
fc36d16e
add_subdirectory
(
aes
)
add_subdirectory
(
hash
)
add_subdirectory
(
pkey
)
add_subdirectory
(
random
)
add_subdirectory
(
ssl
)
add_subdirectory
(
test
)
add_subdirectory
(
x509
)
此差异已折叠。
点击以展开。
programs/Makefile
+
8
−
3
浏览文件 @
fc36d16e
...
...
@@ -15,9 +15,10 @@ APPS = aes/aescrypt2 aes/crypt_and_hash \
pkey/mpi_demo pkey/rsa_genkey
\
pkey/rsa_sign pkey/rsa_verify
\
ssl/ssl_client1 ssl/ssl_client2
\
ssl/ssl_server
test
/ssl_cert_test
\
test
/benchmark
test
/selftest
\
test
/ssl_test x509/cert_app
ssl/ssl_server random/gen_random
\
test
/ssl_cert_test
test
/benchmark
\
test
/selftest
test
/ssl_test
\
x509/cert_app
.SILENT
:
...
...
@@ -79,6 +80,10 @@ pkey/rsa_verify: pkey/rsa_verify.c ../library/libpolarssl.a
echo
" CC pkey/rsa_verify.c"
$(
CC
)
$(
CFLAGS
)
$(
OFLAGS
)
pkey/rsa_verify.c
$(
LDFLAGS
)
-o
$@
random/gen_random
:
random/gen_random.c ../library/libpolarssl.a
echo
" CC random/gen_random.c"
$(
CC
)
$(
CFLAGS
)
$(
OFLAGS
)
random/gen_random.c
$(
LDFLAGS
)
-o
$@
ssl/ssl_client1
:
ssl/ssl_client1.c ../library/libpolarssl.a
echo
" CC ssl/ssl_client1.c"
$(
CC
)
$(
CFLAGS
)
$(
OFLAGS
)
ssl/ssl_client1.c
$(
LDFLAGS
)
-o
$@
...
...
此差异已折叠。
点击以展开。
programs/random/CMakeLists.txt
0 → 100644
+
6
−
0
浏览文件 @
fc36d16e
add_executable
(
gen_random gen_random.c
)
target_link_libraries
(
gen_random polarssl
)
INSTALL
(
TARGETS gen_random
DESTINATION
"bin"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
此差异已折叠。
点击以展开。
programs/random/gen_random.c
0 → 100644
+
72
−
0
浏览文件 @
fc36d16e
/**
* \brief Generate random data into a file
*
* Copyright (C) 2006-2010, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
"polarssl/config.h"
#include
"polarssl/havege.h"
#include
<time.h>
#include
<stdio.h>
int
main
(
int
argc
,
char
*
argv
[]
)
{
FILE
*
f
;
time_t
t
;
int
i
,
j
,
k
;
havege_state
hs
;
unsigned
char
buf
[
1024
];
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"usage: %s <output filename>
\n
"
,
argv
[
0
]
);
return
(
1
);
}
if
(
(
f
=
fopen
(
argv
[
1
],
"wb+"
)
)
==
NULL
)
{
printf
(
"failed to open '%s' for writing.
\n
"
,
argv
[
0
]
);
return
(
1
);
}
havege_init
(
&
hs
);
t
=
time
(
NULL
);
for
(
i
=
0
,
k
=
768
;
i
<
k
;
i
++
)
{
for
(
j
=
0
;
j
<
(
int
)
sizeof
(
buf
);
j
++
)
buf
[
j
]
=
havege_rand
(
&
hs
);
fwrite
(
buf
,
sizeof
(
buf
),
1
,
f
);
printf
(
"Generating 32Mb of data in file '%s'... %04.1f"
\
"%% done
\r
"
,
argv
[
1
],
(
100
*
(
float
)
(
i
+
1
))
/
k
);
fflush
(
stdout
);
}
if
(
t
==
time
(
NULL
)
)
t
--
;
fclose
(
f
);
return
(
0
);
}
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录