aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_random.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-09 11:23:09 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-09 11:23:09 +0000
commit457cd711331dd77e9f012c147dee7ce2922bf9d5 (patch)
tree4880a2b8f4b80c032c69e3a571681c19f76cec41 /src/util/crypto_random.c
parentc42552705ccf37473a17f20dd0078f5a79ca5e4e (diff)
downloadgnunet-457cd711331dd77e9f012c147dee7ce2922bf9d5.tar.gz
gnunet-457cd711331dd77e9f012c147dee7ce2922bf9d5.zip
stdconst
Diffstat (limited to 'src/util/crypto_random.c')
-rw-r--r--src/util/crypto_random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index 676416c63..25ba4db2a 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -66,7 +66,7 @@ GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i)
66 if ((invokeCount++ % 256) == 0) 66 if ((invokeCount++ % 256) == 0)
67 gcry_fast_random_poll (); 67 gcry_fast_random_poll ();
68#endif 68#endif
69 ul = ((uint32_t)-1) - (((uint32_t)-1) % i); 69 ul = UINT32_MAX - (UINT32_MAX % i);
70 do 70 do
71 { 71 {
72 gcry_randomize ((unsigned char *) &ret, 72 gcry_randomize ((unsigned char *) &ret,
@@ -132,7 +132,7 @@ GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max)
132 GNUNET_assert (max > 0); 132 GNUNET_assert (max > 0);
133 if (mode == GNUNET_CRYPTO_QUALITY_STRONG) 133 if (mode == GNUNET_CRYPTO_QUALITY_STRONG)
134 { 134 {
135 ul = ((uint64_t)-1LL) - (((uint64_t)-1LL) % max); 135 ul = UINT64_MAX - (UINT64_MAX % max);
136 do 136 do
137 { 137 {
138 gcry_randomize ((unsigned char *) &ret, 138 gcry_randomize ((unsigned char *) &ret,