summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bntest.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix WIN32 build by disabling bn* calls.Dr. Stephen Henson2014-10-291-2/+6
| | | | | | | 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>
* Add a test to check we're really generating probable primes.Felix Laurie von Massenbach2014-06-011-0/+38
|
* Ensure that, when generating small primes, the result is actually of theAdam Langley2013-06-041-0/+28
| | | | | | | | | | | 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
* Add RFC5114 DH parameters to OpenSSL. Add test data to dhtest.Dr. Stephen Henson2011-11-131-1/+0
|
* Fix OPENSSL_BN_ASM_MONT5 for corner cases; add a test.Bodo Möller2011-10-131-0/+77
| | | | Submitted by: Emilia Kasper
* New option to disable characteristic two fields in EC code.Dr. Stephen Henson2011-02-121-4/+4
|
* PR: 2062Dr. Stephen Henson2009-10-011-1/+1
| | | | | | | Submitted by: Julia Lawall <julia@diku.dk> Approved by: steve@openssl.org Correct BN_rand error handling in bntest.c
* PR: 1835Dr. Stephen Henson2009-02-141-2/+2
| | | | | | | Submitted by: Damien Miller <djm@mindrot.org> Approved by: steve@openssl.org Fix various typos.
* Fix warnings.Dr. Stephen Henson2007-08-121-30/+30
|
* Change array representation of binary polynomials to make GF2m part ofBodo Möller2006-06-191-16/+16
| | | | | | the BN library more generally useful. Submitted by: Douglas Stebila
* ensure the pointer is valid before using itNils Larsch2006-03-181-0/+2
|
* Eliminate warning induced by http://cvs.openssl.org/chngview?cn=14690 andAndy Polyakov2005-12-161-1/+1
| | | | keep disclaiming narrower than 32-bit support.
* Implement fixed-window exponentiation to mitigate hyper-threadingBodo Möller2005-05-161-0/+56
| | | | | | | | | | | | 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
* All SIXTY_FOUR_BIT platforms (mind the difference between SIXTY_FOUR_BIT andAndy Polyakov2004-07-221-3/+19
| | | | SIXTY_FOUR_BIT_LONG) were failing to pass 'cd test; make test_bn'.
* BN_div_word() was breaking when called from BN_bn2dec() (actually, this isGeoff Thorpe2004-06-171-0/+61
| | | | | | | | | 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
* Update any code that was using deprecated functions so that everything buildsGeoff Thorpe2003-10-291-6/+11
| | | | and links with OPENSSL_NO_DEPRECATED defined.
* more mingw related cleanups.Ulf Möller2003-02-221-9/+0
|
* This is a first-cut at improving the callback mechanisms used inGeoff Thorpe2002-12-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Have all tests use EXIT() to exit rather than exit(), since the latter doesn'tRichard Levitte2002-11-281-7/+7
| | | | always give the expected result on some platforms.
* Sun has agreed to removing the covenant language from most files.Bodo Möller2002-10-291-13/+0
| | | | Submitted by: Sheueling Chang <Sheueling.Chang@Sun.COM>
* move GF2m tests to the endBodo Möller2002-08-021-8/+8
|
* Binary field arithmetic contributed by Sun Microsystems.Bodo Möller2002-08-021-0/+646
| | | | | | | | 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)
* remove obsolete commentBodo Möller2002-07-101-1/+1
|
* Hide BN_CTX structure details.Bodo Möller2001-03-081-5/+7
| | | | Incease the number of BIGNUMs in a BN_CTX.
* e_os.h does not belong with the exported headers. Do not put it thereRichard Levitte2001-02-221-1/+1
| | | | | | | | 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.
* Use new-style system-id macros everywhere possible. I hope I haven'tRichard Levitte2001-02-201-1/+1
| | | | | | | 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.
* Make all configuration macros available for application by makingRichard Levitte2001-02-191-1/+1
| | | | | | | | | | | | 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.
* Fix some things that look like bugs.Bodo Möller2000-12-071-7/+6
| | | | | | 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.
* Sign-related fixes (and tests).Bodo Möller2000-12-071-2/+14
| | | | | | BN_mod_exp_mont does not work properly yet if modulus m is negative (we want computations to be carried out modulo |m|).
* Use bc's "print" feature whenever it is available,Bodo Möller2000-12-061-2/+0
| | | | not just on certain platforms.
* test_mod_mul is useful, let's run it more often.Ulf Möller2000-12-061-1/+3
|
* forgot to remove the loop variableUlf Möller2000-12-021-8/+0
|
* Loops like this one:Ulf Möller2000-12-021-28/+0
| | | | | | | | 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.
* New function BN_bntest_rand() to detect more BN library bugs.Ulf Möller2000-12-021-35/+33
| | | | | | 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.
* Fix BN_rshift, which caused lots of trouble.Bodo Möller2000-11-301-18/+2
|
* Remove randomness from the test. These constants give me a segmentBodo Möller2000-11-301-2/+8
| | | | violation in test_kron on a 32 bit system.
* BN_mod_exp(r,a,p,m,ctx) should not be called with r == p.Bodo Möller2000-11-301-45/+19
| | | | | | | | | 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).
* It's "#elif", not "#elsif".Bodo Möller2000-11-301-1/+31
|
* BN_mod_exp problems ...Bodo Möller2000-11-301-0/+10
|
* Fix bntest.c problem -- one of the primes got lostBodo Möller2000-11-301-1/+1
|
* BN_sqrtBodo Möller2000-11-301-5/+77
|
* Fix BN_kronecker so that it works correctly if 'a' is negativeBodo Möller2000-11-291-2/+2
| | | | (we need the two's complement of BN_lsw then).
* BN_to_montgomery expects its inputs to be in the interval 0 .. modulus-1,Bodo Möller2000-11-291-0/+3
| | | | | | | | | | | | | | | | so we have to reduce the random numbers used in test_mont. Before this change, test_mont failed in [debug-]solaris-sparcv9-gcc configurations ("Montgomery multiplication test failed!" because the multiplication result obtained with Montgomery multiplication differed from the result obtained by BN_mod_mul). Substituing the old version of bn_gcd.c (BN_mod_inverse) did not avoid the problem. The strange thing is that it I did not observe any problems when using debug-solaris-sparcv8-gcc and solaris-sparcv9-cc, as well as when compiling OpenSSL 0.9.6 in the solaric-sparcv9-gcc configuration on the same system.
* Fix warnings in expspeed.c (but the segmentation fault remains)Bodo Möller2000-11-291-1/+4
| | | | | | | | Improve readability of bn_shift.c. Add comment in bn_lib.c (why zero data between top and max?) Change bntest.c output for BN_kronecker test
* Implement BN_kronecker test.Bodo Möller2000-11-291-2/+78
| | | | | Modify "CHANGES" entry for BN_mod_inverse (it's not just avoiding BN_div that increases performance, avoiding BN_mul also helps)
* Correct a bug in BN_kronecker.Bodo Möller2000-11-281-0/+10
| | | | Sketch the test for BN_kronecker.
* Add test_kron function, which will contain a test for BN_kronecker.Bodo Möller2000-11-281-0/+11
|
* Undo previous commit, which was an accident.Bodo Möller2000-11-271-4/+0
|
* Fix BN_is_... macros.Bodo Möller2000-11-271-0/+4
| | | | | | | Fix BN_gcd. Analyze BN_mod_inverse. Add BN_kronecker. "make update".
* More BN_mod_... functions.Bodo Möller2000-11-261-0/+10
|