aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Use arc4random(3) as system rng on OpenBSD.Alexander Bluhm2017-03-301-0/+15
| | | | | | | | | OpenBSD provides the arc4random(3) function in libc for user land programs that need good random data. Use this to implement the Botan system random number generator. It has the advantage over /dev/urandom that it works without file descriptors and in chroot(2) environment. Internally libc is currently using a ChaCha20 cipher as PRNG and getentropy(2) to reseed itself automatically.
* Avoid use of deprecated function in (deprecated) Serialized_RNG constructorJack Lloyd2017-02-192-2/+12
|
* Change meaning of get_processor_timestampJack Lloyd2017-01-272-2/+2
| | | | | | | | | | | Now let it return 0 if we have no hardware timestamp, and add OS::get_high_resolution_clock for best available clock. This is mainly because it's confusing for get_processor_timestamp to return something that is not a processor timestamp and because it simplifies adding cycles/byte output if we know that something is or is not a cycle counter. Also adds Windows SEH version of run_cpu_instruction_probe. Untested, uncompiled.
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-188-46/+46
| | | | | | 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.
* IncludeOS has random device files nowJack Lloyd2016-12-181-0/+1
| | | | | | GH #726 [ci skip]
* system_rng: workaround read only urandomAlon Bar-Lev2016-12-011-1/+4
| | | | | | | | botan_rng_reseed: System_RNG write failed error 9 FFI ran 252 tests 1 FAILED Failure 1: FFI botan_rng_reseed unexpectedly failed with error code -1 Signed-off-by: Alon Bar-Lev <[email protected]>
* define NOMINMAX 1 before every include of windows.hBaruch Burstein2016-11-281-2/+1
|
* Simple tests for AutoSeeded_RNGJack Lloyd2016-11-262-1/+2
|
* Avoid having source files start with /**Jack Lloyd2016-11-252-2/+2
| | | | | | | This caused Doxygen to dump the copyright notices for those files into the Botan namespace description, which is not helpful. [ci skip]
* Don't force HMAC_DRBG to be enabledJack Lloyd2016-11-182-1/+2
| | | | | No need to strictly require it, and some applications may only want system RNG or RDRAND.
* Remove HMAC_RNG, X9.31-RNG, BeOS stats, EGD reader, Unix process runnerJack Lloyd2016-10-288-504/+18
| | | | | Change AutoSeeded_RNG to use SHA-384, SHA-256, SHA-3(256), or SHA-1, whichever is available (in that order).
* HMAC_DRBG - Fix constructor init order. Use create_or_throw to simplify.Jack Lloyd2016-10-281-6/+3
|
* make max_number_of_bytes_per_request configurableDaniel Neus2016-10-282-27/+79
|
* Fix doxygen warnings [ci skip]René Korthaus2016-10-193-2/+6
|