summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_prime.c
AgeCommit message (Collapse)Author
2007-09-18Minimize stack utilization in probable_prime [from HEAD].Andy Polyakov
2006-09-18Ensure that the addition mods[i]+delta cannot overflow in probable_prime().Bodo Möller
[Problem pointed out by Adam Young <adamy (at) acm.org>]
2006-01-132 is a prime number ...Nils Larsch
PR: 1266
2004-03-25Adjust various bignum functions to use BN_CTX for variables instead ofGeoff Thorpe
locally initialising their own. NB: I've removed the "BN_clear_free()" loops for the exit-paths in some of these functions, and that may be a major part of the performance improvements we're seeing. The "free" part can be removed because we're using BN_CTX. The "clear" part OTOH can be removed because BN_CTX destruction automatically performs this task, so performing it inside functions that may be called repeatedly is wasteful. This is currently safe within openssl due to the fact that BN_CTX objects are never created for longer than a single high-level operation. However, that is only because there's currently no mechanism in openssl for thread-local storage. Beyond that, this might be an issue for applications using the bignum API directly and caching their own BN_CTX objects. The solution is to introduce a flag to BN_CTX_start() that allows its variables to be automatically sanitised on release during BN_CTX_end(). This way any higher-level function (and perhaps the application) can specify this flag in its own BN_CTX_start()/BN_CTX_end() pair, and this will cause inner-loop functions specifying the flag to be ignored so that sanitisation is handled only once back out at the higher level. I will be implementing this in the near future.
2003-11-04Put the first stage of my bignum debugging adventures into CVS. This codeGeoff Thorpe
is itself experimental, and in addition may cause execution to break on existing openssl "bugs" that previously were harmless or at least invisible.
2003-02-01Old-style callbacks can be NULL!Ben Laurie
2003-01-10Make sure everything that may be freed is allocated or initiated.Richard Levitte
PR: 446
2002-12-08Nils Larsch submitted;Geoff Thorpe
- a patch to fix a memory leak in rsa_gen.c - a note about compiler warnings with unions - a note about improving structure element names This applies his patch and implements a solution to the notes.
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.
2001-09-04OpenSSL copyright notices ...Bodo Möller
2001-09-03Correct a typo.Geoff Thorpe
2001-09-03Use uniformly chosen witnesses for Miller-Rabin testBodo Möller
(by using new BN_pseudo_rand_range function)
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-02-05New functions BN_CTX_start(), BN_CTX_get(), BN_CTX_end() to accessUlf Möller
temporary BIGNUMs. BN_CTX still uses a fixed number of BIGNUMs, but the BN_CTX implementation could now easily be changed.
2000-02-03ispell (and minor modifications)Ulf Möller
2000-02-03Some 'const's for BNs.Bodo Möller
2000-02-02Include OpenSSL license.Bodo Möller
2000-02-02Tolerate negative numbers in BN_is_prime.Bodo Möller
2000-02-02rndsort{Miller, Rabin} primality test.Bodo Möller
2000-02-01Bug fix: BN_is_prime() would fail with a high probability for smallUlf Möller
primes (negligible for larger ones).
2000-01-30Seek out and destroy another evil cast.Ulf Möller
2000-01-30Make output of "openssl dsaparam 1024" more interesting :-)Bodo Möller
2000-01-30Make DSA_generate_parameters, and fix a couple of bugBodo Möller
(including another problem in the s3_srvr.c state machine).
2000-01-27Document DSA and SHA.Ulf Möller
New function BN_pseudo_rand(). Use BN_prime_checks_size(BN_num_bits(w)) rounds of Miller-Rabin when generating DSA primes (why not use BN_is_prime()?)
2000-01-23Document the BN library.Ulf Möller
2000-01-22Document the DH library, and make some minor changes along the way.Ulf Möller
2000-01-13Precautions against using the PRNG uninitialized: RAND_bytes() nowUlf Möller
returns int (1 = ok, 0 = not seeded). New function RAND_add() is the same as RAND_seed() but takes an estimate of the entropy as an additional argument.
2000-01-12Turn BN_prime_checks into a macro.Bodo Möller
Primes p where (p-1)/2 is prime too are called "safe", not "strong".
1999-06-03More evil cast removal.Ben Laurie
1999-05-20Bignum library bug fix. IRIX 6 passes "make test" now!Ulf Möller
This also avoids the problems with SC4.2 and unpatched SC5. Submitted by: Andy Polyakov <appro@fy.chalmers.se>
1999-04-26Remove NOPROTO-related macros.Ulf Möller
1999-04-26Remove NOPROTO definitions and error code comments.Ulf Möller
1999-04-23Change #include filenames from <foo.h> to <openssl.h>.Bodo Möller
Submitted by: Reviewed by: PR:
1999-04-19Change functions to ANSI C.Ulf Möller
1999-02-25Fix clearly untested "clever" hack.Ben Laurie
1998-12-21Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeayRalf S. Engelschall
1998-12-21Import of old SSLeay release: SSLeay 0.9.0bRalf S. Engelschall
1998-12-21Import of old SSLeay release: SSLeay 0.8.1bRalf S. Engelschall