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:
c425527
)
stdconst
author
Christian Grothoff
<christian@grothoff.org>
Wed, 9 Jun 2010 11:23:09 +0000
(11:23 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Wed, 9 Jun 2010 11:23:09 +0000
(11:23 +0000)
src/util/crypto_random.c
patch
|
blob
|
history
diff --git
a/src/util/crypto_random.c
b/src/util/crypto_random.c
index 676416c63328e918f3ca3df3a1bc9d25d3187cc3..25ba4db2a81ac94c9172c82c428590288ca7e474 100644
(file)
--- 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)
if ((invokeCount++ % 256) == 0)
gcry_fast_random_poll ();
#endif
- ul =
((uint32_t)-1) - (((uint32_t)-1)
% i);
+ ul =
UINT32_MAX - (UINT32_MAX
% i);
do
{
gcry_randomize ((unsigned char *) &ret,
@@
-132,7
+132,7
@@
GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max)
GNUNET_assert (max > 0);
if (mode == GNUNET_CRYPTO_QUALITY_STRONG)
{
- ul =
((uint64_t)-1LL) - (((uint64_t)-1LL)
% max);
+ ul =
UINT64_MAX - (UINT64_MAX
% max);
do
{
gcry_randomize ((unsigned char *) &ret,