summaryrefslogtreecommitdiff
path: root/crypto/bn/bn_recp.c
Commit message (Collapse)AuthorAgeFilesLines
* Missing BN_RECP_CTX field init.FdaSilvaYY2016-11-081-3/+3
| | | | | | | BN_RECP_CTX_new direclty use bn_init to avoid twice memset calls Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1879)
* Copyright consolidation 06/10Rich Salz2016-05-171-54/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* GH678: Add a few more zallocFdaSilvaYY2016-02-221-1/+1
| | | | | | | Remove some duplicated NULL/zero init. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Remove BN_initRich Salz2015-11-301-2/+2
| | | | | | Rename it to be an internal function bn_init. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix memory leaks and other mistakes on errorsAlessandro Ghedini2015-10-231-1/+3
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-141-1/+1
| | | | | | | | | | | | | There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
* Use safer sizeof variant in mallocRich Salz2015-05-041-1/+1
| | | | | | | | | | | | | For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
* remove malloc castsRich Salz2015-04-281-1/+1
| | | | | | | Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Final (for me, for now) dead code cleanupRich Salz2015-02-081-2/+0
| | | | | | | This is a final pass looking for '#if 0'/'#if 1' controls and removing the appropriate pieces. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-221-153/+165
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* bn/bn_recp.c: make it indent-friendly.Andy Polyakov2015-01-221-8/+8
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* mark all block comments that need format preserving so thatTim Hudson2014-12-301-1/+2
| | | | | | | indent will not alter them when reformatting comments Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* remove OPENSSL_FIPSAPIDr. Stephen Henson2014-12-081-1/+1
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* RT2163: Remove some unneeded #include'sDoug Goldstein2014-08-181-1/+0
| | | | | | | Several files #include stdio.h and don't need it. Also, per tjh, remove BN_COUNT Reviewed-by: Emilia Kasper <emilia@openssl.org>
* Version skew reduction: trivia (I hope).Ben Laurie2012-06-031-1/+0
|
* Move all FIPSAPI renames into fips.h header file, include early inDr. Stephen Henson2011-01-271-4/+2
| | | | | | crypto.h if needed. Modify source tree to handle change.
* Redirect FIPS memory allocation to FIPS_malloc() routine, removeDr. Stephen Henson2011-01-271-0/+5
| | | | OpenSSL malloc dependencies.
* Revert the size_t modifications from HEAD that had led to moreGeoff Thorpe2008-11-121-1/+1
| | | | | | knock-on work than expected - they've been extracted into a patch series that can be completed elsewhere, or in a different branch, before merging back to HEAD.
* size_tification.Ben Laurie2008-11-011-1/+1
|
* fix warnings when building openssl with the following compiler options:Nils Larsch2005-08-281-2/+2
| | | | | | | -Wmissing-prototypes -Wcomment -Wformat -Wimplicit -Wmain -Wmultichar -Wswitch -Wshadow -Wtrigraphs -Werror -Wchar-subscripts -Wstrict-prototypes -Wreturn-type -Wpointer-arith -W -Wunused -Wno-unused-parameter -Wuninitialized
* Fix various incorrect error function codes.Bodo Möller2005-04-261-1/+1
| | | | ("perl util/ck_errf.pl */*.c */*/*.c" still reports many more.)
* Adjust various bignum functions to use BN_CTX for variables instead ofGeoff Thorpe2004-03-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Convert openssl code not to assume the deprecated form of BN_zero().Geoff Thorpe2004-03-131-3/+2
| | | | | | | | | Remove certain redundant BN_zero() initialisations, because BN_CTX_get(), BN_init(), [etc] already initialise to zero. Correct error checking in bn_sqr.c, and be less wishy-wash about how/why the result's 'top' value is set (note also, 'max' is always > 0 at this point).
* bn_fix_top() exists for compatibility's sake and is mapped toGeoff Thorpe2003-12-011-2/+2
| | | | | | | | | | bn_correct_top() or bn_check_top() depending on debug settings. For internal source, all bn_fix_top()s should be converted one way or the other depending on whether the use of bn_correct_top() is justified. For BN_div_recp(), these cases should not require correction if the other bignum functions are doing their jobs properly, so convert to bn_check_top().
* Put the first stage of my bignum debugging adventures into CVS. This codeGeoff Thorpe2003-11-041-0/+2
| | | | | | is itself experimental, and in addition may cause execution to break on existing openssl "bugs" that previously were harmless or at least invisible.
* Some provisional bignum debugging has begun to detect inconsistent BIGNUMGeoff Thorpe2003-10-291-0/+2
| | | | | | | structures being passed in to or out of API functions, and this corrects a couple of cases found so far. Also, lop off a couple of bytes of white-space.
* The BN_mul bug test apparently is no longer neededBodo Möller2000-12-141-37/+0
|
* Fix some things that look like bugs.Bodo Möller2000-12-071-12/+55
| | | | | | 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.
* modular arithmeticsBodo Möller2000-11-261-1/+3
| | | | "make update"
* Constify the BIGNUM routines a bit more. The only trouble were theRichard Levitte2000-11-061-7/+9
| | | | | | 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().
* There have been a number of complaints from a number of sources that namesRichard Levitte2000-06-011-2/+2
| | | | | | | | | like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
* workaround no longer neededUlf Möller2000-02-261-9/+0
|
* BN_div_recp fix. I've ran divtest for 10 mins and it didn't exhibit aAndy Polyakov2000-02-261-18/+8
| | | | | single fault:-) Needless to mention that bnbug.c posted couple of days ago passes as well...
* divide the correct number...Ulf Möller2000-02-251-1/+1
|
* work around a bug in BN_div_recp or BN_reciprocalUlf Möller2000-02-241-0/+9
|
* Improve bntest slightly, and fix another bug in the BN library.Ulf Möller2000-02-061-0/+1
|
* New functions BN_CTX_start(), BN_CTX_get(), BN_CTX_end() to accessUlf Möller2000-02-051-10/+12
| | | | | temporary BIGNUMs. BN_CTX still uses a fixed number of BIGNUMs, but the BN_CTX implementation could now easily be changed.
* Some constification and stacks that slipped through the cracks (how?).Ben Laurie1999-06-041-1/+1
|
* Change functions to ANSI C.Ulf Möller1999-04-191-26/+9
|
* Accept NULL in *_free.Ben Laurie1999-01-071-0/+3
|
* Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeayRalf S. Engelschall1998-12-211-30/+146
|
* Import of old SSLeay release: SSLeay 0.9.0bRalf S. Engelschall1998-12-211-1/+1
|
* Import of old SSLeay release: SSLeay 0.8.1bRalf S. Engelschall1998-12-211-0/+125