summaryrefslogtreecommitdiff
path: root/src/regress/lib/libcrypto/bn (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Include tests with negative values in BN_mod_exp* regress.jsing2023-03-151-2/+15
| | | | This currently fails.
* bn_mod_exp_zero: rename result into gottb2023-03-151-14/+14
|
* Add regress coverage for BN_{add,sub,mul,div,mod}_word().jsing2023-03-112-1/+619
| | | | | | | This also provides some indirect coverage for BN_hex2bn(), BN_bn2hex() and BN_get_word(). Two of these tests are currently failing and will be fixed shortly.
* Mark test table as static const.jsing2023-03-111-2/+2
|
* reduce number of tests in bn_rand_interval.tb2023-03-081-2/+2
| | | | | This is only testing basic functionality anyway, so 10000 tests are more than enough.
* bn_isqrt: reduce number of tests to 100.tb2023-03-081-2/+2
| | | | | | The runtime is roughly quadratic in N_TESTS. While it only takes 1-2s on modern machines, this test takes a long time on slow machines. A reduction of runtime by a factor of ~16 is significant.
* Add regress coverage for BN_num_bits_word()tb2023-02-141-1/+25
|
* Revise for negative zero changes.jsing2023-02-131-2/+2
|
* Add currently failing negative zero check to BN_rshift() regress.jsing2023-02-131-1/+5
|
* Add bn/arch/${MACHINE_CPU} to the include path.jsing2023-01-311-1/+2
| | | | This will be needed once headers pull in bn_arch.h.
* Add more regress tests for BN_usub().jsing2023-01-311-1/+22
| | | | | | This adds more tests for BN_usub(), particularly where b > a, which should be an error condition. One of these currently succeeds and produces incorrect results.
* Use utime in order to make benchmarks less noisy and more consistent.jsing2023-01-291-5/+14
|
* Set BN_FLG_CONSTTIME on benchmark inputs.jsing2023-01-291-1/+4
| | | | | The public APIs still change behaviour based on BN_FLG_CONSTTIME - set it to avoid benchmark noise.
* Add benchmarks for BN_div()jsing2023-01-291-10/+147
|
* Correct setup for BN_mul/BN_sqr benchmarks.jsing2023-01-291-4/+4
| | | | BN_rand() takes a bit length, not the top bit.
* Rename bn_mul.c regress to bn_mul_div.c.jsing2023-01-292-5/+5
|
* Provide basic benchmarks for BN_mul() and BN_sqr().jsing2023-01-212-2/+275
|
* Fix previous.jsing2023-01-071-3/+9
|
* Add additional shift benchmarks that are useful on BN_BITS2 == 32 platformsjsing2023-01-051-2/+56
|
* Add regress coverage for shifts of zero bits.jsing2022-12-231-1/+38
|
* Do similar setup for lshift and rshift benchmarks.jsing2022-12-231-1/+13
| | | | This prevents realloc from unnecessarily impacting the lshift benchmarks.
* Use volatile sig_atomic_t for flag set in signal handlertb2022-12-181-2/+2
|
* Switch to using BN_zero() instead of BN_zero_ex()tb2022-12-171-2/+2
|
* Move benchmark target up a bit and mark it phonytb2022-12-171-4/+5
|
* Zap some whitespacetb2022-12-171-2/+2
|
* Provide regress coverage for BN shift functions.jsing2022-12-172-1/+543
| | | | | | Provide regress coverage for BN_lshift1(), BN_rshift1(), BN_lshift() and BN_rshift(), along with basic benchmarking functionality (run via 'make benchmark').
* bn/Makefile: tidy up and simplifytb2022-12-091-16/+10
|
* bn_mod_exp test: drop extra parentheses for readabilitytb2022-12-081-4/+4
|
* Add a few missing headers and drop a few unused onestb2022-12-067-20/+20
| | | | In bn_test.c include bn_local.h instead of using copy-pasted prototypes.
* bn_mod_exp.c doesn't need <string.h>tb2022-12-051-2/+1
|
* More cleanuptb2022-12-031-11/+8
| | | | | Drop unnecessary loading of error strings, fix error path and consistently print to stdout.
* Refactor and fix bn_mod_exp testtb2022-12-031-80/+86
| | | | | | | | | | | The amount of copy-paste in this test led to a few bugs and it was hard to spot them since things were done in random order. Use a different approach: compute the result of a^b (mod m) according to BN_mod_exp_simple(), then compare the results of all the other *_mod_exp* functions to that. Reuse the test structure from bn_mod_exp_zero.c to loop over the list of functions. This way we test more functions and don't forget to check some crucial bits.
* Add missing checks for BN_mod_exp_{non,}ct()tb2022-12-031-6/+8
| | | | | | Someone added a few more functions to test, but forgot to check their results, so if they would not do the expected thing that would only be noticed if one of the already tested functions would break.
* Fix some ancient silliness with a random bytetb2022-12-031-8/+5
| | | | | | | For nearly 25 years this test has attempted to generate random numbers of bit length between 192 and 319 bits. Unfortunately, it used an unsigned char so instead of generating numbers in the interval [-64..63] and add them to 256, it used numbers in the intervals [0..63] and [192..255]...
* bn_mod_exp.c: printing to stdout needs no BIOtb2022-12-021-17/+9
|
* bn_mod_exp: we have a BN_CTX available...tb2022-12-021-19/+15
| | | | Use BN_CTX_get() instead of BN_new()/BN_free().
* Check BN_rand() and BN_mod() return valuestb2022-12-021-6/+11
| | | | | CID 430848 CID 430849
* Link new bn_mod_exp_zero test to buildtb2022-12-021-1/+3
|
* Rewrite the tests that various modular exponentiation functionstb2022-12-022-148/+189
| | | | compute a^0 = 0 (mod 1) for all a from scratch.
* libcrypto/bn: switch back to manual regress targetstb2022-12-021-3/+8
| | | | | The previous change had the undesired side effect of running the super verbose run-regress-bn_test.
* Use the default targets from bsd.regress.mk as far as possibletb2022-12-021-9/+4
|
* bn_add_sub: no need for a BIO to print to stderrtb2022-12-021-21/+13
|
* Fix typo, move one .PHONY target nearer to the target itselftb2022-12-011-4/+3
|
* zap extra blank linetb2022-12-011-2/+1
|
* Check that the bn_isqrt -C output isn't changedtb2022-12-012-1/+43
| | | | | | bn_isqrt -C generates code included in lib/libcrypto/lib/bn_isqrt.c. The regress tests already ensure that the content of the tables don't change. Ensure further that the code generation doesn't get out of sync.
* regress/libcrypto: merge exp/ into bn/tb2022-12-012-1/+361
| | | | | | | Move exp/exptest.c to bn/bn_mod_exp.c. This is a BN test that mostly tests a variety of BN_mod_exp*() API behavior and correctness. Commit stolen from jsing
* Flatten structure of libcrypto/bn teststb2022-12-0115-116/+62
| | | | | | | | | The bn tests were distributed into three subdirectories rather randomly. It's cleaner and easier to maintain if all this is in a single directory. Use consistent names for the .c files, unify handling of the tests with the exception of bn_test, which is special. Discussed with jsing
* Test prime constants exposed in public BN APItb2022-12-011-1/+97
| | | | | Run the prime constants exposed in BN_get0_nist_prime_*() and BN_get_rfc3526_prime_*() through Ballie-PSW.
* Refrain from printing SUCCESS in some of my teststb2022-12-017-26/+7
| | | | Silence is good. On failure, the regress framework will make it clear.
* Add regress coverage for BN_cmp()/BN_ucmp().jsing2022-11-302-3/+347
| | | | | Some tests current fail due to a bug in BN_ucmp(), which will be fixed soon.