summaryrefslogtreecommitdiff
path: root/src/util/crypto_random.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-29 20:47:18 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-29 20:47:18 +0000
commit71ea5bd2d05058008e604ffd42993be9c7250e04 (patch)
treea5074671ddfaa9d1621a4182fc95a91a98b3d536 /src/util/crypto_random.c
parentb335777fd435142c16eb05e86c8a64a4b1a45447 (diff)
-fixing indentation
Diffstat (limited to 'src/util/crypto_random.c')
-rw-r--r--src/util/crypto_random.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index a1485029e..ff20646f7 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -38,10 +38,10 @@
/* The code is derived from glibc, obviously */
#if MINGW
#ifdef RANDOM
-# undef RANDOM
+#undef RANDOM
#endif
#ifdef SRANDOM
-# undef SRANDOM
+#undef SRANDOM
#endif
#define RANDOM() glibc_weak_rand32()
#define SRANDOM(s) glibc_weak_srand32(s)
@@ -57,6 +57,7 @@ int32_t
glibc_weak_rand32 ()
{
int32_t val = glibc_weak_rand32_state;
+
val = ((glibc_weak_rand32_state * 1103515245) + 12345) & 0x7fffffff;
glibc_weak_rand32_state = val;
return val;
@@ -314,7 +315,8 @@ void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
gcry_set_progress_handler (&entropy_generator, NULL);
atexit (&killfind);
GNUNET_CRYPTO_seed_weak_random (time (NULL) ^
- GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX));
+ GNUNET_CRYPTO_random_u32
+ (GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX));
}