openssl/crypto/bn
Richard Levitte 6ab285bf4c I think I got it now. Apparently, the case of having to shift down
the divisor was a bit more complex than I first saw.  The lost bit
can't just be discarded, as there are cases where it is important.
For example, look at dividing 320000 with 80000 vs. 80001 (all
decimals), the difference is crucial.  The trick here is to check if
that lost bit was 1, and in that case, do the following:

1. subtract the quotient from the remainder
2. as long as the remainder is negative, add the divisor (the whole
   divisor, not the shofted down copy) to it, and decrease the
   quotient by one.

There's probably a nice mathematical proof for this already, but I
won't bother with that, unless someone requests it from me.
2002-12-02 21:31:45 +00:00
..
asm I think I got it now. Apparently, the case of having to shift down 2002-12-02 21:31:45 +00:00
.cvsignore Ignore Makefile.save 1999-04-29 16:04:54 +00:00
bn.h implement and use new macros BN_get_sign(), BN_set_sign() 2002-11-04 13:17:22 +00:00
bn.mul Import of old SSLeay release: SSLeay 0.9.1b (unreleased) 1998-12-21 11:00:56 +00:00
bn_add.c Fix some things that look like bugs. 2000-12-07 22:06:09 +00:00
bn_asm.c Make the definition of bn_add_words() match the definition. 2000-11-18 20:49:02 +00:00
bn_blind.c There have been a number of complaints from a number of sources that names 2000-06-01 22:19:21 +00:00
bn_ctx.c Hide BN_CTX structure details. 2001-03-08 15:56:15 +00:00
bn_div.c Check the return values where memory allocation failures may happen. 2002-05-30 16:47:45 +00:00
bn_err.c Binary field arithmetic contributed by Sun Microsystems. 2002-08-02 13:03:55 +00:00
bn_exp.c Fix some things that look like bugs. 2000-12-07 22:06:09 +00:00
bn_exp2.c Fix the recently introduced test that checks if the result is 0 2000-11-30 22:58:27 +00:00
bn_gcd.c Adjust BN_mod_inverse algorithm selection according to experiments on 2001-04-09 09:28:24 +00:00
bn_gf2m.c Unused variable removed. 2002-11-27 13:40:41 +00:00
bn_kron.c BN_sqrt 2000-11-30 00:18:19 +00:00
bn_lcl.h avoid warnings ('index' shadows global declaration) 2002-10-29 11:50:20 +00:00
bn_lib.c A few more memset()s converted to OPENSSL_cleanse(). 2002-11-29 11:30:45 +00:00
bn_mod.c binary algorithm for modular inversion 2001-04-08 18:23:44 +00:00
bn_mont.c Check the return values where memory allocation failures may happen. 2002-05-30 16:47:45 +00:00
bn_mpi.c More constification of the BN library. 2000-11-16 22:43:32 +00:00
bn_mul.c Add support for DJGPP. 2002-06-13 20:42:35 +00:00
bn_nist.c clean up new code for NIST primes 2002-10-28 14:02:19 +00:00
bn_prime.c OpenSSL copyright notices ... 2001-09-04 11:02:23 +00:00
bn_prime.h Move primes to read-only segment. 2000-02-16 13:24:06 +00:00
bn_prime.pl Move primes to read-only segment. 2000-02-16 13:24:06 +00:00
bn_print.c Make all configuration macros available for application by making 2001-02-19 16:06:34 +00:00
bn_rand.c A few more memset()s converted to OPENSSL_cleanse(). 2002-11-29 11:30:45 +00:00
bn_recp.c The BN_mul bug test apparently is no longer needed 2000-12-14 17:46:36 +00:00
bn_shift.c Fix BN_rshift, which caused lots of trouble. 2000-11-30 22:34:57 +00:00
bn_sqr.c bug fix: bn_sqr_recursive output is twice its input size. 2001-09-05 04:43:43 +00:00
bn_sqrt.c remove obsolete part of comment 2002-08-02 15:13:10 +00:00
bn_word.c When BN_add_word() reaches top, it shouldn't try to add the the corresponding 2002-10-14 11:33:32 +00:00
bnspeed.c Code for better build under Darwin (MacOS X). 2001-03-07 10:04:00 +00:00
bntest.c Have all tests use EXIT() to exit rather than exit(), since the latter doesn't 2002-11-28 18:54:30 +00:00
divtest.c Fix to build better with DJGPP. 2002-11-14 11:22:01 +00:00
exp.c - Pseudo-seed the PRNG in programs used for "make test" 2000-01-14 17:55:37 +00:00
expspeed.c Code for better build under Darwin (MacOS X). 2001-03-07 10:04:00 +00:00
exptest.c Have all tests use EXIT() to exit rather than exit(), since the latter doesn't 2002-11-28 18:54:30 +00:00
Makefile.ssl synchronise util/libeay.num with the 0.9.7-stable variant (guys, this 2002-10-29 14:48:57 +00:00
todo Import of old SSLeay release: SSLeay 0.9.1b (unreleased) 1998-12-21 11:00:56 +00:00
vms-helper.c Use new-style system-id macros everywhere possible. I hope I haven't 2001-02-20 08:13:47 +00:00