gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16180 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r16180 - gnunet/src/testing
Date: Mon, 25 Jul 2011 16:34:51 +0200

Author: nevans
Date: 2011-07-25 16:34:51 +0200 (Mon, 25 Jul 2011)
New Revision: 16180

Modified:
   gnunet/src/testing/testing_group.c
Log:
normal distribution

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2011-07-25 14:34:34 UTC (rev 16179)
+++ gnunet/src/testing/testing_group.c  2011-07-25 14:34:51 UTC (rev 16180)
@@ -1385,6 +1385,7 @@
   char *allowed_hosts;
   unsigned long long skew_variance;
   unsigned long long skew_offset;
+  long long actual_offset;
 
   orig = *port;
   uc.nport = *port;
@@ -1407,8 +1408,10 @@
                                                            &skew_variance))
       && (skew_variance > 0))
     {
-      skew_variance *= 2;
       skew_offset = GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, 
skew_variance + 1);
+      actual_offset = skew_offset - 
GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_WEAK, skew_variance + 1);
+      /* Min is -skew_variance, Max is skew_variance */
+      skew_offset = skew_variance + actual_offset; /* Normal distribution 
around 0 */
       GNUNET_CONFIGURATION_set_value_number(uc.ret, "testing", "skew_offset", 
skew_offset);
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]