summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_mul.c
AgeCommit message (Collapse)Author
2019-09-28Reorganize local header filesDr. Matthias St. Pierre
Apart from public and internal header files, there is a third type called local header files, which are located next to source files in the source directory. Currently, they have different suffixes like '*_lcl.h', '*_local.h', or '*_int.h' This commit changes the different suffixes to '*_local.h' uniformly. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
2018-12-06Following the license change, modify the boilerplates in crypto/bn/Richard Levitte
[skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7777)
2018-09-11Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7176)
2018-08-23crypto/bn: add more fixed-top routines.Andy Polyakov
Add bn_{mul|sqr}_fixed_top, bn_from_mont_fixed_top, bn_mod_sub_fixed_top. Switch to bn_{mul|sqr}_fixed_top in bn_mul_mont_fixed_top and remove memset in bn_from_montgomery_word. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/6915)
2017-10-18Remove parentheses of return.KaoruToda
Since return is inconsistent, I removed unnecessary parentheses and unified them. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4541)
2017-10-09Since return is inconsistent, I removed unnecessary parentheses andKaoruToda
unified them. - return (0); -> return 0; - return (1); -> return 1; - return (-1); -> return -1; Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4500)
2017-06-17Remove a pointless "#if 0" block from BN_mul.Bernd Edlinger
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3683)
2017-05-11Fix gcc-7 warnings.Bernd Edlinger
- Mostly missing fall thru comments - And uninitialized value used in sslapitest.c Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3440)
2017-02-28Remove some commented out code in libcryptoMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2774)
2017-02-28Remove dead code in bnMatt Caswell
There are a number of symbols in bn which are internal only and never used by anything. They should be removed. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2766)
2017-02-01bn: fix occurances of negative zeroGeoff Thorpe
The BIGNUM behaviour is supposed to be "consistent" when going into and out of APIs, where "consistent" means 'top' is set minimally and that 'neg' (negative) is not set if the BIGNUM is zero (which is iff 'top' is zero, due to the previous point). The BN_DEBUG testing (make test) caught the cases that this patch corrects. Note, bn_correct_top() could have been used instead, but that is intended for where 'top' is expected to (sometimes) require adjustment after direct word-array manipulation, and so is heavier-weight. Here, we are just catching the negative-zero case, so we test and correct for that explicitly, in-place. Change-Id: Iddefbd3c28a13d935648932beebcc765d5b85ae7 Signed-off-by: Geoff Thorpe <geoff@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1672)
2016-11-15Check return value of some BN functions.Rich Salz
Factorise multiple bn_get_top(group->field) calls Add missing checks on some conditional BN_copy return value Add missing checks on some BN_copy return value Add missing checks on a few bn_wexpand return value Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1626)
2016-08-24Remove useless assignmentMatt Caswell
The variable assignment c1 is never read before it is overwritten. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-05-17Copyright consolidation 06/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-07Clean-up *_DEBUG options.Andy Polyakov
Since NDEBUG is defined unconditionally on command line for release builds, we can omit *_DEBUG options in favour of effective "all-on" in debug builds exercised though CI. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-02-05GH601: Various spelling fixes.FdaSilvaYY
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
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>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte
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>
2015-05-05memset, memcpy, sizeof consistency fixesRich Salz
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Re-align some comments after running the reformat script.Matt Caswell
This should be a one off operation (subsequent invokation of the script should not move them) Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-30mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-08-18RT2163: Remove some unneeded #include'sDoug Goldstein
Several files #include stdio.h and don't need it. Also, per tjh, remove BN_COUNT Reviewed-by: Emilia Kasper <emilia@openssl.org>
2010-06-12Fix warnings.Ben Laurie
2009-12-02PR: 2111Dr. Stephen Henson
Submitted by: Martin Olsson <molsson@opera.com> Check for bn_wexpand errors in bn_mul.c
2009-06-17Update from 1.0.0-stable.Dr. Stephen Henson
2008-11-12Revert the size_t modifications from HEAD that had led to moreGeoff Thorpe
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.
2008-11-01size_tification.Ben Laurie
2007-11-03Commit #16325 fixed one thing but broke DH with certain moduli.Andy Polyakov
2007-07-08bn_mul_recursive doesn't handle all cases correctly, which results inAndy Polyakov
BN_mul failures at certain key-length mixes. PR: 1427
2004-03-13Convert openssl code not to assume the deprecated form of BN_zero().Geoff Thorpe
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).
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-05-28Make sure to compare unsigned against unsigned.Richard Levitte
2003-05-21Fix sign bugs.Richard Levitte
PR: 621
2003-01-09Finalizing asm support for UnixWare, SCO, OpenUnix... Note that I'veAndy Polyakov
replaced #if logic around bn_sub_part_words in bn_mul.c. I rely upon OPENSSL_BN_ASM_PART_WORDS being added by ./Configure script. Would it still work on non-Unix platforms?
2002-06-13Add support for DJGPP.Richard Levitte
PR: 75
2002-05-30Check the return values where memory allocation failures may happen.Richard Levitte
PR: 49
2002-05-10Fallback to normal multiply if n2 == 8 and dna or dnb is not zeroDr. Stephen Henson
in bn_mul_recursive. This is (hopefully) what was triggering bignum errors on 64 bit platforms and causing the BN_mod_mul test to fail.
2001-10-14openbsd-x86 macrosUlf Möller
Submitted by: Toomas Kiisk <vix@cyber.ee>
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-15The C version of bn_sub_part_words is needed not onlyBodo Möller
in NO_ASM configurations
2000-12-13Problem: bn_mul_normal() misbehaves if the size of b is 0.Richard Levitte
Solution: multiply a with 0, putting the result in r, and return.
2000-12-13In bn_mul_recursive(), make sure the comba routines are only calledRichard Levitte
when both a and b are of the exact right size. This may change to something better later.
2000-12-13Rewrite the extension code to use an ASN1_ITEM structureDr. Stephen Henson
for its ASN1 operations as well as the old style function pointers (i2d, d2i, new, free). Change standard extensions to support this. Fix a warning in BN_mul(), bn_mul.c about uninitialised 'j'.
2000-12-06Intel assembler version for bn_sub_part_words(). I haven't gotUlf Möller
reliable timings yet, please try it out!
2000-12-05Use assert as in the rest of the BN library.Ulf Möller
2000-12-04Remove the last bn_wexpand()s that made us break constness. OfRichard Levitte
course, that means we need to handle the cases where the two arrays to bn_mul_recursive() and bn_mul_part_recursive() differ in size. I haven't yet changed the comments that describe bn_mul_recursive() and bn_mul_part_recursive(). I want this to be tested by more people before I consider this change final. Please test away!
2000-12-02Fix bn_cmp_part_words() and move it to bn_lib.c.Ulf Möller
2000-11-30Fix BN_rshift, which caused lots of trouble.Bodo Möller
2000-11-29Copy and paste error... bn_add_part_words() should of course callRichard Levitte
bn_add_words(), not bn_sub_words()...