From: Christian Grothoff Date: Tue, 8 Jun 2010 06:55:01 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~21457 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=75515782d35eb20040d2d0ef678dd64ebee37ae8;p=oweals%2Fgnunet.git fix --- diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c index 35dafd071..eea047ac6 100644 --- a/src/util/crypto_random.c +++ b/src/util/crypto_random.c @@ -99,9 +99,9 @@ GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n) ret = GNUNET_malloc (n * sizeof (unsigned int)); for (i = 0; i < n; i++) ret[i] = i; - for (i = 0; i < n; i++) + for (i = n - 1; i > 0; i--) { - x = GNUNET_CRYPTO_random_u32 (mode, n); + x = GNUNET_CRYPTO_random_u32 (mode, i+1); tmp = ret[x]; ret[x] = ret[i]; ret[i] = tmp;