boringssl/crypto/fipsmodule/rand
Adam Langley 82639e6f53 Use a pool of |rand_state| objects.
Previously we used thread-local state objects in rand.c. However, for
applications with large numbers of threads, this can lead to excessive
memory usage.

This change causes us to maintain a mutex-protected pool of state
objects where the size of the pool equals the maximum concurrency of
|RAND_bytes|. This might lead to state objects bouncing between CPUs
more often, but should help the memory usage problem.

Change-Id: Ie83763d3bc139e64ac17bf7e015ad082b2f8a81a
Reviewed-on: https://boringssl-review.googlesource.com/29565
Commit-Queue: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: David Benjamin <davidben@google.com>
2018-07-06 21:25:37 +00:00
..
asm Move much of rand/ into the FIPS module. 2017-04-21 22:03:18 +00:00
ctrdrbg_test.cc Fix miscellaneous clang-tidy warnings. 2017-08-01 20:39:46 +00:00
ctrdrbg_vectors.txt Move much of rand/ into the FIPS module. 2017-04-21 22:03:18 +00:00
ctrdrbg.c Fix up CTR_DRBG_update comment. 2018-01-23 22:19:03 +00:00
internal.h Remove CTR_DRBG_STATE alignment marker. 2017-09-18 19:17:52 +00:00
rand.c Use a pool of |rand_state| objects. 2018-07-06 21:25:37 +00:00
urandom.c Write error messages in the FIPS module to stderr. 2018-06-25 10:30:42 +00:00