nelsonb%netscape.com
8f6b77ce4d
Change mp_add and mp_sub to not allocate a temporary variable unless it's
...
really necessary.
2000-08-11 01:58:20 +00:00
nelsonb%netscape.com
d2a30db497
Replace s_mp_ispow2d with faster version. Change s_mp_mul_d to detect
...
multiplication by 0, 1, and powers of 2, and handle them without actual
multiplication.
2000-08-10 21:43:16 +00:00
nelsonb%netscape.com
67cf3588f2
Eliminate one more warning. Add missing f suffix to float constant.
2000-08-09 22:45:51 +00:00
nelsonb%netscape.com
5826c388d2
- Change mp_mul to minimize number of outer loops when multipliers are
...
of unequal length.
- Fix s_mp_fixup_reciprocal to not truncate the result.
- Use new macros in mpi-priv.h
2000-08-09 20:55:39 +00:00
nelsonb%netscape.com
203d540004
Use new MP_HOWMANY macro instead of equivalent code.
2000-08-09 20:53:25 +00:00
nelsonb%netscape.com
3f16031cb2
Comment out call to unimplemented function, so this will compile.
2000-08-09 20:46:59 +00:00
nelsonb%netscape.com
60e7af5b8b
Some unix platform kshells don't understand export VAR=value
...
So instead use VAR=value; export VAR
2000-08-09 20:44:05 +00:00
nelsonb%netscape.com
6e65d05e51
Add new macros: MP_MIN, MP_MAX, MP_HOWMANY, MP_ROUNDUP.
2000-08-09 20:42:18 +00:00
mcgreer%netscape.com
a4c0bd7e17
zero the correct amount of input bytes
2000-08-08 20:30:56 +00:00
nelsonb%netscape.com
1a81db9b8a
Fix crash caused by zeroing a larger buffer than the caller passed in.
2000-08-08 05:56:56 +00:00
nelsonb%netscape.com
53ac6c5c98
- Change mpi private function s_mp_mul_d_add_offset into a macro.
...
- Declare and implement new function s_mp_mul_add, which is a candidate
for replacement with assembler code.
- Convert mp_mul, mp_sqr, etc. to use s_mp_mul_add.
- New implementation of mp_invmod for odd moduli. Algorithm from paper
"Fast Modular Reciprocals" by Richard Schroeppel (a.k.a. Captain Nemo).
- New function s_mp_invmod_32b in mpi.c, computes inverse mod 2**32, also
from same paper. Used in mp_invmod and mp_exptmod.
2000-08-08 03:20:35 +00:00
nelsonb%netscape.com
0bade04ba3
Platform independent performance enhancements to functions that multiply,
...
square, subtract, right shift, compare, mul_d_add_offset. This lib's
Modular Exponentiation performance now compares favorably with most (not
all) other open source bignum libs on IRIX/R5000. No assembler code is
presently being used. Comparison on other platforms will now commence.
2000-08-05 03:37:46 +00:00
nelsonb%netscape.com
e30a05c7bf
Minor performance tweaks.
2000-08-04 19:58:20 +00:00
nelsonb%netscape.com
f5478e8ae0
Add new signed mp_word type, mp_sword. Used to get arithmetic right
...
shifts when doing subtraction.
2000-08-04 19:57:24 +00:00
nelsonb%netscape.com
a8b9681335
mpl_rsh now calls s_mp_div_2d instead of duplicating its logic.
...
mpl_lsh now calls s_mp_mul_2d instead of duplicating its logic.
2000-08-02 20:52:17 +00:00
nelsonb%netscape.com
26a0e342f4
- Implement s_mp_mul_2d, which complements s_mp_div_2d.
...
- Rewrite and speed up mp_sqr, most-frequently used in mp_exptmod().
- Speed up mp_sqrt by starting with a much better initial estimate.
2000-08-02 20:50:57 +00:00
nelsonb%netscape.com
da54a36647
Accept input args in hex, not decimal. Line up output into columns.
2000-08-02 20:48:28 +00:00
nelsonb%netscape.com
9620ef0ca4
Declare s_mp_mul_2d(), which is complementary to s_mp_div_2d().
2000-08-02 20:47:05 +00:00
nelsonb%netscape.com
886543402f
Reduced the number of temporary variables allocated and freed during a
...
modular exponentiation by over 99%. Modified mp_mul and mp_sqr to only
allocate temporary variables when absolutely needed. Changed mp_copy
and mp_init_copy to allocate space according to the amount allocated
in the source, reducing the need to grow the variable later.
2000-08-02 01:03:14 +00:00
nelsonb%netscape.com
147b7451ec
Investigating allocation of temporary variables.
2000-08-02 01:01:01 +00:00
nelsonb%netscape.com
e24f34f2c8
Declare mp_int function arguments "const" as appropriate.
2000-08-01 01:38:30 +00:00
nelsonb%netscape.com
9caea97bd1
Change default value for MP_ARGCHK to depend on whether or not DEBUG is
...
defined. Raise the default "precision" to reduce reallocations.
2000-08-01 01:36:30 +00:00
nelsonb%netscape.com
cb72925c4a
Fix initalizers in logtab.h to be "float" values, not "double" values.
2000-07-31 20:36:41 +00:00
nelsonb%netscape.com
1ebd55b401
Fix build problem caused by the fact that including stdlib.h implicitly
...
includes stdio.h on some platforms, but not on others.
2000-07-31 20:08:46 +00:00
nelsonb%netscape.com
4e92230a97
Use Windowed computation of exponent in mp_exptmod().
2000-07-30 06:37:14 +00:00
nelsonb%netscape.com
71be9cf03c
Add function mpl_get_bits(). Returns value of contiguous subset of bits
...
of bignum. Useful for windowed modular exponentiation.
2000-07-30 06:35:38 +00:00
nelsonb%netscape.com
78256a8fa7
MPI Arbitrary Precision Integer Arithmetic library.
...
The Initial Developer of the Original Code is
Michael J. Fromberger <sting@linguist.dartmouth.edu>
2000-07-30 02:05:19 +00:00
nelsonb%netscape.com
97ef19c3b8
MPI Arbitrary Precision Integer Arithmetic library.
...
The Initial Developer of the Original Code is
Michael J. Fromberger <sting@linguist.dartmouth.edu>
2000-07-30 01:56:35 +00:00
nelsonb%netscape.com
792ad45230
Build mpi library files in freebl.
2000-07-29 19:07:22 +00:00
nelsonb%netscape.com
df9c21a9de
Separate DH implementation for use with BSAFE and mpi-based implementation
...
into two files.
2000-07-29 19:06:54 +00:00
nelsonb%netscape.com
534ec52daa
Build libmpi.a. Include mpmontg.o in libmpi.a. Build programs with
...
libmpi.a. Fix dependencies so lib is rebuilt when headers change.
2000-07-28 23:11:12 +00:00
nelsonb%netscape.com
6b24794435
Modular exponentiation with Montgomery reduction for MPI.
...
The Initial Developer of the Original Code is
Netscape Communications Corporation. Portions created by Netscape are
Copyright (C) 2000 Netscape Communications Corporation.
All Rights Reserved.
2000-07-28 23:09:02 +00:00
nelsonb%netscape.com
71fb2fa5e4
Disambiguoate error messages in mod-expt test.
2000-07-28 23:04:23 +00:00
nelsonb%netscape.com
385fd4fc86
- Renamed mp_exptmod to s_mp_exptmod. This function is now used only in
...
when the modulus is even. mp_exptmod is now in mpmontg.c.
- Declare and define new function s_mp_mul_d_add_offset(), which computes
the product of an mp_digit and an mp_int, shifts the product to the left
by a number of digits, and adds the shifted product to another mp_int.
Used in multiplication and Montgomery reduction. Numerous platform
vendors have assembly language versions of this function.
- Removed some ANDs with DIGIT_MAX. Casting to mp_digit is necessary
and sufficient. The AND doesn't help.
2000-07-28 23:03:12 +00:00
nelsonb%netscape.com
f554a212b4
Use unsigned int for mp_digit instead of unsigned long when both are
...
32-bits. This reduced warnings. Use mp_size instead of unsigned int
in function declarations. Fix MP_DIGIT_FMT for 32-bit digits.
2000-07-28 22:55:56 +00:00
nelsonb%netscape.com
a38b5ec52f
Use mp_size instead of unsigned int in function prototypes.
2000-07-28 22:49:42 +00:00
nelsonb%netscape.com
99f3a8bf86
Add new function s_mp_add_offset().
...
Very handy in Montgomery reduction using Dusse' and Kalski's method.
2000-07-27 03:02:42 +00:00
nelsonb%netscape.com
b05581f7ec
Moved the declarations of many private defines and functions out of mpi.c
...
and into mpi-priv.h. Previously, mplogic.c and mpprime.c had duplicate
copies of some of those declarations. Now, they include mpi-priv.h
2000-07-27 02:38:54 +00:00
nelsonb%netscape.com
bf4e60e7b3
Fix sprintf format, can't use DIGIT_FMT.
2000-07-27 00:23:17 +00:00
nelsonb%netscape.com
ba8b232867
Move enhanced prime finder function mpp_make_prime from primegen utility
...
program into mpprime.c. declared in mpprime.h.
2000-07-26 05:41:59 +00:00
nelsonb%netscape.com
8bf87ce6bb
Fix bug in mp_div_2d that set r = q % d when a and q are the same mp_int.
...
Minor performance enhancement to s_mp_div_2d when DIGIT_BIT divides d.
2000-07-26 05:39:53 +00:00
nelsonb%netscape.com
7bb8634a3c
Fix a bug in recently added function mp_set_bit().
2000-07-26 05:32:30 +00:00
nelsonb%netscape.com
b9d1a404d2
Update nTires via a pointer argument to mpp_make_prime().
...
Change some printfs.
2000-07-25 00:16:57 +00:00
nelsonb%netscape.com
aef9190b64
Add new function mpp_fermat_list, which performs the fermat test on a
...
list of "witness" numbers. Simplify and accelerate mpp_pprime().
2000-07-25 00:15:06 +00:00
nelsonb%netscape.com
cbc85c762b
Fix assertion. Comparison sense was inverted.
2000-07-25 00:12:57 +00:00
nelsonb%netscape.com
f16cc60f1a
Add -fullwarn to some build flags. Change dependencies for primegen.
2000-07-22 07:22:37 +00:00
nelsonb%netscape.com
175cab0f15
Implement sieving to accelerate elimination of composites.
...
This sieve eliminates all but about 3500 numbers from each range of 64k.
2000-07-22 05:54:21 +00:00
nelsonb%netscape.com
1f040d3f9f
Use large prime table for faster prime gen. Make prime table "const".
...
Change functions that use prime table to use const arguments.
2000-07-22 05:36:45 +00:00
nelsonb%netscape.com
41121574a7
Change s_mp_norm to always use a power of two as the normalizing factor.
...
This enhancement performance by turning the normalizing and denormalizing
operations into shifts.
2000-07-21 21:06:08 +00:00
nelsonb%netscape.com
4b4e6bccd9
Implement mpl_get_bit, mpl_set_bit, mpl_significant_bits.
2000-07-21 21:04:14 +00:00