X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Ftest_crypto_random.c;h=681947a60b9a12e9cdb8950d22236d4663f7557b;hb=72c8645af31896829b674b575c5375706f362a30;hp=e237c14a4158939afcdacd1fd62788b19de0de39;hpb=0a217a8df1657b4334b55b0e4a6c7837a8dbcfd9;p=oweals%2Fgnunet.git diff --git a/src/util/test_crypto_random.c b/src/util/test_crypto_random.c index e237c14a4..681947a60 100644 --- a/src/util/test_crypto_random.c +++ b/src/util/test_crypto_random.c @@ -4,7 +4,7 @@ GNUnet 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, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but @@ -39,17 +39,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++) + { + 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); - break; + continue; } + GNUNET_free (b2); + break; + } if (i == 10) return 1; /* virtually impossible... */