summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bntest.c
AgeCommit message (Collapse)Author
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
Conflicts: crypto/bn/bntest.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-08Fix for CVE-2014-3570.Andy Polyakov
Reviewed-by: Emilia Kasper <emilia@openssl.org> (cherry picked from commit e793809ba50c1e90ab592fb640a856168e50f3de)
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-07-04Fix warnings: C++ comments and computed value not used.Dr. Stephen Henson
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
2000-11-29Fix BN_kronecker so that it works correctly if 'a' is negativeBodo Möller
(we need the two's complement of BN_lsw then).
2000-11-29BN_to_montgomery expects its inputs to be in the interval 0 .. modulus-1,Bodo Möller
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.
2000-11-29Fix warnings in expspeed.c (but the segmentation fault remains)Bodo Möller
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
2000-11-29Implement BN_kronecker test.Bodo Möller
Modify "CHANGES" entry for BN_mod_inverse (it's not just avoiding BN_div that increases performance, avoiding BN_mul also helps)
2000-11-28Correct a bug in BN_kronecker.Bodo Möller
Sketch the test for BN_kronecker.
2000-11-28Add test_kron function, which will contain a test for BN_kronecker.Bodo Möller
2000-11-27Undo previous commit, which was an accident.Bodo Möller
2000-11-27Fix BN_is_... macros.Bodo Möller
Fix BN_gcd. Analyze BN_mod_inverse. Add BN_kronecker. "make update".
2000-11-26More BN_mod_... functions.Bodo Möller
2000-11-06Constify the BIGNUM routines a bit more. The only trouble were theRichard Levitte
two functions that did expansion on in parameters (BN_mul() and BN_sqr()). The problem was solved by making bn_dup_expand() which is a mix of bn_expand2() and BN_dup().
2000-03-02Update comment.Bodo Möller
2000-02-27Don't call BN_rand with zero bits in bntest.cDr. Stephen Henson
2000-02-25Enhance consistency by using BIO_flush() instead of fflush().Richard Levitte
2000-02-24Do fflush(stdout) when there was an error.Bodo Möller
2000-02-23correct macro.Ulf Möller