| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
These are expected failures for BN_mod_exp_simple() and the internal
BN_mod_exp_recp(), which will be fixed shortly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide bn_rand_in_range() which is a slightly tweaked version of what was
previously called bn_rand_range().
The way bn_rand_range() is called in libcrypto, the lower bound is always
expressible as a word. In fact, most of the time it is 1, the DH code uses
a 2, the MR tests in BPSW use 3 and an exceptinally high number appears in
the Tonelli-Shanks implementation where we use 32. Converting these lower
bounds to BIGNUMs on the call site is annoying so let bn_rand_interval()
do that internally and route that through bn_rand_in_range(). This way we
can avoid using BN_sub_word().
Adjust the bn_isqrt() test to use bn_rand_in_range() since that's the
only caller that uses actual BIGNUMs as lower bounds.
ok jsing
|
|
|
|
|
|
| |
This test was never particularly useful. An upcoming API change for
the internal bn_rand_interval() API would require some adjustments.
It's not worth it.
|
|
|
|
|
|
| |
Some people already have way too many simple and not too important diffs in
their inbox. This isn't worth kicking something more important out of the
queue.
|
|
|
|
|
| |
This currently adds an incorrect 00: padding, consistent with OpenSSL's
behavior.
|
| |
|
| |
|
|
|
|
|
| |
This must be one of the ugliest tests I've ever written, but I can't think
of a better way of doing it.
|
| |
|
|
|
|
|
| |
Test BN_sqr() with a newly allocated BN, a BN explicitly set to zero and
small values that fit in a single BN_ULONG.
|
|
|
|
|
| |
Currently BN_hex2bn() removes the leading zeros, however this will not be
the case in the future.
|
|
|
|
|
| |
Currently BN_hex2bn() removes the leading zeros, however this will not be
the case in the future.
|
| |
|
| |
|
|
|
|
|
| |
Provide prototype that is hidden behind LIBRESSL_INTERNAL for portable
and or in result for future extensibility.
|
|
|
|
|
| |
This would detect the aliasing issue reported by Guido Vranken fixed
in bn_gcd.c r1.28. Most testcases are from BoringSSL's regress test.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This is a hack needed until bn_local.h is updated
|
| |
|
| |
|
| |
|
|
|
|
| |
The code they test will go away soon.
|
|
|
|
|
|
|
|
|
|
|
|
| |
While base bc is great, it uses libcrypto's BIGNUM implementation.
This implies that the independent verification of the bn_test isn't
as independent as it should be.
With this commit, run-bc picks up bn-gh if it is installed. This appears
to work on amd64, arm64 and sparc64 (where gbc is busted). I will send
PRs to the regress maintainers once I will have tested this a bit more
thoroughly. Committing this early since I juggle way too many diffs
already.
|
| |
|
|
|
|
| |
non-deterministic nature of the old implementation.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
We can use the undocumented functions {i2s,s2i}_ASN1_INTEGER(3) to
exercise bn_to_string(). This way we use public API and remove the
need of linking statically.
|
| |
|
| |
|
|
|
|
|
| |
There is a BN_CTX at program scope. Pass it into all test functions.
This simplifies memory management at the end of the functions quite a bit.
|
| |
|
| |
|
|
|
|
|
|
| |
Make message() print and clear the error stack. This way we can know
what test errored. To make this work also clear the error stack after
a handful of xfail tests.
|
|
|
|
| |
This is not only simpler but also required by an upcoming change.
|
| |
|
|
|
|
| |
in the entire code base it also has a few parentheses too many
|
|
|
|
|
|
|
| |
Various test functions had bugs due to the fact that the return code
would be set to 1 at the top so that each error would have to set rc = 0.
This is silly. Fail closed instead by setting rc = 0 at the top and only
flipping to 1 before the err label
|
|
|
|
|
|
| |
lst[] can be converted from a bit string to a hex string. Use BN_hex2bn()
isntead of BN_bin2bn(). Handle this inside test_lshift() rather than doing
artistic ownership dances.
|
| |
|
| |
|
| |
|