aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_rng.h
Commit message (Collapse)AuthorAgeFilesLines
* RNG changes (GH #593)Jack Lloyd2016-08-241-27/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change reseed interval logic to count calls to `randomize` rather than bytes, to match SP 800-90A Changes RNG reseeding API: there is no implicit reference to the global entropy sources within the RNGs anymore. The entropy sources must be supplied with the API call. Adds support for reseding directly from another RNG (such as a system or hardware RNG). Stateful_RNG keeps optional references to both an RNG and a set of entropy sources. During a reseed, both sources are used if set. These can be provided to HMAC_DRBG constructor. For HMAC_DRBG, SP800-90A requires we output no more than 2**16 bytes per DRBG request. We treat requests longer than that as if the caller had instead made several sequential maximum-length requests. This means it is possible for one or more reseeds to trigger even in the course of generating a single (long) output (generate a 256-bit key and use ChaCha or HKDF if this is a problem). Adds RNG::randomize_with_ts_input which takes timestamps and uses them as the additional_data DRBG field. Stateful_RNG overrides this to also include the process ID and the reseed counter. AutoSeeded_RNG's `randomize` uses this. Officially deprecates RNG::make_rng and the Serialized_RNG construtor which creates an AutoSeeded_RNG. With these removed, it would be possible to perform a build with no AutoSeeded_RNG/HMAC_DRBG at all (eg, for applications which only use the system RNG). Tests courtesy @cordney in GH PRs #598 and #600
* Revamp entropy pollingJack Lloyd2016-07-171-0/+25
| | | | | Remove Entropy_Accumulator, instead have entropy sources directly add entropy to the RNG.
* Add ECGDSARené Korthaus2016-04-191-2/+90
|
* cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-051-2/+2
| | | | explicit.
* Mass-prefix member vars with m_René Korthaus2016-01-081-8/+8
|
* Fix a few clang warnings. Set clang sanitizer flagsJack Lloyd2015-12-241-1/+1
|
* Missing addsJack Lloyd2015-12-111-10/+12
|
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-1/+1
| | | | | | | | As the alternatives are unfortunate for applications trying to catch all library errors, and it seems deriving from std::runtime_error causes problems with MSVC DLLs (GH #340) Effectively reverts 2837e915d82e43
* New reseed_with_sources call on RNGsJack Lloyd2015-11-241-1/+3
| | | | | | | | | | | | | Provides an easier way for an application to configure a list of entropy sources they'd like to use, or add a custom entropy source to their seeding. Exposes some toggles for the global/default entropy sources to build.h Adds basic entropy tests which runs the polls and does sanity checking on the results, including compression tests if available. These are less useful for the CSPRNG outputs but a good check for the ones producing plain ASCII like the /proc reader.
* tests: Add missing overridesDaniel Seither2015-07-301-6/+6
|
* Ensure all files have copyright and license info.lloyd2015-01-101-0/+5
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* Add HMAC_DRBGlloyd2014-03-211-0/+2
|
* Shuffle things around. Add NIST X.509 test to build.lloyd2014-01-011-0/+61