char *allowed_hosts;
unsigned long long skew_variance;
unsigned long long skew_offset;
+ long long actual_offset;
orig = *port;
uc.nport = *port;
&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);
}