]> git.meshlink.io Git - meshlink/commit
Replace rand() by xoshiro256** with per-mesh state.
authorGuus Sliepen <guus@meshlink.io>
Sat, 5 Oct 2019 17:40:15 +0000 (19:40 +0200)
committerGuus Sliepen <guus@meshlink.io>
Sat, 5 Oct 2019 17:40:15 +0000 (19:40 +0200)
commitea20fcfcded669ce8fbbda3a1f93f354ed254603
tree3080c8233a2c3035d1e24dac2f9c8fbede8dc601
parentac63b6adaf29c4143f9e106039011b9ebeb96b93
Replace rand() by xoshiro256** with per-mesh state.

We need a reasonable fast PRNG that doesn't have to be secure, for things
like timer randomization, port number generation and so on. Already some
platforms warn about the use of rand(). Also, when calling fork(), both
parent and child have the same PRNG seed, which causes some inefficiencies
in the test suite.
src/Makefile.am
src/discovery.c
src/meshlink.c
src/meshlink_internal.h
src/net.c
src/net_packet.c
src/protocol.c
src/protocol_edge.c
src/protocol_key.c
src/xoshiro.c [new file with mode: 0644]
src/xoshiro.h [new file with mode: 0644]