Commit Graph

198 Commits

Author SHA1 Message Date
nelsonb%netscape.com
fa26c513b0 When building on NT for X86, use new mpi_x86.asm implementation. 2000-09-02 05:41:21 +00:00
nelsonb%netscape.com
54ce559f68 Makefile.win - gmake Makefile for building MPI with MSVC on NT. 2000-09-02 05:38:51 +00:00
nelsonb%netscape.com
dab570427d mpi_x86.asm - assembly language implementation of s_mpv_ functions. 2000-09-02 05:33:15 +00:00
nelsonb%netscape.com
0bbb06a9ca Use new assembler files.
Define MP_NO_MP_WORD on platforms that don't have 64-bit registers.
2000-09-02 01:40:41 +00:00
nelsonb%netscape.com
5fe44c9349 Checkin a big speedup for sparc v8 CPUs when compiled with Workshop
compilers.  Be sure to use -DMP_NO_MP_WORD with v8 CPUs.
2000-08-31 04:59:05 +00:00
nelsonb%netscape.com
eb2a2982e3 Fix mpi.h so that it compiles when MP_NO_MP_WORD is defined on the command
line (or prior to including mpi.h).
2000-08-31 03:59:48 +00:00
nelsonb%netscape.com
1b6110f143 Add missing copyright notice. Doh! 2000-08-31 03:45:39 +00:00
nelsonb%netscape.com
9b2c335e20 Some cleanup. Check error codes for all functions that return them. 2000-08-31 02:52:23 +00:00
nelsonb%netscape.com
8b0c1dcf1e Big changes for performance. mp_digits are now always unsigned ints.
mp_words are used only on machines that support long long arithmetic.
s_mp_mod_d() was deleted.  It was not being used and was not part of the
public API. The code that computes squares in s_mp_sqr was broken out
into a separate new function s_mpv_sqr_add_prop(), which is a target for
assembly language optimization.  New function s_mpv_div_2dx1d(), also a
target for assembly optimization.  These changes made X86 benchmark time
go from 22.5 seconds to 8.3 seconds on my reference test system.
2000-08-31 02:51:23 +00:00
nelsonb%netscape.com
52652e08a5 Add support for Linux on X86 CPUs. Use assembler code on MIPS CPUs. 2000-08-31 02:43:56 +00:00
nelsonb%netscape.com
5e06b71329 Gnu assembler implementations of all s_mpv_ functions for Intel X86 CPUs. 2000-08-31 02:41:20 +00:00
nelsonb%netscape.com
118024af9e Add implementation of s_mpv_sqr_add_prop. 2000-08-31 02:40:32 +00:00
nelsonb%netscape.com
41b3d16d17 Change mpi-test to check the return values from most functions-under-test
explicitly for errors.
2000-08-29 04:26:23 +00:00
nelsonb%netscape.com
bb088780f3 Initial Checkin. 2000-08-26 23:50:58 +00:00
mcgreer%netscape.com
609c9bf7d4 don't zero input to random update (RNG_SystemInfoForRNG uses environment as input). Fix for bug 49898. 2000-08-23 18:11:47 +00:00
nelsonb%netscape.com
3431bd1245 Fix two uninitialized variables, found while porting to Linux. 2000-08-23 01:20:15 +00:00
nelsonb%netscape.com
7c623513e6 des.c wants _X86_ defined for intel CPUs.
coreconf does this for windows, but not for Linux, FreeBSD, etc.
2000-08-23 00:06:08 +00:00
nelsonb%netscape.com
f28d74b9ab Big changes for performance.
- In mpi-priv.h, declare new 3 argument versions of s_mp_add and s_mp_sub.
Also declare new set of s_mpv_ functions that operate on vectors (arrays)
of mp_digits instead of on mp_ints.  These functions are candidates for
implementation in assembler.
- In mpi.c reimplement mp_add and mp_sub using the new 3arg functions.
Implement 3 argument versions of s_mp_add and s_mp_sub.
This eliminates all need for temporary variables in mp_add and mp_sub.
Implement c language reference implementations of new s_mpv vector multiply
and multiply and add functions.  Change mp_mul and mp_sqr so they no longer
pre-zero the output variable.  It's no longer nececssary with the new s_mpv
functions.  s_mp_pad no longer zeros out the new padded space.
-In mpmontg.c, implement variable width exponetiation windows.  Implement
a new function to compute the multiply and Montgomery reduction in a
single pass.  This is "Improvement 2" from Dusse' and Kaliski's paper
"A Cryptographic Library for the Motorola DSP56000".  Performance impact
is negligible in this c implementation.  However, this function is another
target for assembly language optimization.
2000-08-22 01:57:34 +00:00
nelsonb%netscape.com
a61f1b73ab Overhaul Makefile. Change it to use gmake's "static pattern rules",
instead of having explicit individual rules for every program. Also,
build .o files for programs, and link them in a separate step. This
speeds building after changing a .c file in the library.
2000-08-22 01:45:25 +00:00
nelsonb%netscape.com
4cf2feb015 Get these tests to build with the current mpi API. 2000-08-22 01:19:26 +00:00
nelsonb%netscape.com
67da52ab59 Go back to using gmake. 2000-08-22 01:15:41 +00:00
nelsonb%netscape.com
ddb4786c4a MIPS assembler code to optimize inner multiply loops for mips3 CPUs. 2000-08-22 00:55:10 +00:00
mcgreer%netscape.com
5585f66cd2 initial checkin of DSA implementation. 2000-08-18 18:32:33 +00:00
nelsonb%netscape.com
99c2fa3f33 Build des.c and desblapi.c. 2000-08-14 22:28:10 +00:00
nelsonb%netscape.com
792d99fbaa The Initial Developer of the Original Code is Nelson B. Bolyard,
nelsonb@iname.com.  Portions created by Nelson B. Bolyard are
Copyright (C) 1990, 2000  Nelson B. Bolyard, All Rights Reserved.
2000-08-14 22:27:20 +00:00
nelsonb%netscape.com
9cc24caab8 "clean" target will also remove primes.c from mpi. 2000-08-14 21:04:46 +00:00
nelsonb%netscape.com
c8c44aff3b Add commented-out lines to build on other platforms.
Clean target now removes libmpi.a also.
2000-08-11 05:01:59 +00:00
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
nelsonb%netscape.com
6449cf0e9f Emulate an SSL3 client more closely after a server negotiates down to 3.0. 2000-08-08 22:54:02 +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
1818f084e5 Fix crash caused by uninitialized variable. 2000-08-08 05:56:10 +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
relyea%netscape.com
0ae2a22271 Remove old communicator stuff from libjar so modutil will build now. 2000-08-02 18:41:31 +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