boringssl/crypto/fipsmodule/rand
Adam Langley 8e8f250422 Use thread-local storage for PRNG states if fork-unsafe buffering is enabled.
We switched from thread-local storage to a mutex-pool in 82639e6f53
because, for highly-threaded processes, the memory used by all the
states could be quite large. I had judged that a mutex-pool should be
fine, but had underestimated the PRNG requirements of some of our jobs.

This change makes rand.c support using either thread-locals or a
mutex-pool. Thread-locals are used if fork-unsafe buffering is enabled.
While not strictly related to fork-safety, we already have the
fork-unsafe control, and it's already set by jobs that care a lot about
PRNG performance, so fits quite nicely here.

Change-Id: Iaf1e0171c70d4c8dbe1e42283ea13df5b613cb2d
Reviewed-on: https://boringssl-review.googlesource.com/c/31564
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
2018-12-28 18:05:18 +00:00
..
asm Update several assembly files from upstream. 2018-08-07 18:57:17 +00:00
ctrdrbg_test.cc Fix miscellaneous clang-tidy warnings. 2017-08-01 20:39:46 +00:00
ctrdrbg_vectors.txt
ctrdrbg.c Modernize OPENSSL_COMPILE_ASSERT, part 2. 2018-11-14 16:06:37 +00:00
internal.h Remove CTR_DRBG_STATE alignment marker. 2017-09-18 19:17:52 +00:00
rand.c Use thread-local storage for PRNG states if fork-unsafe buffering is enabled. 2018-12-28 18:05:18 +00:00
urandom.c Fix the build on glibc 2.15. 2018-10-24 17:39:48 +00:00