24 rng->state = (uint32_t)(seed & 0x7fffffff);
39 rng->state = (rng->state * 1103515245 + 12345) & 0x7fffffff;
40 return (int32_t) rng->state;
55 divisor = TOR_WEAK_RANDOM_MAX / top;
58 }
while (result >= top);
int32_t tor_weak_random(tor_weak_rng_t *rng)
void tor_init_weak_random(tor_weak_rng_t *rng, unsigned seed)
int32_t tor_weak_random_range(tor_weak_rng_t *rng, int32_t top)