diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-02-19 15:23:31 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-02-19 15:36:08 -0500 |
commit | b25cd5cfe168b85500c160ca538a44d9adba52c1 (patch) | |
tree | ff48d6598b801dee11b6af1f77b4f01a964f4616 /src/lib/crypt_ops/crypto_rand.h | |
parent | 6927e9a60ca12fa67d6a33044c2903ce95ca1605 (diff) | |
download | tor-b25cd5cfe168b85500c160ca538a44d9adba52c1.tar.gz tor-b25cd5cfe168b85500c160ca538a44d9adba52c1.zip |
Implement code to manage a per-thread instance of crypto_fast_rng()
The subsystems API makes this really simple, fortunately.
Closes ticket 29536
Diffstat (limited to 'src/lib/crypt_ops/crypto_rand.h')
-rw-r--r-- | src/lib/crypt_ops/crypto_rand.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/crypt_ops/crypto_rand.h b/src/lib/crypt_ops/crypto_rand.h index 8a81a4acdc..6eef22ed4d 100644 --- a/src/lib/crypt_ops/crypto_rand.h +++ b/src/lib/crypt_ops/crypto_rand.h @@ -68,6 +68,15 @@ unsigned crypto_fast_rng_get_uint(crypto_fast_rng_t *rng, unsigned limit); uint64_t crypto_fast_rng_get_uint64(crypto_fast_rng_t *rng, uint64_t limit); double crypto_fast_rng_get_double(crypto_fast_rng_t *rng); +crypto_fast_rng_t *get_thread_fast_rng(void); + +#ifdef CRYPTO_PRIVATE +/* These are only used from crypto_init.c */ +void destroy_thread_fast_rng(void); +void crypto_rand_fast_init(void); +void crypto_rand_fast_shutdown(void); +#endif + #if defined(TOR_UNIT_TESTS) /* Used for white-box testing */ size_t crypto_fast_rng_get_bytes_used_per_stream(void); |