diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-02-15 17:45:22 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-03-29 11:26:08 -0700 |
commit | 16329224e70d0525208f6b0ba00c5e1531a4f5ea (patch) | |
tree | 8decd575cf1023486f2383e125c90085ebabd17a /src/test/test_random.h | |
parent | e04326fe6652543dc26d90eba4a48fbdc935fd0c (diff) |
Switch FastRandomContext to ChaCha20
Diffstat (limited to 'src/test/test_random.h')
-rw-r--r-- | src/test/test_random.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/test_random.h b/src/test/test_random.h index 4a1637ac72..318c44df4d 100644 --- a/src/test/test_random.h +++ b/src/test/test_random.h @@ -8,11 +8,17 @@ #include "random.h" +extern uint256 insecure_rand_seed; extern FastRandomContext insecure_rand_ctx; static inline void seed_insecure_rand(bool fDeterministic = false) { - insecure_rand_ctx = FastRandomContext(fDeterministic); + if (fDeterministic) { + insecure_rand_seed = uint256(); + } else { + insecure_rand_seed = GetRandHash(); + } + insecure_rand_ctx = FastRandomContext(insecure_rand_seed); } static inline uint32_t insecure_rand(void) |