| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
This currently fails.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This is only testing basic functionality anyway, so 10000 tests are more
than enough.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
This will be needed once headers pull in bn_arch.h.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
The public APIs still change behaviour based on BN_FLG_CONSTTIME - set it
to avoid benchmark noise.
|
| |
|
|
|
|
| |
BN_rand() takes a bit length, not the top bit.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This prevents realloc from unnecessarily impacting the lshift benchmarks.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Provide regress coverage for BN_lshift1(), BN_rshift1(), BN_lshift() and
BN_rshift(), along with basic benchmarking functionality (run via
'make benchmark').
|
| |
|
| |
|
|
|
|
| |
In bn_test.c include bn_local.h instead of using copy-pasted prototypes.
|
| |
|
|
|
|
|
| |
Drop unnecessary loading of error strings, fix error path and consistently
print to stdout.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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]...
|
| |
|
|
|
|
| |
Use BN_CTX_get() instead of BN_new()/BN_free().
|
|
|
|
|
| |
CID 430848
CID 430849
|
| |
|
|
|
|
| |
compute a^0 = 0 (mod 1) for all a from scratch.
|
|
|
|
|
| |
The previous change had the undesired side effect of running the super
verbose run-regress-bn_test.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Run the prime constants exposed in BN_get0_nist_prime_*() and
BN_get_rfc3526_prime_*() through Ballie-PSW.
|
|
|
|
| |
Silence is good. On failure, the regress framework will make it clear.
|
|
|
|
|
| |
Some tests current fail due to a bug in BN_ucmp(), which will be fixed
soon.
|