aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_entropy.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add final annotations as appropriate in the test codeJack Lloyd2017-09-221-1/+1
|
* Reformat code with astyle + fix code styleTomasz Frydrych2017-05-011-3/+3
|
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-181-2/+2
| | | | | | Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
* Skip bzip2 compression entropy testsJack Lloyd2016-11-041-8/+5
| | | | Large block size makes the differential test fragile.
* Fix entropy testsJack Lloyd2016-11-041-6/+3
| | | | This interface changed, and it seems the test was only partially updated.
* Revamp entropy pollingJack Lloyd2016-07-171-36/+17
| | | | | Remove Entropy_Accumulator, instead have entropy sources directly add entropy to the RNG.
* Remove Transform base classJack Lloyd2016-04-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | With sufficient squinting, Transform provided an abstract base interface that covered both cipher modes and compression algorithms. However it mapped on neither of them particularly well. In addition this API had the same problem that has made me dislike the Pipe/Filter API: given a Transform&, what does it do when you put bits in? Maybe it encrypts. Maybe it compresses. It's a floor wax and a dessert topping! Currently the Cipher_Mode interface is left mostly unchanged, with the APIs previously on Transform just moved down the type hierarchy. I think there are some definite improvements possible here, wrt handling of in-place encryption, but left for a later commit. The compression API is split into two types, Compression_Algorithm and Decompression_Algorithm. Compression_Algorithm's start() call takes the compression level, allowing varying compressions with a single object. And flushing the compression state is moved to a bool param on `Compression_Algorithm::update`. All the nonsense WRT compression algorithms having zero length nonces, input granularity rules, etc as a result of using the Transform interface goes away.
* Fix a couple MSVC warnings.Jack Lloyd2016-04-091-3/+3
| | | | | | | | Cast std::streamsize to size_t since MSVC is worried gcount() might return a negative number. The entropy callbacks took the entropy estimate as a size_t instead of a double, which causes some verbose warnings due to the conversion.
* Skip bzip2 compression in entropy tests on OS X due to GH #394Jack Lloyd2016-03-021-0/+7
| | | | | Feels kind of nasty, but it sucks more to have CI builds break because of random failures.
* Fix compile error when compression is disabledJack Lloyd2015-11-291-1/+1
| | | | | | Missed because Travis uses zlib and company even in the min build. GH #337
* Add differential compression test.Jack Lloyd2015-11-281-41/+87
| | | | | Change getrusage output to static system data since it is sparse and changes rarely, and so actually does trigger the differential test.
* New reseed_with_sources call on RNGsJack Lloyd2015-11-241-0/+107
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.