summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_div.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-22Additional comment changes for reformat of 0.9.8Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments (cherry picked from commit 1d97c8435171a7af575f73c526d79e1ef0ee5960) Conflicts: crypto/bn/bn_lcl.h crypto/bn/bn_prime.c crypto/engine/eng_all.c crypto/rc4/rc4_utl.c crypto/sha/sha.h ssl/kssl.c ssl/t1_lib.c Conflicts: crypto/rc4/rc4_enc.c crypto/x509v3/v3_scts.c crypto/x509v3/v3nametest.c ssl/d1_both.c ssl/s3_srvr.c ssl/ssl.h ssl/ssl_locl.h ssl/ssltest.c ssl/t1_lib.c Conflicts: crypto/asn1/a_sign.c crypto/bn/bn_div.c crypto/dsa/dsa_asn1.c crypto/ec/ecp_nistp224.c crypto/ec/ecp_nistp256.c crypto/ec/ecp_nistp521.c crypto/ec/ecp_nistputil.c crypto/modes/gcm128.c crypto/opensslv.h ssl/d1_both.c ssl/heartbeat_test.c ssl/s3_clnt.c ssl/s3_srvr.c ssl/ssl_sess.c ssl/t1_lib.c test/testutil.h Conflicts: apps/openssl.c apps/ts.c apps/vms_decc_init.c crypto/aes/aes_core.c crypto/aes/aes_x86core.c crypto/dsa/dsa_ameth.c crypto/ec/ec2_mult.c crypto/evp/evp.h crypto/objects/objects.h crypto/rsa/rsa_pss.c crypto/stack/safestack.h crypto/ts/ts.h crypto/ts/ts_rsp_verify.c crypto/whrlpool/wp_dgst.c crypto/x509v3/v3_ncons.c e_os2.h engines/ccgost/gost89.c engines/ccgost/gost_ctl.c engines/ccgost/gost_keywrap.c engines/ccgost/gost_keywrap.h engines/ccgost/gost_sign.c ssl/kssl.c ssl/s3_srvr.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2010-02-28Fix warnings.Ben Laurie
2010-02-23Always check bn_wexpend() return values for failure (CVE-2009-3245).Bodo Möller
(The CHANGES entry covers the change from PR #2111 as well, submitted by Martin Olsson.) Submitted by: Neel Mehta
2009-06-17Update from HEAD.Dr. Stephen Henson
2008-09-14Some precautions to avoid potential security-relevant problems.Bodo Möller
2007-06-11Privatize BN_*_no_branch [from HEAD].Andy Polyakov
2007-04-19fix error codesBodo Möller
2007-04-19don't violate the bn_check_top assertion in BN_mod_inverse_no_branch()Bodo Möller
2007-03-28make BN_FLG_CONSTTIME semantics more fool-proofBodo Möller
2007-03-28Change to mitigate branch prediction attacksBodo Möller
Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
2005-08-28fix warnings when building openssl with (gcc 3.3.1):Nils Larsch
-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
2004-03-13Document a change I'd already made, and at the same time, correct theGeoff Thorpe
change to work properly; BN_zero() should set 'neg' to zero as well as 'top' to match the behaviour of BN_new().
2004-03-09Minimise the amount of code dependent on BN_DEBUG_RAND. In particular,Geoff Thorpe
redefine bn_clear_top2max() to be a NOP in the non-debugging case, and remove some unnecessary usages in bn_nist.c. Submitted by: Nils Larsch Reviewed by: Geoff Thorpe, Ulf Möller
2003-11-22BN_div() cleanup: replace the use of BN_sub and BN_add with bn_sub_wordsGeoff Thorpe
and bn_add_words to avoid using fake bignums to window other bignums that can lead to corruption. This change allows all bignum tests to pass with BN_DEBUG and BN_DEBUG_RAND debugging and valgrind. NB: This should be tested on a few different architectures and configuration targets, as the bignum code this deals with is quite preprocessor (and assembly) sensitive. Submitted by: Nils Narsch Reviewed by: Geoff Thorpe, Ulf Moeller
2003-11-06Put more debug screening in BN_div() and correct a comment.Geoff Thorpe
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-10-31bn_div() does some pretty nasty things with temporary variables,Geoff Thorpe
constructing BIGNUM structures with pointers offset into other bignums (among other things). This corrects some of it that is too plainly insane, and tries to ensure that bignums are normalised when passed to other functions.
2003-10-30This fixes a couple of cases where an inconsistent BIGNUM could be passed asGeoff Thorpe
input to a function.
2002-12-20A little debugging.Richard Levitte
2002-12-14x86_64 performance patch.Andy Polyakov
2002-05-30Check the return values where memory allocation failures may happen.Richard Levitte
PR: 49
2001-10-14openbsd-x86 macrosUlf Möller
Submitted by: Toomas Kiisk <vix@cyber.ee>
2001-03-27The IRIX fix. Asm recap and corresponding declation.Andy Polyakov
Submitted by: Reviewed by: PR:
2001-02-28Fix a bug which caused BN_div to produce theDr. Stephen Henson
wrong result if rm==num and num < 0.
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.
2001-01-23There is no C version of bn_div_3_wordsUlf Möller
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-11-26modular arithmeticsBodo Möller
"make update"
2000-11-08BN_CTX-related fixes.Bodo Möller
2000-08-04Changes needed for Tandem NSK, supplied by Scott Uroff (scott@xypro.com).Dr. Stephen Henson
Fix warnings with BIO_dump_indent().
2000-02-15New NO_INLINE_ASM macro. Primary target for the moment is Solaris x86Andy Polyakov
which can't stand GNU C assembler templates.
2000-02-06BN_div bugfix. The q-- loop should not be entered in the n0==d0 case.Ulf Möller
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-02Support for "multiply high" instruction, see BN_UMULT_HIGH comment inAndy Polyakov
crypto/bn/bn_lcl.h for further details. It should be noted that for the moment of this writing the code was tested only on Alpha. If compiled with DEC C the C implementation exhibits 12% performance improvement over the crypto/bn/asm/alpha.s (on EV56 box running AlphaLinux). GNU C is (unfortunately) 8% behind the assembler implementation. But it's OpenVMS Alpha users who *may* benefit most as 'apps/openssl speed rsa' exhibits 6 (six) times performance improvement over the original VMS bignum implementation. Where "*may*" means "as soon as code is enabled though #define SIXTY_FOUR_BIT and crypto/bn/asm/vms.mar is skipped."
2000-02-01match the prototypeUlf Möller
2000-02-01If n0 == d0, we must alway compute 'rem' "by hand"Bodo Möller
2000-02-01Typo in preprocessor symbol.Bodo Möller
1999-12-14Solaris x86 assembler problem is already addressed in ./configUlf Möller
(bug reports keep coming in because that was still missing in 0.9.4)
1999-12-08Don't use inline assembler on x86 Solaris (would need a different syntax).Ulf Möller
1999-09-29VC++ warning.Ulf Möller
1999-08-24Minor MIPS III/IV tune-up.Andy Polyakov
1999-08-03Make it compile under -pedantic.Ben Laurie
1999-07-31Extra i386+gcc bn_div.c tune-up featuring inline division and savingAndy Polyakov
the remainder left in %edx. Here is the resulting performance improvement matrix (improvement as a result of this *and* previous tune-up committed two days ago). The results were obtained by profiling the "div" part of the crypto/bn/bnspeed.c. CPU BN_div bn_div_words overall comment ------------------------------------------------------------------------ PII +16% accumulated by +2-3% PII multiplies damn fast! Taking inlining multiplication out of the loop didn't make too much difference. Eliminating of the multiplication involved in remainder calculation is the major factor. Pentium +45% accumulated by +7-9% mull isn't that fast and replacing inlining multiplications with additions in the loop has more visible effect:-) MIPS +75% +12% +20-25% In addition to the taking mults R10000 out of the loop (giving 12% in the asm/mips3.s) three mults were eliminated in BN_div. Alpha +30% +50% +10-15% Same as above. But remember that EV4 bn_div_words is a C implementation. It takes 4 Alpha mults in C to do the same thing as 1 MIPS mult in assembler does. So the effect (50%) is more impressive. But not the overall one... Well, if Alpha bn_mul_add would be implemented in assembler overall improvement would be closer to MIPS...
1999-07-30Bignum division tune-up. Idea is to move multiplications in front ofAndy Polyakov
loop body and replace 'em with addition/subtraction.
1999-06-09Circumvent bug in SC5 without patch #107357-01.Ulf Möller
Submitted by: Andy Polyakov <appro@fy.chalmers.se>
1999-06-04Some constification and stacks that slipped through the cracks (how?).Ben Laurie
1999-04-19Change functions to ANSI C.Ulf Möller
1998-12-21Import of old SSLeay release: SSLeay 0.9.1b (unreleased)SSLeayRalf S. Engelschall