aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_bigint.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Increase value of ITERATIONS_PER_POSSIBLE_VALUE to 750Simon Warta2017-01-021-1/+2
| | | | to avoid test failures
* Simplify loop to foreach in test_random_integer()Simon Warta2017-01-021-2/+2
|
* Fix math in test_random_integer()Simon Warta2017-01-021-5/+3
| | | | | Removes complicated extra variable "dev", which was calculated incorrectly: if ratio = 0.0 then dev = 0.0, resulting in a test success.
* Rename ITERATIONS -> ITERATIONS_PER_POSSIBLE_VALUESimon Warta2017-01-021-3/+3
|
* Add more tests for random prime and DL group generationJack Lloyd2016-12-301-0/+85
|
* Speed up DSA param gen testJack Lloyd2016-12-261-6/+8
| | | | Record counter value in test data, and start the search from there.
* Long test was too longJack Lloyd2016-12-241-6/+3
|
* Add test option --run-long-testsJack Lloyd2016-12-241-8/+5
| | | | | | Previously longer tests were hidden behind higher 'soak levels' but these arbitrary cutoffs are confusing compared to a simple short tests/long tests split.
* Add additional primality testsJack Lloyd2016-12-191-7/+8
| | | | | | | Add a long list of 'false' primes from Google's Wycheproof tests: https://github.com/google/wycheproof/blob/master/java/com/google/security/wycheproof/testcases/BigIntegerTest.java Split vector file format into Prime and NonPrime sections for easier reading.
* Minor refactoring of Text_Based_TestJack Lloyd2016-12-191-13/+13
| | | | | | Turns out astyle has some bugs wrt C++11 initialize lists. Rather than having astyle mangle all of the tests, convert to using a string which is split once at the start instead of a vector of keys.
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-181-5/+5
| | | | | | 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.
* Fix exponentiation bug, related fixesJack Lloyd2016-12-141-3/+28
| | | | | | | | | | | | | | | GH #754 exposed a bug in the non-Montgomery exponentiation case. It turned out then when the fixed window was picked to any value > 1, the result would be incorrect due to an off by one. This is the one line fix in powm_fw.cpp Also fix a bug in bigint_mul which caused incorrect results, because the output BigInt was not being zeroed out before use. This is only exposed in rare cases, found (somewhat indirectly) in OSS-Fuzz #287. Add more modular exponentiation tests, which would have caught these issues earlier.
* Fix test, catching wrong exception typeJack Lloyd2016-11-051-1/+1
|
* Handle missing SHA-x in DSA param gen testJack Lloyd2016-11-041-8/+13
|
* Add test for DSA parameter generationJack Lloyd2016-11-031-2/+44
| | | | | Limited to 1024 bit params by default to keep runtimes reasonable, but test vectors for all sizes from FIPS 186-3 do pass.
* Fix leading zero bytes in DSA, ECDSA, ECGDSA and ECKCDSA signaturesRené Korthaus2016-08-171-0/+27
|
* test BigInt::operator%=(word y)Daniel Neus2016-07-261-0/+9
|
* Fix for GCC 6Jack Lloyd2016-05-231-0/+1
|
* Add more tests for modular inverseJack Lloyd2016-02-211-4/+7
| | | | | The result of fuzzing with AFL for a while, then running cmin on the result.
* For odd moduli use a input-independent modular inverse algorithm.Jack Lloyd2016-02-201-2/+12
| | | | Also adds a (not const time) implementation of almost Montgomery reduction.
* Add tests and timings for inverse_modJack Lloyd2016-02-201-2/+31
|
* Split up BigInt testsJack Lloyd2016-02-171-127/+248
| | | | | | Removes a fair number of the power mod test cases for size and test time. Would be better to add a randomized or fuzzer-based test. Otherwise no change.
* Fix (nearly) infinite loop in RESSOL (modular square root).Jack Lloyd2016-02-011-0/+18
| | | | | | | It first computed the first i for q**(2**i) == 1, then checked that i was smaller than s. Given a composite modulus (for which the algorithm does not work), the loop might do a very large amount of work before returning the failure.
* add missing overridesDaniel Neus2016-01-081-1/+1
| | | | found by gcc with -Wsuggest-override
* some trivial compiler/PVS-Studio warning fixesDaniel Neus2015-12-221-1/+1
|
* Add --data-dir option to test commandJack Lloyd2015-12-201-1/+1
| | | | | | | Understand using '-' on the command line to mean stdin Fix last few unit tests that wanted to write to the filesystem; removes outdata directory.
* Fix occasional test failsJack Lloyd2015-11-111-5/+31
| | | | | | | | Increase the iterations of the BigInt::random_integer test. Since things get slow quickly, leave the larger range tests to higher soak levels. In TLS, if the corrupted data causes an exception immediately that's ok because it's corrupted data.
* Update and consolidate the test framework.Jack Lloyd2015-11-111-494/+237
| | | | | | | | | | | The tests previously had used 4 to 6 different schemes internally (the vec file reader framework, Catch, the old InSiTo Boost.Test tests, the PK/BigInt tests which escaped the rewrite in 1.11.7, plus a number of one-offs). Converge on a design that works everywhere, and update all the things. Fix also a few bugs found by the test changes: SHA-512-256 name incorrect, OpenSSL RC4 name incorrect, signature of FFI function botan_pubkey_destroy was wrong.
* Add power analysis countermeasures for ECC point multiplications.Jack Lloyd2015-08-211-49/+0
| | | | | | | | The plain PointGFp operator* now uses Montgomery ladder exclusively. Adds a blinded point multiply algorithm which uses exponent and point randomization, as well as a Montgomery ladder technique that takes a random walk of the possible addition chains for k.
* Restrict input values to NIST reductions to defined rangeJack Lloyd2015-08-081-3/+13
|
* Expose the NIST prime values and reduction operations as plain functions.Jack Lloyd2015-08-081-16/+138
| | | | | | Previously they were hidden away as private functions on the CurveGFp types. This allows directly testing the reduction functions against other computational methods.
* Better living through macrosJack Lloyd2015-07-241-30/+32
|
* BigInt::to_u32bit failed on 32-bit integers. GH #220Jack Lloyd2015-07-231-1/+47
|
* Make Botan compile when only some modules are enabledSimon Warta2015-07-031-0/+15
| | | | Fixes #146.
* Avoid DEBUG define; Use NDEBUG if necessarySimon Warta2015-07-031-3/+1
|
* ifstream/ostream take std::stringSimon Warta2015-06-231-1/+1
|
* Ensure all files have copyright and license info.lloyd2015-01-101-1/+1
| | | | | Update license header line to specify the terms and refer to the file, neither of which it included before.
* All tests now share an RNG. Uses system RNG if availablelloyd2014-12-281-2/+2
|
* Remove unused test. Bugzilla 272lloyd2014-05-171-65/+0
|
* Any fixed MR iterations is probably wrong for somebody. Allow the userlloyd2014-04-251-4/+4
| | | | | | to specify a probability as well as if n was randomly chosen or not. If the input is random use a better bounds to reduce the number of needed tests.
* Cleanupslloyd2014-02-131-6/+0
|
* Split up docs into the reference manual, the website, and everything else.lloyd2014-01-101-0/+455
| | | | | | | | | | | Add `website` target to makefile. Some progress towards fixing minimized builds. TLS now hard requires ECDSA and GCM since otherwise a minimized build has only insecure options. Remove boost_thread dependency in command line tool
* Rename test sourceslloyd2014-01-071-428/+0
|
* Move previously common function to only remaining caller's sourcelloyd2014-01-061-0/+18
|
* Split up public key tests and data, use new test frameworklloyd2014-01-051-1/+1
|
* Cull remaining mostly dubious examples. Also remove readme.txtlloyd2014-01-011-92/+145
|
* Shuffle things around. Add NIST X.509 test to build.lloyd2014-01-011-0/+357