diff options
author | Timothy Arceri <[email protected]> | 2017-03-22 10:48:57 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-03-23 08:16:29 +1100 |
commit | dd00a3c923ba94986efba2289c1b0e22b7c12c97 (patch) | |
tree | 3932a5a252144042e5eb7ff8f80cecc833656a61 /src/util/rand_xor.h | |
parent | 53660c23662edb829e6bfd54bcdc0df4688ec62b (diff) |
util/rand_xor: add function to seed rand
V2: pass the seed to the seed function so that we can isolate
its uses. Stop leaking fd when urandom couldn't be read.
Reviewed-by: Grazvydas Ignotas <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/util/rand_xor.h')
-rw-r--r-- | src/util/rand_xor.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/rand_xor.h b/src/util/rand_xor.h index d5144e98230..532d549bcda 100644 --- a/src/util/rand_xor.h +++ b/src/util/rand_xor.h @@ -26,8 +26,12 @@ #define RAND_XOR_H #include <stdint.h> +#include <stdbool.h> uint64_t rand_xorshift128plus(uint64_t *seed); +void +s_rand_xorshift128plus(uint64_t *seed, bool randomised_seed); + #endif /* RAND_XOR_H */ |