summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bntest.c
AgeCommit message (Collapse)Author
2015-03-31Stop symlinking, move files to intended directoryRichard Levitte
Rather than making include/openssl/foo.h a symlink to crypto/foo/foo.h, this change moves the file to include/openssl/foo.h once and for all. Likewise, move crypto/foo/footest.c to test/footest.c, instead of symlinking it there. Originally-by: Geoff Thorpe <geoff@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-02-02Dead code cleanup: #if 0 dropped from testsRich Salz
Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-01-29clang on Linux x86_64 complains about unreachable code.Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-01-24ifdef cleanup, part 4a: '#ifdef undef'Rich Salz
This removes all code surrounded by '#ifdef undef' One case is left: memmove() replaced by open-coded for loop, in crypto/stack/stack.c That needs further review. Also removed a couple of instances of /* dead code */ if I saw them while doing the main removal. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22bn/bntest.c: make it indent-friendly.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-13Remove use of BN_init, BN_RECP_CTX_init from bntestDr. Stephen Henson
BN_init and BN_RECP_CTX_init are deprecated and are not exported from shared libraries on some platforms (e.g. Windows) convert bntest to use BN_new and BN_RECP_CTX_new instead. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-08Fix for CVE-2014-3570 (with minor bn_asm.c revamp).Andy Polyakov
Reviewed-by: Emilia Kasper <emilia@openssl.org>
2014-12-18Remove redundant OPENSSL_NO_DEPRECATED suppressionMatt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-10-29Fix WIN32 build by disabling bn* calls.Dr. Stephen Henson
The trial division and probable prime with coprime tests are disabled on WIN32 builds because they use internal functions not exported from the WIN32 DLLs. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2014-06-01Add a test to check we're really generating probable primes.Felix Laurie von Massenbach
2013-06-04Ensure that, when generating small primes, the result is actually of theAdam Langley
requested size. Fixes OpenSSL #2701. This change does not address the cases of generating safe primes, or where the |add| parameter is non-NULL. Conflicts: crypto/bn/bn.h crypto/bn/bn_err.c
2011-11-13Add RFC5114 DH parameters to OpenSSL. Add test data to dhtest.Dr. Stephen Henson
2011-10-13Fix OPENSSL_BN_ASM_MONT5 for corner cases; add a test.Bodo Möller
Submitted by: Emilia Kasper
2011-02-12New option to disable characteristic two fields in EC code.Dr. Stephen Henson
2009-10-01PR: 2062Dr. Stephen Henson
Submitted by: Julia Lawall <julia@diku.dk> Approved by: steve@openssl.org Correct BN_rand error handling in bntest.c
2009-02-14PR: 1835Dr. Stephen Henson
Submitted by: Damien Miller <djm@mindrot.org> Approved by: steve@openssl.org Fix various typos.
2007-08-12Fix warnings.Dr. Stephen Henson
2006-06-18Change array representation of binary polynomials to make GF2m part ofBodo Möller
the BN library more generally useful. Submitted by: Douglas Stebila
2006-03-18ensure the pointer is valid before using itNils Larsch
2005-12-16Eliminate warning induced by http://cvs.openssl.org/chngview?cn=14690 andAndy Polyakov
keep disclaiming narrower than 32-bit support.
2005-05-16Implement fixed-window exponentiation to mitigate hyper-threadingBodo Möller
timing attacks. BN_FLG_EXP_CONSTTIME requests this algorithm, and this done by default for RSA/DSA/DH private key computations unless RSA_FLAG_NO_EXP_CONSTTIME/DSA_FLAG_NO_EXP_CONSTTIME/ DH_FLAG_NO_EXP_CONSTTIME is set. Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
2004-07-22All SIXTY_FOUR_BIT platforms (mind the difference between SIXTY_FOUR_BIT andAndy Polyakov
SIXTY_FOUR_BIT_LONG) were failing to pass 'cd test; make test_bn'.
2004-06-17BN_div_word() was breaking when called from BN_bn2dec() (actually, this isGeoff Thorpe
the only function that uses it) because it would trip up an assertion in bn_div_words() when first invoked. This also adds BN_div_word() testing to bntest. Submitted by: Nils Larsch Reviewed by: Geoff Thorpe
2003-10-29Update any code that was using deprecated functions so that everything buildsGeoff Thorpe
and links with OPENSSL_NO_DEPRECATED defined.
2003-02-22more mingw related cleanups.Ulf Möller
2002-12-08This is a first-cut at improving the callback mechanisms used inGeoff Thorpe
key-generation and prime-checking functions. Rather than explicitly passing callback functions and caller-defined context data for the callbacks, a new structure BN_GENCB is defined that encapsulates this; a pointer to the structure is passed to all such functions instead. This wrapper structure allows the encapsulation of "old" and "new" style callbacks - "new" callbacks return a boolean result on the understanding that returning FALSE should terminate keygen/primality processing. The BN_GENCB abstraction will allow future callback modifications without needing to break binary compatibility nor change the API function prototypes. The new API functions have been given names ending in "_ex" and the old functions are implemented as wrappers to the new ones. The OPENSSL_NO_DEPRECATED symbol has been introduced so that, if defined, declaration of the older functions will be skipped. NB: Some openssl-internal code will stick with the older callbacks for now, so appropriate "#undef" logic will be put in place - this is in case the user is *building* openssl (rather than *including* its headers) with this symbol defined. There is another change in the new _ex functions; the key-generation functions do not return key structures but operate on structures passed by the caller, the return value is a boolean. This will allow for a smoother transition to having key-generation as "virtual function" in the various ***_METHOD tables.
2002-11-28Have all tests use EXIT() to exit rather than exit(), since the latter doesn'tRichard Levitte
always give the expected result on some platforms.
2002-10-29Sun has agreed to removing the covenant language from most files.Bodo Möller
Submitted by: Sheueling Chang <Sheueling.Chang@Sun.COM>
2002-08-02move GF2m tests to the endBodo Möller
2002-08-02Binary field arithmetic contributed by Sun Microsystems.Bodo Möller
The 'OPENSSL_NO_SUN_DIV' default is still subject to change, so I didn't bother to finish the CHANGES entry yet. Submitted by: Douglas Stebila <douglas.stebila@sun.com>, Sheueling Chang <sheueling.chang@sun.com> (CHANGES entry by Bodo Moeller)
2002-07-10remove obsolete commentBodo Möller
2001-03-08Hide BN_CTX structure details.Bodo Möller
Incease the number of BIGNUMs in a BN_CTX.
2001-02-22e_os.h does not belong with the exported headers. Do not put it thereRichard Levitte
and make all files the depend on it include it without prefixing it with openssl/. This means that all Makefiles will have $(TOP) as one of the include directories.
2001-02-20Use new-style system-id macros everywhere possible. I hope I haven'tRichard Levitte
missed any. This compiles and runs on Linux, and external applications have no problems with it. The definite test will be to build this on VMS.
2001-02-19Make all configuration macros available for application by makingRichard Levitte
sure they are available in opensslconf.h, by giving them names starting with "OPENSSL_" to avoid conflicts with other packages and by making sure e_os2.h will cover all platform-specific cases together with opensslconf.h. I've checked fairly well that nothing breaks with this (apart from external software that will adapt if they have used something like NO_KRB5), but I can't guarantee it completely, so a review of this change would be a good thing.
2000-12-07Fix some things that look like bugs.Bodo Möller
One problem that looked like a problem in bn_recp.c at first turned out to be a BN_mul bug. An example is given in bn_recp.c; finding the bug responsible for this is left as an exercise.
2000-12-07Sign-related fixes (and tests).Bodo Möller
BN_mod_exp_mont does not work properly yet if modulus m is negative (we want computations to be carried out modulo |m|).
2000-12-06Use bc's "print" feature whenever it is available,Bodo Möller
not just on certain platforms.
2000-12-06test_mod_mul is useful, let's run it more often.Ulf Möller
2000-12-02forgot to remove the loop variableUlf Möller
2000-12-02Loops like this one:Ulf Möller
if (bp == NULL) for (j=0; j<10000; j++) BN_add(&c,&a,&b); seem to be pretty useless, and bp never is NULL anyway.
2000-12-02New function BN_bntest_rand() to detect more BN library bugs.Ulf Möller
The bn_cmp_part_words bug was only caught in the BN_mod_mul() test, not in the BN_mul() test, so apparently the choice of parameters in some cases is bad.
2000-11-30Fix BN_rshift, which caused lots of trouble.Bodo Möller
2000-11-30Remove randomness from the test. These constants give me a segmentBodo Möller
violation in test_kron on a 32 bit system.
2000-11-30BN_mod_exp(r,a,p,m,ctx) should not be called with r == p.Bodo Möller
But even if this is avoided, there are still segmentation violations (during one of the BN_free()s at the end of test_kron in some cases, in other cases during BN_kronecker, or later in BN_sqrt; choosing a different exponentiation algorithm in bntest.c appears to influence when the SIGSEGV takes place).
2000-11-30It's "#elif", not "#elsif".Bodo Möller
2000-11-30BN_mod_exp problems ...Bodo Möller
2000-11-30Fix bntest.c problem -- one of the primes got lostBodo Möller
2000-11-30BN_sqrtBodo Möller