projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd73657
)
fix
author
Christian Grothoff
<christian@grothoff.org>
Tue, 8 Jun 2010 06:55:01 +0000
(06:55 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Tue, 8 Jun 2010 06:55:01 +0000
(06:55 +0000)
src/util/crypto_random.c
patch
|
blob
|
history
diff --git
a/src/util/crypto_random.c
b/src/util/crypto_random.c
index 35dafd071b98afcda77b4b4d95c19927e645aeaf..eea047ac6999fbb11665dd2bd187130c4653e878 100644
(file)
--- 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;