fsbl: weekly update 2023-03-25

1. update release func

Change-Id: I221476630ce4f2f6a01e8f89fd96d9ac9701a270
This commit is contained in:
forum_service
2023-03-27 00:22:46 +08:00
parent 75a1b20dea
commit 88cce7a8a2
2455 changed files with 14602 additions and 449695 deletions

View File

@ -1,65 +1,65 @@
/* $Id: t_bdQuickRandBits.c $ */
/* $Id: t_bdQuickRandBits.c $ */
/***** BEGIN LICENSE BLOCK *****
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright (c) 2001-16 David Ireland, D.I. Management Services Pty Limited
* <http://www.di-mgt.com.au/bigdigits.html>. All rights reserved.
*
***** END LICENSE BLOCK *****/
/*
* Last updated:
* $Date: 2016-03-31 09:51:00 $
* $Revision: 2.6.1 $
* $Author: dai $
*/
/*
What is the difference between bdQuickRandBits and bdRandomBits?
bdRandomBits() uses the "pretty-good" internal RNG and requires you to include bigdRand.h
and compile with bigdRand.c and bigdigitsRand.c.
You can be pretty sure that the numbers generated will pass all statistical tests for randomness.
bdQuickRandBits() just needs the standard bigd.h include file and you do not need to
add the modules bigdRand.c and bigdigitsRand.c to your project.
It uses the stdlib rand() function, which is by no means secure, but it will quickly fill up a number
with the required number of random-looking bits.
It might repeat if you call twice in quick succession. It's quick and dirty, as advertised.
If you *really* want a secure random number, then use bdRandomSeeded() and call your own super-secure
random number generator, throwing in your own bit of extra entropy with the seed.
*/
#include <stdio.h>
#include <assert.h>
#include "bigd.h"
#include "bigdRand.h"
int main(void)
{
BIGD a;
int i;
/***** BEGIN LICENSE BLOCK *****
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright (c) 2001-16 David Ireland, D.I. Management Services Pty Limited
* <http://www.di-mgt.com.au/bigdigits.html>. All rights reserved.
*
***** END LICENSE BLOCK *****/
/*
* Last updated:
* $Date: 2016-03-31 09:51:00 $
* $Revision: 2.6.1 $
* $Author: dai $
*/
/*
What is the difference between bdQuickRandBits and bdRandomBits?
bdRandomBits() uses the "pretty-good" internal RNG and requires you to include bigdRand.h
and compile with bigdRand.c and bigdigitsRand.c.
You can be pretty sure that the numbers generated will pass all statistical tests for randomness.
bdQuickRandBits() just needs the standard bigd.h include file and you do not need to
add the modules bigdRand.c and bigdigitsRand.c to your project.
It uses the stdlib rand() function, which is by no means secure, but it will quickly fill up a number
with the required number of random-looking bits.
It might repeat if you call twice in quick succession. It's quick and dirty, as advertised.
If you *really* want a secure random number, then use bdRandomSeeded() and call your own super-secure
random number generator, throwing in your own bit of extra entropy with the seed.
*/
#include <stdio.h>
#include <assert.h>
#include "bigd.h"
#include "bigdRand.h"
int main(void)
{
BIGD a;
int i;
a = bdNew();
// Test bdQuickRandBits (quick-and-dirty)
printf("Testing bdQuickRandBits...\n");
for (i = 0; i < 10; i++)
{
bdQuickRandBits(a, 128);
bdPrintHex("", a, "\n");
}
// Test bdRandomBits (more secure)
printf("Testing bdRandomBits...\n");
for (i = 0; i < 10; i++)
{
bdRandomBits(a, 128);
bdPrintHex("", a, "\n");
}
return 0;
}
a = bdNew();
// Test bdQuickRandBits (quick-and-dirty)
printf("Testing bdQuickRandBits...\n");
for (i = 0; i < 10; i++)
{
bdQuickRandBits(a, 128);
bdPrintHex("", a, "\n");
}
// Test bdRandomBits (more secure)
printf("Testing bdRandomBits...\n");
for (i = 0; i < 10; i++)
{
bdRandomBits(a, 128);
bdPrintHex("", a, "\n");
}
return 0;
}