Change History 1.8 06-Sep-2000 New distribution organization, with recursive make scripts; utilities more properly organized, all the tools now build off libmpi.a in the main directory. 1.8.1 24-Sep-2000 Tweaked mp_add() and mp_sub() so that they will only allocate temporaries when they really need to. Also played around in s_mp_mul() and s_mp_sqr() to get rid of several indirections that slow down the code even with a good optimizer. This seems to have improved the performance of multiplies by as much as 20% in ad-hoc testing. 1.8.1p1 17-Jan-2001 Fixed a bug in mp_div_d() where it would try to fix the sign of zero on the output parameter, rather than on the computed quotient (this caused failure in the case where the output quotient was NULL, allowed by the API to ignore the quotient). Thanks are due to scroussette@yahoo.com for spotting this. 1.8.1p2 23-Jan-2001 Various tweaks to improve performance. This results in significant speedups in some operations. Fixed a small, rare memory leak in mp_exptmod(). Tweaked the configurations so you can select how many primes you get when you build mpprime.c. Timing results updated to reflect the performance improvement. 1.8.1p3 31-Jan-2001 Fixed a sign-related bug in mp_sub(). This would cause the sign of the output to be incorrect in the case where mp_sub(a, b, c) was computed, a < 0, b > 0, and neither a nor b is the same mp_int as c. Thanks to Tushar Udeshi for finding this bug! 1.8.1p4 17-Feb-2001 Fixed a sign-related bug in mp_mul(). This would cause the sign of the output to be incorrect in the case where the output variable was equal to the first input, e.g. mp_mul(a, b, a), and a < 0. The trouble was in not computing the output sign before calling the internal unsigned multiply function, which uses a temporary for output and replaces a. 1.8.1p5 24-Feb-2001 Fixed a precision-related bug in s_mp_mul_d(), the internal function implementing mp_mul_d(). In some cases, when precision extends to an additional digit beyond the existing precision, the code neglected to register the increase in the mp_int structure, so that the digit was lost during clamping. 1.8.2 27-Feb-2001 Added mp_tomag() and mp_mag_size() functions, to deal with output of unsigned magnitude. The mp_toraw() function is rewritten to use it. This should make it easier to implement things like PKCS#1 padding, where only the magnitude is desired, and no sign indication. 1.8.2p1 01-Aug-2001 Changed 'char' to 'unsigned char' where appropriate, to fix the buglet with output on systems that have signed characters by default. You could also circumvent this by telling your compiler to use unsigned characters, but this takes care of that issue. Of course, this causes lots of warnings when compiling mpi-test, but they are spurious warnings, and can be ignored. Also fixes a bug with mp_tomag() and mp_mag_size() which would not handle zero (0) correctly. 1.8.3 25-Aug-2001 Changed the names of the mp_toraw() and mp_tomag() functions to mp_to_signed_bin() and mp_to_unsigned_bin(). This means more typing, but the names are clearer in meaning (I had some folks writing in confused). Also, mp_raw_size() is now mp_signed_bin_size(), and, as you'd expect, mp_mag_size() is mp_unsigned_bin_size(). The old names are defined as macros, if you enable the MP_COMPAT_MACROS flag in mpi-config.h. It is off by default, though. This release also adds two new functions, mp_init_array() and mp_clear_array(). 1.8.4 14-Sep-2001 Added mp_mul_2d() and mp_count_bits(). Changed the way mp_radix_size() computes the size of the buffer, so that it is now exactly the size required. 1.8.4p1 28-Dec-2001 Fixed a subtle but important bug in mp_mul() that would give incorrect results when the target variable was the same as the multiplier. Thanks to Tom St. Denis for spotting this one. 1.8.4p2 03-Jan-2002 Fixed a subtle bug in s_mp_div() whereby the "guessed" digit of the quotient could be GREATER than the radix, not just equal to it, and in that case, you got the wrong answer. Thanks to Tom St. Denis for identifying this bug, and to Bryan Olson for spotting where I had gone wrong. 1.8.5 24-Dec-2002 Fixed sign-related bugs in several routines whereby a zero value would sometimes be incorrectly left with a negative sign flag. Fixed mp_gcd() which was giving the incorrect sign on output to gcd(0, x) with x < 0. Thanks to Tom St. Denis for bringing these bugs to my attention. 1.8.6 20-Oct-2003 Fixed a bug in s_mp_outlen() which would generate the wrong number of digits for some cases. Thanks to Miguel Oyarzun for catching this one. Fixed a bug in mp_lsh(), in mplogic.c, where small shifts would not be done properly. Thanks to Kenichiro Katayama for finding this one.