projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
-allow 'years' in time units, indentation and doxygen fixes
[oweals/gnunet.git]
/
src
/
util
/
test_crypto_random.c
diff --git
a/src/util/test_crypto_random.c
b/src/util/test_crypto_random.c
index 76230410df46578b23629cbb16d7f12694baf10d..ffb553b40dbb27be5fa69ff7b9c8c8f09fe060e1 100644
(file)
--- a/
src/util/test_crypto_random.c
+++ b/
src/util/test_crypto_random.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
This file is part of GNUnet.
- (C) 2009 Christian Grothoff (and other contributing authors)
+
Copyright
(C) 2009 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-24,8
+24,7
@@
* @brief testcase for crypto_random.c
*/
#include "platform.h"
* @brief testcase for crypto_random.c
*/
#include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_crypto_lib.h"
+#include "gnunet_util_lib.h"
static int
test (enum GNUNET_CRYPTO_Quality mode)
static int
test (enum GNUNET_CRYPTO_Quality mode)
@@
-39,17
+38,17
@@
test (enum GNUNET_CRYPTO_Quality mode)
for (i = 0; i < 1024; i++)
GNUNET_break (1024 > (buf[i] = GNUNET_CRYPTO_random_u32 (mode, 1024)));
for (i = 0; i < 10; i++)
for (i = 0; i < 1024; i++)
GNUNET_break (1024 > (buf[i] = GNUNET_CRYPTO_random_u32 (mode, 1024)));
for (i = 0; i < 10; i++)
+ {
+ b2 = GNUNET_CRYPTO_random_permute (mode, 1024);
+ if (0 == memcmp (b2, buf, sizeof (buf)))
{
{
- b2 = GNUNET_CRYPTO_random_permute (mode, 1024);
- if (0 == memcmp (b2, buf, sizeof (buf)))
- {
- fprintf (stderr, "!");
- GNUNET_free (b2);
- continue;
- }
+ FPRINTF (stderr, "%s", "!");
GNUNET_free (b2);
GNUNET_free (b2);
-
break
;
+
continue
;
}
}
+ GNUNET_free (b2);
+ break;
+ }
if (i == 10)
return 1; /* virtually impossible... */
if (i == 10)
return 1; /* virtually impossible... */