Skip to content

Commit

Permalink
core: more secure PRNG initialization, use fastrand (its much safer) …
Browse files Browse the repository at this point in the history
…to init the other PRNGs
  • Loading branch information
henningw committed Sep 21, 2019
1 parent 4dbe7fa commit 0cd270b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.c
Expand Up @@ -2248,9 +2248,9 @@ int main(int argc, char** argv)
}
seed+=getpid()+time(0);
LM_DBG("seeding PRNG with %u\n", seed);
kam_srand(seed);
fastrand_seed(kam_rand());
srandom(kam_rand()+time(0));
fastrand_seed(seed);
kam_srand(fastrand());
srandom(fastrand()+time(0));
LM_DBG("test random numbers %u %lu %u\n", kam_rand(), random(), fastrand());

/*register builtin modules*/
Expand Down

0 comments on commit 0cd270b

Please sign in to comment.