aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng
Commit message (Collapse)AuthorAgeFilesLines
* Rename 'darwin' target to 'macos'Jack Lloyd2019-03-271-1/+1
| | | | | Both because that's the more common term, and because iOS/watchOS also uses the Darwin kernel, but we have a distinct target for mobile.
* Renamed m_handle to m_prov as this is the variable name used elsewhere.Ricardo Martins2019-02-151-1/+1
|
* Remove trailing whitespaceJack Lloyd2019-01-131-21/+21
|
* Make exceptions easier to translate to error codesJack Lloyd2018-11-235-13/+13
| | | | | | | | | | | Avoid throwing base Botan::Exception type, as it is difficult to determine what the error is in that case. Add Exception::error_code and Exception::error_type which allows (for error code) more information about the error and (for error type) allows knowing the error type without requiring a sequence of catches. See GH #1742
* When available use RDRAND for Stateful_RNG additional dataJack Lloyd2018-11-211-4/+19
|
* Fix more MSVC warningsJack Lloyd2018-10-011-1/+1
|
* Add support for using Linux getrandom syscallJack Lloyd2018-09-201-0/+39
| | | | Disabled by default as it requires a relatively recent kernel and glibc.
* In AutoSeeded_RNG invoke randomize_with_ts_input on the owned RNGJack Lloyd2018-09-131-1/+1
| | | | | | | | Invoking on this means we use RandomNumberGenerator::randomize_with_ts_input which just adds timestamps. Whereas Stateful_RNG::randomize_with_ts_input (as implemented by the owned RNG) also adds the reseed counter and the last pid. Probably no real difference, but can't hurt and not any slower.
* Add RandomNumberGenerator::accepts_inputJack Lloyd2018-09-067-17/+74
|
* Expose RDRAND RNG through FFIJack Lloyd2018-08-132-1/+12
|
* Add StreamCipher::write_keystreamJack Lloyd2018-08-081-3/+2
| | | | | Avoids the XOR operation. Only implemented for ChaCha20 currently, everything else defaults to memset-to-zero + xor-cipher
* Fix Doxygen comments for AutoSeeded_RNG [ci skip]Jack Lloyd2018-07-311-3/+7
|
* Correct comment on Hardware_RNGJack Lloyd2018-07-171-2/+1
|
* Add back support for Windows Phone RNG, undeprecate UWPJack Lloyd2018-05-282-0/+49
| | | | See #1586. Reverts part of #1494
* Use type BYTE instead of BOOLEANSimon Warta2018-05-081-1/+4
|
* Rename RtlGenRandom_f -> RtlGenRandom_fptrSimon Warta2018-05-071-3/+3
| | | | because this is a function pointer, not a function
* Rewrite assignment of RtlGenRandom_f using "using"Simon Warta2018-05-071-1/+1
|
* Check return value of m_rtlgenrandom against proper typeSimon Warta2018-05-071-1/+2
|
* Use BOOLEAN return type for RtlGenRandom_fSimon Warta2018-05-071-1/+1
|
* Add missing NTAPI to RtlGenRandom_f signatureSimon Warta2018-05-071-1/+1
|
* Use RtlGenRandom instead of CryptoAPIJack Lloyd2018-03-142-79/+23
|
* Merge GH #1378 Use OS feature flags instead of OS name for enabling system ↵Jack Lloyd2018-01-091-21/+6
|\ | | | | | | specific code
| * Test OS features by the feature vs the OS nameJack Lloyd2017-12-301-21/+6
| |
* | Remove needless <arch> blocks for RDRAND/RDSEEDJack Lloyd2018-01-041-5/+0
|/ | | | These were already implicit due to requiring the relevant ISA
* Drop IRIX supportJack Lloyd2017-12-131-1/+0
| | | | | | It turns out that GCC dropped support for IRIX in 4.8, so likely there was never even a C++11 compiler that could have been used to compile 2.x in any case.
* Add missing `override`Jack Lloyd2017-10-051-1/+1
| | | | | Redundant with `final` but GCC -Wsuggest-override complains. (This is already a bug filed for this in GCC upstream.)
* Avoid empty methods, use =default or add a commentJack Lloyd2017-10-033-6/+6
| | | | Sonar
* Use explicit on more single-argument constructorsJack Lloyd2017-09-301-2/+2
|
* Slight improvements to RNG testsJack Lloyd2017-09-221-2/+2
|
* Apply final annotations to the library alsoJack Lloyd2017-09-221-1/+1
| | | | | Done by a perl script which converted all classes to final, followed by selective reversion where it caused compilation failures.
* Merge GH #1219 Implement System_RNG on macOS/iOS using arc4randomJack Lloyd2017-09-211-6/+3
|\
| * Supposedly iOS has arc4random, so maybe this works...Jack Lloyd2017-09-211-6/+3
| |
* | More include header cleanupsJack Lloyd2017-09-212-1/+1
| |
* | Clean up header includesJack Lloyd2017-09-211-1/+0
|/ | | | | | | Avoid including build.h or assert.h directly, instead always take them though types.h Avoid math.h in favor of cmath
* Change header guard format to BOTAN_FOO_H_Jack Lloyd2017-09-207-14/+14
| | | | | | ISO C++ reserves names with double underscores in them Closes #512
* More annotationsJack Lloyd2017-09-191-1/+1
|
* Add API stability annotations.Jack Lloyd2017-09-196-10/+10
| | | | | Defined in build.h, all equal to BOTAN_DLL so ties into existing system for exporting symbols.
* Define macro so windows.h doesn't include winsock.hJack Lloyd2017-09-031-0/+1
| | | | Ugh Windows headers y u so nasty.
* Refactor RNGs to support Windows PhoneJack Lloyd2017-09-022-108/+150
| | | | | | | | | | | | | | | | | | | This OS has its own crypto API and does not support CryptGenRandom. Splits System_RNG_Impl into distinct declarations one per implementation type. Easier to read now that we are up to 4 distinct versions. Removes the CryptoAPI entropy source, and replaces it with an entropy source that calls the system RNG. This is nominally a bit less flexible in that the entropy source allowed polling multiple providers (though we didn't actually make use of that). Plus side is it works on all systems. Currently the dev_random entropy source is still there because we do actually use it to poll both /dev/random and /dev/urandom, and it might be useful (on certain systems) to also poll a HW RNG, which are often assigned their own device node. This could debatably also be removed in favor of just reading the system RNG.
* Fix missing virtual destructor on CSP_HandleJack Lloyd2017-08-311-1/+1
| | | | Caught by GCC cross compiling. Also fix a couple 0-as-null warnings.
* Reset the ChaCha key in clearJack Lloyd2017-08-031-0/+1
| | | | | This is not necessary for setup, but we want to zero the key out in the event someone calls clear explicitly.
* Use new reset_reseed_counter function within Stateful_RNG as wellJack Lloyd2017-08-031-3/+3
|
* Add Stateful_RNG::reset_reseed_counterJack Lloyd2017-08-033-4/+7
| | | | Instead of giving subclasses access to the variable directly.
* Refactor stateful RNG tests to cover both HMAC_DRBG and ChaCha_RNGJack Lloyd2017-08-034-17/+38
|
* Add ChaCha_RNGJack Lloyd2017-08-033-0/+238
|
* Add explicit tests for RDRAND_RNG and System_RNGJack Lloyd2017-08-031-9/+7
|
* Fix for #1078Baruch2017-06-191-1/+1
|
* Follow NIST SP 800-57 for HMAC_DRBG security levelRené Korthaus2017-04-031-3/+12
|
* Change security_strength of HMAC_DRBGRené Korthaus2017-04-032-5/+12
| | | | | | | | | | | | | | Looking into SP808-90A, it mentions that the max security strength is the security strength of the hash function for pre-image resistance. The current implementation however always only uses half of the output length, therefore only providing half of the security strength possible. However, SP800-90A supports only up to 256 bit security strength, so we fix it to this upper limit. In a second change, add_entropy() now also resets the reseed counter if enough entropy input provided.
* Remove "Dirty hack" for multiple defines in lex_me_harder()Simon Warta2017-04-025-7/+17
|