summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zoneinfo
diff options
context:
space:
mode:
authorNathan M <nathanmaynes@gmail.com>2020-08-06 22:09:40 (GMT)
committerGitHub <noreply@github.com>2020-08-06 22:09:40 (GMT)
commit5f0769a7529fcbc28190864f098f192053a10747 (patch)
tree7d51ecad2b3ebb89a1b012aa30983a26b394b5b2 /Lib/test/test_zoneinfo
parent777b611c8c5676b80898a429f71d28e59bddc49d (diff)
downloadcpython-5f0769a7529fcbc28190864f098f192053a10747.zip
cpython-5f0769a7529fcbc28190864f098f192053a10747.tar.gz
cpython-5f0769a7529fcbc28190864f098f192053a10747.tar.bz2
bpo-41371: Handle lzma lib import error in test_zoneinfo.py (GH-21734)
Diffstat (limited to 'Lib/test/test_zoneinfo')
-rw-r--r--Lib/test/test_zoneinfo/test_zoneinfo.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py b/Lib/test/test_zoneinfo/test_zoneinfo.py
index 1f1fa60..d16e0d2 100644
--- a/Lib/test/test_zoneinfo/test_zoneinfo.py
+++ b/Lib/test/test_zoneinfo/test_zoneinfo.py
@@ -6,7 +6,6 @@ import dataclasses
import importlib.metadata
import io
import json
-import lzma
import os
import pathlib
import pickle
@@ -20,7 +19,9 @@ from functools import cached_property
from . import _support as test_support
from ._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase
+from test.support.import_helper import import_module
+lzma = import_module('lzma')
py_zoneinfo, c_zoneinfo = test_support.get_modules()
try:
.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const struct { @@ -42,6 +42,6 @@ char *mp_error_to_string(int code) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_error.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_mp_invmod.c b/libtommath/bn_fast_mp_invmod.c index 744ae4f..ff03dff 100644 --- a/libtommath/bn_fast_mp_invmod.c +++ b/libtommath/bn_fast_mp_invmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the modular inverse via binary extended euclidean algorithm, @@ -143,6 +143,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_mp_invmod.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_mp_montgomery_reduce.c b/libtommath/bn_fast_mp_montgomery_reduce.c index 45a4089..b6c0694 100644 --- a/libtommath/bn_fast_mp_montgomery_reduce.c +++ b/libtommath/bn_fast_mp_montgomery_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction @@ -167,6 +167,6 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_digs.c b/libtommath/bn_fast_s_mp_mul_digs.c index 86b78b4..91e10d6 100644 --- a/libtommath/bn_fast_s_mp_mul_digs.c +++ b/libtommath/bn_fast_s_mp_mul_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Fast (comba) multiplier @@ -102,6 +102,6 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_high_digs.c b/libtommath/bn_fast_s_mp_mul_high_digs.c index 607630a..5b114d7 100644 --- a/libtommath/bn_fast_s_mp_mul_high_digs.c +++ b/libtommath/bn_fast_s_mp_mul_high_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this is a modified version of fast_s_mul_digs that only produces @@ -93,6 +93,6 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_fast_s_mp_sqr.c b/libtommath/bn_fast_s_mp_sqr.c index 50adf00..19e92ef 100644 --- a/libtommath/bn_fast_s_mp_sqr.c +++ b/libtommath/bn_fast_s_mp_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* the jist of squaring... @@ -109,6 +109,6 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_fast_s_mp_sqr.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_2expt.c b/libtommath/bn_mp_2expt.c index a9d3e9c..f422ffc 100644 --- a/libtommath/bn_mp_2expt.c +++ b/libtommath/bn_mp_2expt.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes a = 2**b @@ -43,6 +43,6 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_2expt.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_abs.c b/libtommath/bn_mp_abs.c index 2a7f02c..09dd722 100644 --- a/libtommath/bn_mp_abs.c +++ b/libtommath/bn_mp_abs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = |a| @@ -38,6 +38,6 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_abs.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_add.c b/libtommath/bn_mp_add.c index b7effdb..be20644 100644 --- a/libtommath/bn_mp_add.c +++ b/libtommath/bn_mp_add.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level addition (handles signs) */ @@ -48,6 +48,6 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_add.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c index 598acab..8ca36c1 100644 --- a/libtommath/bn_mp_add_d.c +++ b/libtommath/bn_mp_add_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit addition */ @@ -107,6 +107,6 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_add_d.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_addmod.c b/libtommath/bn_mp_addmod.c index b0b4d8b..6d8afe1 100644 --- a/libtommath/bn_mp_addmod.c +++ b/libtommath/bn_mp_addmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a + b (mod c) */ @@ -36,6 +36,6 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_addmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_and.c b/libtommath/bn_mp_and.c index ff61017..8ea2287 100644 --- a/libtommath/bn_mp_and.c +++ b/libtommath/bn_mp_and.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* AND two ints together */ @@ -52,6 +52,6 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_and.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_clamp.c b/libtommath/bn_mp_clamp.c index 4f2f8ba..359c2ff 100644 --- a/libtommath/bn_mp_clamp.c +++ b/libtommath/bn_mp_clamp.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* trim unused digits @@ -39,6 +39,6 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_clamp.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_clear.c b/libtommath/bn_mp_clear.c index e1fe10d..a65f0a3 100644 --- a/libtommath/bn_mp_clear.c +++ b/libtommath/bn_mp_clear.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* clear one (frees) */ @@ -39,6 +39,6 @@ mp_clear (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_clear.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_clear_multi.c b/libtommath/bn_mp_clear_multi.c index e9910e8..daaea79 100644 --- a/libtommath/bn_mp_clear_multi.c +++ b/libtommath/bn_mp_clear_multi.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include @@ -29,6 +29,6 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_clear_multi.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cmp.c b/libtommath/bn_mp_cmp.c index 6361730..533f36b 100644 --- a/libtommath/bn_mp_cmp.c +++ b/libtommath/bn_mp_cmp.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare two ints (signed)*/ @@ -38,6 +38,6 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cmp.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cmp_d.c b/libtommath/bn_mp_cmp_d.c index 92c3567..724c1c3 100644 --- a/libtommath/bn_mp_cmp_d.c +++ b/libtommath/bn_mp_cmp_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare a digit */ @@ -39,6 +39,6 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cmp_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cmp_mag.c b/libtommath/bn_mp_cmp_mag.c index 31c8221..693eb7c 100644 --- a/libtommath/bn_mp_cmp_mag.c +++ b/libtommath/bn_mp_cmp_mag.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare maginitude of two ints (unsigned) */ @@ -50,6 +50,6 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cmp_mag.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_cnt_lsb.c b/libtommath/bn_mp_cnt_lsb.c index 4aa68b5..66d1a74 100644 --- a/libtommath/bn_mp_cnt_lsb.c +++ b/libtommath/bn_mp_cnt_lsb.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const int lnz[16] = { @@ -48,6 +48,6 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_cnt_lsb.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_copy.c b/libtommath/bn_mp_copy.c index a5d5e6f..b0de16d 100644 --- a/libtommath/bn_mp_copy.c +++ b/libtommath/bn_mp_copy.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* copy, b = a */ @@ -63,6 +63,6 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_copy.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_count_bits.c b/libtommath/bn_mp_count_bits.c index 44c0cff..8bc5657 100644 --- a/libtommath/bn_mp_count_bits.c +++ b/libtommath/bn_mp_count_bits.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns the number of bits in an int */ @@ -40,6 +40,6 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_count_bits.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div.c b/libtommath/bn_mp_div.c index 4a94172..aee9c94 100644 --- a/libtommath/bn_mp_div.c +++ b/libtommath/bn_mp_div.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef BN_MP_DIV_SMALL @@ -287,6 +287,6 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_2.c b/libtommath/bn_mp_div_2.c index bcb17c1..7ee3e5b 100644 --- a/libtommath/bn_mp_div_2.c +++ b/libtommath/bn_mp_div_2.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a/2 */ @@ -63,6 +63,6 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_2.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_2d.c b/libtommath/bn_mp_div_2d.c index 12a7c99..4f7fa59 100644 --- a/libtommath/bn_mp_div_2d.c +++ b/libtommath/bn_mp_div_2d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right by a certain bit count (store quotient in c, optional remainder in d) */ @@ -92,6 +92,6 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_2d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_3.c b/libtommath/bn_mp_div_3.c index 571991a..3c60269 100644 --- a/libtommath/bn_mp_div_3.c +++ b/libtommath/bn_mp_div_3.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* divide by three (based on routine from MPI and the GMP manual) */ @@ -74,6 +74,6 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_3.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c index 4f210e6..d64b4b5 100644 --- a/libtommath/bn_mp_div_d.c +++ b/libtommath/bn_mp_div_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static int s_is_power_of_two(mp_digit b, int *p) @@ -105,6 +105,6 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_div_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: $ */ diff --git a/libtommath/bn_mp_dr_is_modulus.c b/libtommath/bn_mp_dr_is_modulus.c index 9532df1..5237344 100644 --- a/libtommath/bn_mp_dr_is_modulus.c +++ b/libtommath/bn_mp_dr_is_modulus.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if a number is a valid DR modulus */ @@ -38,6 +38,6 @@ int mp_dr_is_modulus(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_dr_is_modulus.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_is_modulus.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_dr_reduce.c b/libtommath/bn_mp_dr_reduce.c index 6d63462..e60b578 100644 --- a/libtommath/bn_mp_dr_reduce.c +++ b/libtommath/bn_mp_dr_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduce "x" in place modulo "n" using the Diminished Radix algorithm. @@ -89,6 +89,6 @@ top: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_dr_reduce.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_dr_setup.c b/libtommath/bn_mp_dr_setup.c index c6f4b2f..1d7d856 100644 --- a/libtommath/bn_mp_dr_setup.c +++ b/libtommath/bn_mp_dr_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -27,6 +27,6 @@ void mp_dr_setup(mp_int *a, mp_digit *d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_dr_setup.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exch.c b/libtommath/bn_mp_exch.c index 691d9f6..38574e0 100644 --- a/libtommath/bn_mp_exch.c +++ b/libtommath/bn_mp_exch.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* swap the elements of two integers, for cases where you can't simply swap the @@ -29,6 +29,6 @@ mp_exch (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exch.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_expt_d.c b/libtommath/bn_mp_expt_d.c index dfd04eb..4bdc2d1 100644 --- a/libtommath/bn_mp_expt_d.c +++ b/libtommath/bn_mp_expt_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* calculate c = a**b using a square-multiply algorithm */ @@ -52,6 +52,6 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_expt_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_expt_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exptmod.c b/libtommath/bn_mp_exptmod.c index 714a96f..0231916 100644 --- a/libtommath/bn_mp_exptmod.c +++ b/libtommath/bn_mp_exptmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ @@ -107,6 +107,6 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exptmod.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exptmod_fast.c b/libtommath/bn_mp_exptmod_fast.c index cb8d94a..2a3b3c9 100644 --- a/libtommath/bn_mp_exptmod_fast.c +++ b/libtommath/bn_mp_exptmod_fast.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85 @@ -316,6 +316,6 @@ LBL_M: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exptmod_fast.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod_fast.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_exteuclid.c b/libtommath/bn_mp_exteuclid.c index 9730fa0..e6c4ce2 100644 --- a/libtommath/bn_mp_exteuclid.c +++ b/libtommath/bn_mp_exteuclid.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Extended euclidean algorithm of (a, b) produces @@ -77,6 +77,6 @@ _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_exteuclid.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_exteuclid.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_fread.c b/libtommath/bn_mp_fread.c index c1b0128..b344b6f 100644 --- a/libtommath/bn_mp_fread.c +++ b/libtommath/bn_mp_fread.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read a bigint from a file stream in ASCII */ @@ -62,6 +62,6 @@ int mp_fread(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_fread.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_fread.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_fwrite.c b/libtommath/bn_mp_fwrite.c index 5785c02..a0b4c6b 100644 --- a/libtommath/bn_mp_fwrite.c +++ b/libtommath/bn_mp_fwrite.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ int mp_fwrite(mp_int *a, int radix, FILE *stream) @@ -47,6 +47,6 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_fwrite.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_fwrite.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_gcd.c b/libtommath/bn_mp_gcd.c index bbc5421..b39ba90 100644 --- a/libtommath/bn_mp_gcd.c +++ b/libtommath/bn_mp_gcd.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Greatest Common Divisor using the binary method */ @@ -100,6 +100,6 @@ LBL_U:mp_clear (&v); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_gcd.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_get_int.c b/libtommath/bn_mp_get_int.c index 269be79..17162e2 100644 --- a/libtommath/bn_mp_get_int.c +++ b/libtommath/bn_mp_get_int.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the lower 32-bits of an mp_int */ @@ -40,6 +40,6 @@ unsigned long mp_get_int(mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_get_int.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_get_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_grow.c b/libtommath/bn_mp_grow.c index e77c774..cf2b949 100644 --- a/libtommath/bn_mp_grow.c +++ b/libtommath/bn_mp_grow.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* grow as required */ @@ -52,6 +52,6 @@ int mp_grow (mp_int * a, int size) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_grow.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_grow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init.c b/libtommath/bn_mp_init.c index c866e89..8be27f5 100644 --- a/libtommath/bn_mp_init.c +++ b/libtommath/bn_mp_init.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* init a new mp_int */ @@ -41,6 +41,6 @@ int mp_init (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_copy.c b/libtommath/bn_mp_init_copy.c index 2e1c207..0160811 100644 --- a/libtommath/bn_mp_init_copy.c +++ b/libtommath/bn_mp_init_copy.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* creates "a" then copies b into it */ @@ -27,6 +27,6 @@ int mp_init_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_copy.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_multi.c b/libtommath/bn_mp_init_multi.c index 70148b8..59dc3a9 100644 --- a/libtommath/bn_mp_init_multi.c +++ b/libtommath/bn_mp_init_multi.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include @@ -54,6 +54,6 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_multi.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_set.c b/libtommath/bn_mp_init_set.c index cdf1249..34edad9 100644 --- a/libtommath/bn_mp_init_set.c +++ b/libtommath/bn_mp_init_set.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -27,6 +27,6 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_set.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_set_int.c b/libtommath/bn_mp_init_set_int.c index a4e87d5..5c55993 100644 --- a/libtommath/bn_mp_init_set_int.c +++ b/libtommath/bn_mp_init_set_int.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -26,6 +26,6 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_set_int.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_init_size.c b/libtommath/bn_mp_init_size.c index 4433b16..8e01418 100644 --- a/libtommath/bn_mp_init_size.c +++ b/libtommath/bn_mp_init_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* init an mp_init for a given size */ @@ -43,6 +43,6 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_init_size.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_invmod.c b/libtommath/bn_mp_invmod.c index 09e71cd..1546514 100644 --- a/libtommath/bn_mp_invmod.c +++ b/libtommath/bn_mp_invmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -38,6 +38,6 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_invmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_invmod_slow.c b/libtommath/bn_mp_invmod_slow.c index ff9cc96..eedd47d 100644 --- a/libtommath/bn_mp_invmod_slow.c +++ b/libtommath/bn_mp_invmod_slow.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -170,6 +170,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_invmod_slow.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_is_square.c b/libtommath/bn_mp_is_square.c index 01f07b3..50c5244 100644 --- a/libtommath/bn_mp_is_square.c +++ b/libtommath/bn_mp_is_square.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Check if remainders are possible squares - fast exclude non-squares */ @@ -104,6 +104,6 @@ ERR:mp_clear(&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_is_square.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_jacobi.c b/libtommath/bn_mp_jacobi.c index cb7713d..91cfeea 100644 --- a/libtommath/bn_mp_jacobi.c +++ b/libtommath/bn_mp_jacobi.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the jacobi c = (a | n) (or Legendre if n is prime) @@ -100,6 +100,6 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_jacobi.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_karatsuba_mul.c b/libtommath/bn_mp_karatsuba_mul.c index 53187dd..8ea2c27 100644 --- a/libtommath/bn_mp_karatsuba_mul.c +++ b/libtommath/bn_mp_karatsuba_mul.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = |a| * |b| using Karatsuba Multiplication using @@ -162,6 +162,6 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_karatsuba_mul.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_karatsuba_sqr.c b/libtommath/bn_mp_karatsuba_sqr.c index 7f1f253..a5e198b 100644 --- a/libtommath/bn_mp_karatsuba_sqr.c +++ b/libtommath/bn_mp_karatsuba_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Karatsuba squaring, computes b = a*a using three @@ -116,6 +116,6 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_karatsuba_sqr.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_lcm.c b/libtommath/bn_mp_lcm.c index 72a5beb..781eef5 100644 --- a/libtommath/bn_mp_lcm.c +++ b/libtommath/bn_mp_lcm.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes least common multiple as |a*b|/(a, b) */ @@ -55,6 +55,6 @@ LBL_T: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_lcm.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_lshd.c b/libtommath/bn_mp_lshd.c index 84dfa81..f118cf1 100644 --- a/libtommath/bn_mp_lshd.c +++ b/libtommath/bn_mp_lshd.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left a certain amount of digits */ @@ -62,6 +62,6 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_lshd.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mod.c b/libtommath/bn_mp_mod.c index 16d9d76..f5cf8d0 100644 --- a/libtommath/bn_mp_mod.c +++ b/libtommath/bn_mp_mod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a mod b, 0 <= c < b */ @@ -43,6 +43,6 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mod_2d.c b/libtommath/bn_mp_mod_2d.c index 2ab7e33..e194a06 100644 --- a/libtommath/bn_mp_mod_2d.c +++ b/libtommath/bn_mp_mod_2d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* calc a value mod 2**b */ @@ -50,6 +50,6 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mod_2d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mod_d.c b/libtommath/bn_mp_mod_d.c index 91dcbe1..9ca37e6 100644 --- a/libtommath/bn_mp_mod_d.c +++ b/libtommath/bn_mp_mod_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ int @@ -22,6 +22,6 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mod_d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_montgomery_calc_normalization.c b/libtommath/bn_mp_montgomery_calc_normalization.c index 59dd8ea..c669fe0 100644 --- a/libtommath/bn_mp_montgomery_calc_normalization.c +++ b/libtommath/bn_mp_montgomery_calc_normalization.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* @@ -54,6 +54,6 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_montgomery_reduce.c b/libtommath/bn_mp_montgomery_reduce.c index f9305d8..b765090 100644 --- a/libtommath/bn_mp_montgomery_reduce.c +++ b/libtommath/bn_mp_montgomery_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction */ @@ -113,6 +113,6 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_montgomery_setup.c b/libtommath/bn_mp_montgomery_setup.c index cea6778..261a9fb 100644 --- a/libtommath/bn_mp_montgomery_setup.c +++ b/libtommath/bn_mp_montgomery_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* setups the montgomery reduction stuff */ @@ -54,6 +54,6 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_montgomery_setup.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul.c b/libtommath/bn_mp_mul.c index 6506635..8b1117a 100644 --- a/libtommath/bn_mp_mul.c +++ b/libtommath/bn_mp_mul.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level multiplication (handles sign) */ @@ -61,6 +61,6 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul_2.c b/libtommath/bn_mp_mul_2.c index 96d5710..02455fc 100644 --- a/libtommath/bn_mp_mul_2.c +++ b/libtommath/bn_mp_mul_2.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a*2 */ @@ -77,6 +77,6 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul_2.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul_2d.c b/libtommath/bn_mp_mul_2d.c index 88fa080..efeff2e 100644 --- a/libtommath/bn_mp_mul_2d.c +++ b/libtommath/bn_mp_mul_2d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left by a certain bit count */ @@ -80,6 +80,6 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul_2d.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mul_d.c b/libtommath/bn_mp_mul_d.c index e86d6ab..00f9a89 100644 --- a/libtommath/bn_mp_mul_d.c +++ b/libtommath/bn_mp_mul_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiply by a digit */ @@ -74,6 +74,6 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mul_d.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_mulmod.c b/libtommath/bn_mp_mulmod.c index d84c555..003ceb9 100644 --- a/libtommath/bn_mp_mulmod.c +++ b/libtommath/bn_mp_mulmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a * b (mod c) */ @@ -35,6 +35,6 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_mulmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_n_root.c b/libtommath/bn_mp_n_root.c index 734d5ea..0e7bedc 100644 --- a/libtommath/bn_mp_n_root.c +++ b/libtommath/bn_mp_n_root.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* find the n'th root of an integer @@ -127,6 +127,6 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_n_root.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_neg.c b/libtommath/bn_mp_neg.c index 17e851a..a7d035a 100644 --- a/libtommath/bn_mp_neg.c +++ b/libtommath/bn_mp_neg.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = -a */ @@ -35,6 +35,6 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_neg.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_or.c b/libtommath/bn_mp_or.c index 09df58c..bff4995 100644 --- a/libtommath/bn_mp_or.c +++ b/libtommath/bn_mp_or.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* OR two ints together */ @@ -45,6 +45,6 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_or.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_fermat.c b/libtommath/bn_mp_prime_fermat.c index f6edf9e..c23d77f 100644 --- a/libtommath/bn_mp_prime_fermat.c +++ b/libtommath/bn_mp_prime_fermat.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs one Fermat test. @@ -57,6 +57,6 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_fermat.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_is_divisible.c b/libtommath/bn_mp_prime_is_divisible.c index 897c11b..8e7871c 100644 --- a/libtommath/bn_mp_prime_is_divisible.c +++ b/libtommath/bn_mp_prime_is_divisible.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if an integers is divisible by one @@ -45,6 +45,6 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_is_divisible.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_is_prime.c b/libtommath/bn_mp_prime_is_prime.c index 135f1d9..c316d62 100644 --- a/libtommath/bn_mp_prime_is_prime.c +++ b/libtommath/bn_mp_prime_is_prime.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs a variable number of rounds of Miller-Rabin @@ -78,6 +78,6 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_is_prime.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_miller_rabin.c b/libtommath/bn_mp_prime_miller_rabin.c index f2d6c7f..ddf0358 100644 --- a/libtommath/bn_mp_prime_miller_rabin.c +++ b/libtommath/bn_mp_prime_miller_rabin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Miller-Rabin test of "a" to the base of "b" as described in @@ -98,6 +98,6 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_miller_rabin.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_next_prime.c b/libtommath/bn_mp_prime_next_prime.c index a875260..daf2ec7 100644 --- a/libtommath/bn_mp_prime_next_prime.c +++ b/libtommath/bn_mp_prime_next_prime.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* finds the next prime after the number "a" using "t" trials @@ -165,6 +165,6 @@ LBL_ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_next_prime.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_rabin_miller_trials.c b/libtommath/bn_mp_prime_rabin_miller_trials.c index 30825a3..248c2fd 100644 --- a/libtommath/bn_mp_prime_rabin_miller_trials.c +++ b/libtommath/bn_mp_prime_rabin_miller_trials.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ @@ -47,6 +47,6 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_prime_random_ex.c b/libtommath/bn_mp_prime_random_ex.c index baddd10..07aae4b 100644 --- a/libtommath/bn_mp_prime_random_ex.c +++ b/libtommath/bn_mp_prime_random_ex.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a truly random prime of a given size (bits), @@ -120,6 +120,6 @@ error: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_prime_random_ex.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_radix_size.c b/libtommath/bn_mp_radix_size.c index cf0a093..1b61e3a 100644 --- a/libtommath/bn_mp_radix_size.c +++ b/libtommath/bn_mp_radix_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns size of ASCII reprensentation */ @@ -73,6 +73,6 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_radix_size.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_radix_smap.c b/libtommath/bn_mp_radix_smap.c index 913acad..7d72feb 100644 --- a/libtommath/bn_mp_radix_smap.c +++ b/libtommath/bn_mp_radix_smap.c @@ -12,13 +12,13 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* chars used in radix conversions */ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_radix_smap.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_rand.c b/libtommath/bn_mp_rand.c index 6de7447..af66a67 100644 --- a/libtommath/bn_mp_rand.c +++ b/libtommath/bn_mp_rand.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a pseudo-random int of a given size */ @@ -50,6 +50,6 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_rand.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_read_radix.c b/libtommath/bn_mp_read_radix.c index 9a6dd9b..91c46c2 100644 --- a/libtommath/bn_mp_read_radix.c +++ b/libtommath/bn_mp_read_radix.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read a string [ASCII] in a given radix */ @@ -80,6 +80,6 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_read_radix.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_read_signed_bin.c b/libtommath/bn_mp_read_signed_bin.c index ae9e6a8..8da651c 100644 --- a/libtommath/bn_mp_read_signed_bin.c +++ b/libtommath/bn_mp_read_signed_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read signed bin, big endian, first byte is 0==positive or 1==negative */ @@ -36,6 +36,6 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_read_signed_bin.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_read_unsigned_bin.c b/libtommath/bn_mp_read_unsigned_bin.c index b94265f..1ebba13 100644 --- a/libtommath/bn_mp_read_unsigned_bin.c +++ b/libtommath/bn_mp_read_unsigned_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reads a unsigned char array, assumes the msb is stored first [big endian] */ @@ -50,6 +50,6 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_read_unsigned_bin.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce.c b/libtommath/bn_mp_reduce.c index e4c8842..21d0730 100644 --- a/libtommath/bn_mp_reduce.c +++ b/libtommath/bn_mp_reduce.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces x mod m, assumes 0 < x < m**2, mu is @@ -95,6 +95,6 @@ CLEANUP: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k.c b/libtommath/bn_mp_reduce_2k.c index 0bc9f36..d9620c2 100644 --- a/libtommath/bn_mp_reduce_2k.c +++ b/libtommath/bn_mp_reduce_2k.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d */ @@ -56,6 +56,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k_l.c b/libtommath/bn_mp_reduce_2k_l.c index ff50948..f06103d 100644 --- a/libtommath/bn_mp_reduce_2k_l.c +++ b/libtommath/bn_mp_reduce_2k_l.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d @@ -57,6 +57,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k_l.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup.c b/libtommath/bn_mp_reduce_2k_setup.c index 2a97cd0..a80e7a2 100644 --- a/libtommath/bn_mp_reduce_2k_setup.c +++ b/libtommath/bn_mp_reduce_2k_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -42,6 +42,6 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k_setup.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup_l.c b/libtommath/bn_mp_reduce_2k_setup_l.c index acff733..7cf002e 100644 --- a/libtommath/bn_mp_reduce_2k_setup_l.c +++ b/libtommath/bn_mp_reduce_2k_setup_l.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -39,6 +39,6 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k.c b/libtommath/bn_mp_reduce_is_2k.c index e398e19..7308be7 100644 --- a/libtommath/bn_mp_reduce_is_2k.c +++ b/libtommath/bn_mp_reduce_is_2k.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if mp_reduce_2k can be used */ @@ -47,6 +47,6 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_is_2k.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k_l.c b/libtommath/bn_mp_reduce_is_2k_l.c index 82e972d..14a4d21 100644 --- a/libtommath/bn_mp_reduce_is_2k_l.c +++ b/libtommath/bn_mp_reduce_is_2k_l.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if reduce_2k_l can be used */ @@ -39,6 +39,6 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_reduce_setup.c b/libtommath/bn_mp_reduce_setup.c index 94bd26f..370f20b 100644 --- a/libtommath/bn_mp_reduce_setup.c +++ b/libtommath/bn_mp_reduce_setup.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* pre-calculate the value required for Barrett reduction @@ -29,6 +29,6 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_reduce_setup.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_rshd.c b/libtommath/bn_mp_rshd.c index ebc8d5f..2a693c5 100644 --- a/libtommath/bn_mp_rshd.c +++ b/libtommath/bn_mp_rshd.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right a certain amount of digits */ @@ -67,6 +67,6 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_rshd.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_set.c b/libtommath/bn_mp_set.c index 9cb64c7..174adcb 100644 --- a/libtommath/bn_mp_set.c +++ b/libtommath/bn_mp_set.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to a digit */ @@ -24,6 +24,6 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_set.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_set_int.c b/libtommath/bn_mp_set_int.c index 106c4e2..cf10ea1 100644 --- a/libtommath/bn_mp_set_int.c +++ b/libtommath/bn_mp_set_int.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set a 32-bit const */ @@ -43,6 +43,6 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_set_int.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_shrink.c b/libtommath/bn_mp_shrink.c index ddd72e3..4b8c5ef 100644 --- a/libtommath/bn_mp_shrink.c +++ b/libtommath/bn_mp_shrink.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shrink a bignum */ @@ -30,6 +30,6 @@ int mp_shrink (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_shrink.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_signed_bin_size.c b/libtommath/bn_mp_signed_bin_size.c index 97fdb96..6739d19 100644 --- a/libtommath/bn_mp_signed_bin_size.c +++ b/libtommath/bn_mp_signed_bin_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an signed equivalent */ @@ -22,6 +22,6 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_signed_bin_size.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sqr.c b/libtommath/bn_mp_sqr.c index 4e75bdb..868ccbb 100644 --- a/libtommath/bn_mp_sqr.c +++ b/libtommath/bn_mp_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes b = a*a */ @@ -53,6 +53,6 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sqr.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sqrmod.c b/libtommath/bn_mp_sqrmod.c index d0f0a79..161cbbb 100644 --- a/libtommath/bn_mp_sqrmod.c +++ b/libtommath/bn_mp_sqrmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a * a (mod b) */ @@ -36,6 +36,6 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sqrmod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sqrt.c b/libtommath/bn_mp_sqrt.c index 086801d..8fd057c 100644 --- a/libtommath/bn_mp_sqrt.c +++ b/libtommath/bn_mp_sqrt.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this function is less generic than mp_n_root, simpler and faster */ @@ -76,6 +76,6 @@ E2: mp_clear(&t1); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sqrt.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sub.c b/libtommath/bn_mp_sub.c index c0e2def..f5015cc 100644 --- a/libtommath/bn_mp_sub.c +++ b/libtommath/bn_mp_sub.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level subtraction (handles signs) */ @@ -54,6 +54,6 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sub.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_sub_d.c b/libtommath/bn_mp_sub_d.c index d979f35..06cdca6 100644 --- a/libtommath/bn_mp_sub_d.c +++ b/libtommath/bn_mp_sub_d.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit subtraction */ @@ -88,6 +88,6 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_sub_d.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_submod.c b/libtommath/bn_mp_submod.c index 046e844..869e23c 100644 --- a/libtommath/bn_mp_submod.c +++ b/libtommath/bn_mp_submod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a - b (mod c) */ @@ -37,6 +37,6 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_submod.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_signed_bin.c b/libtommath/bn_mp_to_signed_bin.c index 066eb51..9df83ca 100644 --- a/libtommath/bn_mp_to_signed_bin.c +++ b/libtommath/bn_mp_to_signed_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -28,6 +28,6 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_signed_bin.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_signed_bin_n.c b/libtommath/bn_mp_to_signed_bin_n.c index b1df632..677f827 100644 --- a/libtommath/bn_mp_to_signed_bin_n.c +++ b/libtommath/bn_mp_to_signed_bin_n.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -26,6 +26,6 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_signed_bin_n.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin.c b/libtommath/bn_mp_to_unsigned_bin.c index d69de35..c137f10 100644 --- a/libtommath/bn_mp_to_unsigned_bin.c +++ b/libtommath/bn_mp_to_unsigned_bin.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -43,6 +43,6 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_unsigned_bin.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin_n.c b/libtommath/bn_mp_to_unsigned_bin_n.c index 5621960..0dc00c6 100644 --- a/libtommath/bn_mp_to_unsigned_bin_n.c +++ b/libtommath/bn_mp_to_unsigned_bin_n.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -26,6 +26,6 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toom_mul.c b/libtommath/bn_mp_toom_mul.c index 14d0705..ad5d9e9 100644 --- a/libtommath/bn_mp_toom_mul.c +++ b/libtommath/bn_mp_toom_mul.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplication using the Toom-Cook 3-way algorithm @@ -279,6 +279,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toom_mul.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toom_sqr.c b/libtommath/bn_mp_toom_sqr.c index 14a235a..48880d0 100644 --- a/libtommath/bn_mp_toom_sqr.c +++ b/libtommath/bn_mp_toom_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* squaring using Toom-Cook 3-way algorithm */ @@ -221,6 +221,6 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toom_sqr.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toradix.c b/libtommath/bn_mp_toradix.c index 1bd8819..0adc28d 100644 --- a/libtommath/bn_mp_toradix.c +++ b/libtommath/bn_mp_toradix.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) */ @@ -70,6 +70,6 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toradix.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_toradix_n.c b/libtommath/bn_mp_toradix_n.c index 39d5101..796ed55 100644 --- a/libtommath/bn_mp_toradix_n.c +++ b/libtommath/bn_mp_toradix_n.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) @@ -83,6 +83,6 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_toradix_n.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_unsigned_bin_size.c b/libtommath/bn_mp_unsigned_bin_size.c index e79b91a..6dc3bd5 100644 --- a/libtommath/bn_mp_unsigned_bin_size.c +++ b/libtommath/bn_mp_unsigned_bin_size.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an unsigned equivalent */ @@ -23,6 +23,6 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_unsigned_bin_size.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_xor.c b/libtommath/bn_mp_xor.c index bf40408..59ff2e1 100644 --- a/libtommath/bn_mp_xor.c +++ b/libtommath/bn_mp_xor.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* XOR two ints together */ @@ -46,6 +46,6 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_xor.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_mp_zero.c b/libtommath/bn_mp_zero.c index 3cbd933..b0977d4 100644 --- a/libtommath/bn_mp_zero.c +++ b/libtommath/bn_mp_zero.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to zero */ @@ -31,6 +31,6 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_mp_zero.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_prime_tab.c b/libtommath/bn_prime_tab.c index 38cb592..bd25247 100644 --- a/libtommath/bn_prime_tab.c +++ b/libtommath/bn_prime_tab.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ const mp_digit ltm_prime_tab[] = { 0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013, @@ -56,6 +56,6 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_prime_tab.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_reverse.c b/libtommath/bn_reverse.c index 3132f93..ddfa827 100644 --- a/libtommath/bn_reverse.c +++ b/libtommath/bn_reverse.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reverse an array, used for radix code */ @@ -34,6 +34,6 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_reverse.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_add.c b/libtommath/bn_s_mp_add.c index 7023300..f034ae6 100644 --- a/libtommath/bn_s_mp_add.c +++ b/libtommath/bn_s_mp_add.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level addition, based on HAC pp.594, Algorithm 14.7 */ @@ -104,6 +104,6 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_add.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_exptmod.c b/libtommath/bn_s_mp_exptmod.c index 7c6e304..097d894 100644 --- a/libtommath/bn_s_mp_exptmod.c +++ b/libtommath/bn_s_mp_exptmod.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef MP_LOW_MEM #define TAB_SIZE 32 @@ -247,6 +247,6 @@ LBL_M: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_exptmod.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_mul_digs.c b/libtommath/bn_s_mp_mul_digs.c index eb99e33..f5bbf39 100644 --- a/libtommath/bn_s_mp_mul_digs.c +++ b/libtommath/bn_s_mp_mul_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and only computes upto digs digits of result @@ -85,6 +85,6 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_mul_high_digs.c b/libtommath/bn_s_mp_mul_high_digs.c index 2ae9ee1..2b718f2 100644 --- a/libtommath/bn_s_mp_mul_high_digs.c +++ b/libtommath/bn_s_mp_mul_high_digs.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and does not compute the lower digs digits @@ -76,6 +76,6 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_sqr.c b/libtommath/bn_s_mp_sqr.c index 0ae2869..d2531c2 100644 --- a/libtommath/bn_s_mp_sqr.c +++ b/libtommath/bn_s_mp_sqr.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ @@ -79,6 +79,6 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_sqr.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bn_s_mp_sub.c b/libtommath/bn_s_mp_sub.c index 94375a0..6a60c39 100644 --- a/libtommath/bn_s_mp_sub.c +++ b/libtommath/bn_s_mp_sub.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ @@ -84,6 +84,6 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bn_s_mp_sub.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/bncore.c b/libtommath/bncore.c index e53fdee..8fb1824 100644 --- a/libtommath/bncore.c +++ b/libtommath/bncore.c @@ -12,7 +12,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Known optimal configurations @@ -31,6 +31,6 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/bncore.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:11 $ */ +/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/libtommath/booker.pl b/libtommath/booker.pl index df8b30d..49f1889 100644 --- a/libtommath/booker.pl +++ b/libtommath/booker.pl @@ -82,7 +82,7 @@ while () { # scan till next end of comment, e.g. skip license while () { $text[$line++] = $_; - last if ($_ =~ /math\.libtomcrypt\.org/); + last if ($_ =~ /math\.libtomcrypt\.com/); } ; } diff --git a/libtommath/demo/demo.c b/libtommath/demo/demo.c index 0555366..bb5eb44 100644 --- a/libtommath/demo/demo.c +++ b/libtommath/demo/demo.c @@ -735,6 +735,6 @@ printf("compare no compare!\n"); exit(EXIT_FAILURE); } return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/demo/demo.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/demo/demo.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/06/24 11:32:07 $ */ diff --git a/libtommath/demo/timing.c b/libtommath/demo/timing.c index cf0f39c..d4660a9 100644 --- a/libtommath/demo/timing.c +++ b/libtommath/demo/timing.c @@ -314,6 +314,6 @@ int main(void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/demo/timing.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/demo/timing.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/2kprime.c b/libtommath/etc/2kprime.c index d8ea97c..c09818f 100644 --- a/libtommath/etc/2kprime.c +++ b/libtommath/etc/2kprime.c @@ -79,6 +79,6 @@ int main(void) -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/2kprime.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/etc/2kprime.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/drprime.c b/libtommath/etc/drprime.c index eec89ed..e413985 100644 --- a/libtommath/etc/drprime.c +++ b/libtommath/etc/drprime.c @@ -59,6 +59,6 @@ int main(void) } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/drprime.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/etc/drprime.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/mersenne.c b/libtommath/etc/mersenne.c index e4891c8..6a6497a 100644 --- a/libtommath/etc/mersenne.c +++ b/libtommath/etc/mersenne.c @@ -139,6 +139,6 @@ main (void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/mersenne.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:28 $ */ +/* $Source: /cvs/libtom/libtommath/etc/mersenne.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/03/31 14:18:47 $ */ diff --git a/libtommath/etc/mont.c b/libtommath/etc/mont.c index c6a8e32..393be4c 100644 --- a/libtommath/etc/mont.c +++ b/libtommath/etc/mont.c @@ -45,6 +45,6 @@ int main(void) -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/mont.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/etc/mont.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/etc/pprime.c b/libtommath/etc/pprime.c index abb3c5a..317e2a0 100644 --- a/libtommath/etc/pprime.c +++ b/libtommath/etc/pprime.c @@ -395,6 +395,6 @@ main (void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/pprime.c,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2006/12/01 00:08:28 $ */ +/* $Source: /cvs/libtom/libtommath/etc/pprime.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/03/31 14:18:47 $ */ diff --git a/libtommath/etc/tune.c b/libtommath/etc/tune.c index 3088bdb..d4a502c 100644 --- a/libtommath/etc/tune.c +++ b/libtommath/etc/tune.c @@ -137,6 +137,6 @@ main (void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/etc/tune.c,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:29 $ */ +/* $Source: /cvs/libtom/libtommath/etc/tune.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/03/31 14:18:47 $ */ diff --git a/libtommath/logs/index.html b/libtommath/logs/index.html index 2b65a0b..4b68c25 100644 --- a/libtommath/logs/index.html +++ b/libtommath/logs/index.html @@ -22,6 +22,6 @@ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/logs/index.html,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/logs/index.html,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/makefile.cygwin_dll b/libtommath/makefile.cygwin_dll index dae65ae..85a9b20 100644 --- a/libtommath/makefile.cygwin_dll +++ b/libtommath/makefile.cygwin_dll @@ -50,6 +50,6 @@ test: $(OBJECTS) windll gcc $(CFLAGS) demo/demo.c libtommath.dll.a -Wl,--enable-auto-import -o test -s cd mtest ; $(CC) -O3 -fomit-frame-pointer -funroll-loops mtest.c -o mtest -s -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/makefile.cygwin_dll,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:31:57 $ */ +/* $Source: /cvs/libtom/libtommath/makefile.cygwin_dll,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:45 $ */ diff --git a/libtommath/mtest/logtab.h b/libtommath/mtest/logtab.h index 4c8774c..bbefaef 100644 --- a/libtommath/mtest/logtab.h +++ b/libtommath/mtest/logtab.h @@ -19,6 +19,6 @@ const float s_logv_2[] = { }; -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/logtab.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/logtab.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi-config.h b/libtommath/mtest/mpi-config.h index e6ffbc4..6049c25 100644 --- a/libtommath/mtest/mpi-config.h +++ b/libtommath/mtest/mpi-config.h @@ -1,5 +1,5 @@ /* Default configuration for MPI library */ -/* $Id: mpi-config.h,v 1.1.1.2 2005/09/26 16:32:17 kennykb Exp $ */ +/* $Id: mpi-config.h,v 1.2 2005/05/05 14:38:47 tom Exp $ */ #ifndef MPI_CONFIG_H_ #define MPI_CONFIG_H_ @@ -85,6 +85,6 @@ /* crc==3287762869, version==2, Sat Feb 02 06:43:53 2002 */ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi-config.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi-config.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi-types.h b/libtommath/mtest/mpi-types.h index 96d5967..026de58 100644 --- a/libtommath/mtest/mpi-types.h +++ b/libtommath/mtest/mpi-types.h @@ -15,6 +15,6 @@ typedef int mp_err; #define RADIX (MP_DIGIT_MAX+1) -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi-types.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi-types.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi.c b/libtommath/mtest/mpi.c index 1b6f114..7c712dd 100644 --- a/libtommath/mtest/mpi.c +++ b/libtommath/mtest/mpi.c @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.c,v 1.1.1.2 2005/09/26 16:32:17 kennykb Exp $ + $Id: mpi.c,v 1.2 2005/05/05 14:38:47 tom Exp $ */ #include "mpi.h" @@ -3980,6 +3980,6 @@ int s_mp_outlen(int bits, int r) /* HERE THERE BE DRAGONS */ /* crc==4242132123, version==2, Sat Feb 02 06:43:52 2002 */ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mpi.h b/libtommath/mtest/mpi.h index 1bd0680..66ae873 100644 --- a/libtommath/mtest/mpi.h +++ b/libtommath/mtest/mpi.h @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.h,v 1.1.1.2 2005/09/26 16:32:17 kennykb Exp $ + $Id: mpi.h,v 1.2 2005/05/05 14:38:47 tom Exp $ */ #ifndef _H_MPI_ @@ -226,6 +226,6 @@ const char *mp_strerror(mp_err ec); #endif /* end _H_MPI_ */ -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mpi.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mpi.h,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/mtest/mtest.c b/libtommath/mtest/mtest.c index f18dc00..bdfe612 100644 --- a/libtommath/mtest/mtest.c +++ b/libtommath/mtest/mtest.c @@ -303,6 +303,6 @@ int main(void) return 0; } -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/mtest/mtest.c,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:17 $ */ +/* $Source: /cvs/libtom/libtommath/mtest/mtest.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2005/05/05 14:38:47 $ */ diff --git a/libtommath/tommath.h b/libtommath/tommath.h index f9b2d11..3c00b9e 100644 --- a/libtommath/tommath.h +++ b/libtommath/tommath.h @@ -579,6 +579,6 @@ extern const char *mp_s_rmap; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath.h,v $ */ -/* $Revision: 1.1.1.4 $ */ -/* $Date: 2006/12/01 00:08:12 $ */ +/* $Source: /cvs/libtom/libtommath/tommath.h,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/03/31 14:18:44 $ */ diff --git a/libtommath/tommath_class.h b/libtommath/tommath_class.h index 29e36fc..166dd80 100644 --- a/libtommath/tommath_class.h +++ b/libtommath/tommath_class.h @@ -994,6 +994,6 @@ #define LTM_LAST #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath_class.h,v $ */ -/* $Revision: 1.1.1.3 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/tommath_class.h,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/07/28 11:59:32 $ */ diff --git a/libtommath/tommath_superclass.h b/libtommath/tommath_superclass.h index 6722510..2fdebe6 100644 --- a/libtommath/tommath_superclass.h +++ b/libtommath/tommath_superclass.h @@ -71,6 +71,6 @@ #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath_superclass.h,v $ */ -/* $Revision: 1.1.1.2 $ */ -/* $Date: 2005/09/26 16:32:16 $ */ +/* $Source: /cvs/libtom/libtommath/tommath_superclass.h,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/05/14 13:29:17 $ */ -- cgit v0.12 From b5c43fbc876f3a372f5d83509d70f648ae9d6b88 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Mar 2011 11:51:58 +0000 Subject: Import of libtommath 0.40 --- libtommath/bn_mp_montgomery_setup.c | 2 +- libtommath/changes.txt | 4 ++++ libtommath/etc/drprimes.txt | 11 +++++++---- libtommath/makefile | 7 ++++--- libtommath/makefile.shared | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/libtommath/bn_mp_montgomery_setup.c b/libtommath/bn_mp_montgomery_setup.c index 261a9fb..f082749 100644 --- a/libtommath/bn_mp_montgomery_setup.c +++ b/libtommath/bn_mp_montgomery_setup.c @@ -48,7 +48,7 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) #endif /* rho = -1/m mod b */ - *rho = (((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; + *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; return MP_OKAY; } diff --git a/libtommath/changes.txt b/libtommath/changes.txt index 9498d36..aaaf69f 100644 --- a/libtommath/changes.txt +++ b/libtommath/changes.txt @@ -1,3 +1,7 @@ +December 24th, 2006 +v0.40 -- Updated makefile to properly support LIBNAME + -- Fixed bug in fast_s_mp_mul_high_digs() which overflowed (line 83), thanks Valgrind! + April 4th, 2006 v0.39 -- Jim Wigginton pointed out my Montgomery examples in figures 6.4 and 6.6 were off by one, k should be 9 not 8 -- Bruce Guenter suggested I use --tag=CC for libtool builds where the compiler may think it's C++. diff --git a/libtommath/etc/drprimes.txt b/libtommath/etc/drprimes.txt index 2c887ea..7c97f67 100644 --- a/libtommath/etc/drprimes.txt +++ b/libtommath/etc/drprimes.txt @@ -1,6 +1,9 @@ -280-bit prime: -p == 1942668892225729070919461906823518906642406839052139521251812409738904285204940164839 +300-bit prime: +p == 2037035976334486086268445688409378161051468393665936250636140449354381298610415201576637819 -532-bit prime: -p == 14059105607947488696282932836518693308967803494693489478439861164411992439598399594747002144074658928593502845729752797260025831423419686528151609940203368691747 +540-bit prime: +p == 3599131035634557106248430806148785487095757694641533306480604458089470064537190296255232548883112685719936728506816716098566612844395439751206810991770626477344739 + +780-bit prime: +p == 6359114106063703798370219984742410466332205126109989319225557147754704702203399726411277962562135973685197744935448875852478791860694279747355800678568677946181447581781401213133886609947027230004277244697462656003655947791725966271167 diff --git a/libtommath/makefile b/libtommath/makefile index e08a888..9f69678 100644 --- a/libtommath/makefile +++ b/libtommath/makefile @@ -3,7 +3,7 @@ #Tom St Denis #version of library -VERSION=0.39 +VERSION=0.40 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare @@ -40,12 +40,13 @@ else USER=$(INSTALL_USER) endif -default: libtommath.a - #default files to install ifndef LIBNAME LIBNAME=libtommath.a endif + +default: ${LIBNAME} + HEADERS=tommath.h tommath_class.h tommath_superclass.h #LIBPATH-The directory for libtommath to be installed to. diff --git a/libtommath/makefile.shared b/libtommath/makefile.shared index 8522d44..e230fb8 100644 --- a/libtommath/makefile.shared +++ b/libtommath/makefile.shared @@ -1,7 +1,7 @@ #Makefile for GCC # #Tom St Denis -VERSION=0:39 +VERSION=0:40 CC = libtool --mode=compile --tag=CC gcc -- cgit v0.12 From b7a189417b38e35bb825490a1b9a15fc8d138333 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Mar 2011 11:59:15 +0000 Subject: Import of libtommath 0.41 Import of libtommath 0.41 --- libtommath/bn.ind | 130 +++--- libtommath/bn.pdf | Bin 340921 -> 345714 bytes libtommath/bn.tex | 6 +- libtommath/bn_mp_div_d.c | 11 +- libtommath/changes.txt | 4 + libtommath/libtommath.dsp | 572 ++++++++++++++++++++++++ libtommath/logs/addsub.png | Bin 6253 -> 6254 bytes libtommath/logs/expt.png | Bin 6604 -> 6605 bytes libtommath/logs/invmod.png | Bin 4917 -> 4918 bytes libtommath/logs/mult.png | Bin 6769 -> 6770 bytes libtommath/makefile | 2 +- libtommath/makefile.shared | 2 +- libtommath/pics/expt_state.tif | Bin 87540 -> 87542 bytes libtommath/pics/primality.tif | Bin 85512 -> 85514 bytes libtommath/poster.pdf | Bin 37822 -> 37821 bytes libtommath/pre_gen/mpi.c | 963 +++++++++++++++++++++-------------------- libtommath/tommath.pdf | Bin 1194158 -> 1183099 bytes 17 files changed, 1138 insertions(+), 552 deletions(-) create mode 100644 libtommath/libtommath.dsp diff --git a/libtommath/bn.ind b/libtommath/bn.ind index e5f7d4a..c099b52 100644 --- a/libtommath/bn.ind +++ b/libtommath/bn.ind @@ -1,82 +1,82 @@ \begin{theindex} - \item mp\_add, \hyperpage{29} - \item mp\_add\_d, \hyperpage{52} - \item mp\_and, \hyperpage{29} - \item mp\_clear, \hyperpage{11} - \item mp\_clear\_multi, \hyperpage{12} - \item mp\_cmp, \hyperpage{24} - \item mp\_cmp\_d, \hyperpage{25} + \item mp\_add, \hyperpage{31} + \item mp\_add\_d, \hyperpage{56} + \item mp\_and, \hyperpage{31} + \item mp\_clear, \hyperpage{12} + \item mp\_clear\_multi, \hyperpage{13} + \item mp\_cmp, \hyperpage{25} + \item mp\_cmp\_d, \hyperpage{26} \item mp\_cmp\_mag, \hyperpage{23} - \item mp\_div, \hyperpage{30} - \item mp\_div\_2, \hyperpage{26} - \item mp\_div\_2d, \hyperpage{28} - \item mp\_div\_d, \hyperpage{52} - \item mp\_dr\_reduce, \hyperpage{40} - \item mp\_dr\_setup, \hyperpage{40} - \item MP\_EQ, \hyperpage{22} - \item mp\_error\_to\_string, \hyperpage{10} - \item mp\_expt\_d, \hyperpage{43} - \item mp\_exptmod, \hyperpage{43} - \item mp\_exteuclid, \hyperpage{51} - \item mp\_gcd, \hyperpage{51} + \item mp\_div, \hyperpage{32} + \item mp\_div\_2, \hyperpage{28} + \item mp\_div\_2d, \hyperpage{30} + \item mp\_div\_d, \hyperpage{56} + \item mp\_dr\_reduce, \hyperpage{45} + \item mp\_dr\_setup, \hyperpage{45} + \item MP\_EQ, \hyperpage{23} + \item mp\_error\_to\_string, \hyperpage{9} + \item mp\_expt\_d, \hyperpage{47} + \item mp\_exptmod, \hyperpage{47} + \item mp\_exteuclid, \hyperpage{55} + \item mp\_gcd, \hyperpage{55} \item mp\_get\_int, \hyperpage{20} - \item mp\_grow, \hyperpage{16} - \item MP\_GT, \hyperpage{22} + \item mp\_grow, \hyperpage{17} + \item MP\_GT, \hyperpage{23} \item mp\_init, \hyperpage{11} - \item mp\_init\_copy, \hyperpage{13} - \item mp\_init\_multi, \hyperpage{12} + \item mp\_init\_copy, \hyperpage{14} + \item mp\_init\_multi, \hyperpage{13} \item mp\_init\_set, \hyperpage{21} \item mp\_init\_set\_int, \hyperpage{21} - \item mp\_init\_size, \hyperpage{14} + \item mp\_init\_size, \hyperpage{15} \item mp\_int, \hyperpage{10} - \item mp\_invmod, \hyperpage{52} - \item mp\_jacobi, \hyperpage{52} - \item mp\_lcm, \hyperpage{51} - \item mp\_lshd, \hyperpage{28} - \item MP\_LT, \hyperpage{22} + \item mp\_invmod, \hyperpage{56} + \item mp\_jacobi, \hyperpage{56} + \item mp\_lcm, \hyperpage{56} + \item mp\_lshd, \hyperpage{30} + \item MP\_LT, \hyperpage{23} \item MP\_MEM, \hyperpage{9} - \item mp\_mod, \hyperpage{35} - \item mp\_mod\_d, \hyperpage{52} - \item mp\_montgomery\_calc\_normalization, \hyperpage{38} - \item mp\_montgomery\_reduce, \hyperpage{37} - \item mp\_montgomery\_setup, \hyperpage{37} - \item mp\_mul, \hyperpage{31} - \item mp\_mul\_2, \hyperpage{26} - \item mp\_mul\_2d, \hyperpage{28} - \item mp\_mul\_d, \hyperpage{52} - \item mp\_n\_root, \hyperpage{44} - \item mp\_neg, \hyperpage{29} + \item mp\_mod, \hyperpage{39} + \item mp\_mod\_d, \hyperpage{56} + \item mp\_montgomery\_calc\_normalization, \hyperpage{42} + \item mp\_montgomery\_reduce, \hyperpage{42} + \item mp\_montgomery\_setup, \hyperpage{42} + \item mp\_mul, \hyperpage{33} + \item mp\_mul\_2, \hyperpage{28} + \item mp\_mul\_2d, \hyperpage{29} + \item mp\_mul\_d, \hyperpage{56} + \item mp\_n\_root, \hyperpage{48} + \item mp\_neg, \hyperpage{31, 32} \item MP\_NO, \hyperpage{9} \item MP\_OKAY, \hyperpage{9} - \item mp\_or, \hyperpage{29} - \item mp\_prime\_fermat, \hyperpage{45} - \item mp\_prime\_is\_divisible, \hyperpage{45} - \item mp\_prime\_is\_prime, \hyperpage{46} - \item mp\_prime\_miller\_rabin, \hyperpage{45} - \item mp\_prime\_next\_prime, \hyperpage{46} - \item mp\_prime\_rabin\_miller\_trials, \hyperpage{46} - \item mp\_prime\_random, \hyperpage{47} - \item mp\_prime\_random\_ex, \hyperpage{47} - \item mp\_radix\_size, \hyperpage{49} - \item mp\_read\_radix, \hyperpage{49} - \item mp\_read\_unsigned\_bin, \hyperpage{50} - \item mp\_reduce, \hyperpage{36} - \item mp\_reduce\_2k, \hyperpage{41} - \item mp\_reduce\_2k\_setup, \hyperpage{41} - \item mp\_reduce\_setup, \hyperpage{36} - \item mp\_rshd, \hyperpage{28} + \item mp\_or, \hyperpage{31} + \item mp\_prime\_fermat, \hyperpage{49} + \item mp\_prime\_is\_divisible, \hyperpage{49} + \item mp\_prime\_is\_prime, \hyperpage{51} + \item mp\_prime\_miller\_rabin, \hyperpage{50} + \item mp\_prime\_next\_prime, \hyperpage{51} + \item mp\_prime\_rabin\_miller\_trials, \hyperpage{50} + \item mp\_prime\_random, \hyperpage{51} + \item mp\_prime\_random\_ex, \hyperpage{52} + \item mp\_radix\_size, \hyperpage{53} + \item mp\_read\_radix, \hyperpage{53} + \item mp\_read\_unsigned\_bin, \hyperpage{54} + \item mp\_reduce, \hyperpage{40} + \item mp\_reduce\_2k, \hyperpage{46} + \item mp\_reduce\_2k\_setup, \hyperpage{46} + \item mp\_reduce\_setup, \hyperpage{40} + \item mp\_rshd, \hyperpage{30} \item mp\_set, \hyperpage{19} \item mp\_set\_int, \hyperpage{20} - \item mp\_shrink, \hyperpage{15} - \item mp\_sqr, \hyperpage{33} - \item mp\_sub, \hyperpage{29} - \item mp\_sub\_d, \hyperpage{52} - \item mp\_to\_unsigned\_bin, \hyperpage{50} - \item mp\_toradix, \hyperpage{49} - \item mp\_unsigned\_bin\_size, \hyperpage{50} + \item mp\_shrink, \hyperpage{16} + \item mp\_sqr, \hyperpage{35} + \item mp\_sub, \hyperpage{31} + \item mp\_sub\_d, \hyperpage{56} + \item mp\_to\_unsigned\_bin, \hyperpage{54} + \item mp\_toradix, \hyperpage{53} + \item mp\_unsigned\_bin\_size, \hyperpage{54} \item MP\_VAL, \hyperpage{9} - \item mp\_xor, \hyperpage{29} + \item mp\_xor, \hyperpage{31} \item MP\_YES, \hyperpage{9} \end{theindex} diff --git a/libtommath/bn.pdf b/libtommath/bn.pdf index 392b649..5be7123 100644 Binary files a/libtommath/bn.pdf and b/libtommath/bn.pdf differ diff --git a/libtommath/bn.tex b/libtommath/bn.tex index e8eb994..9017860 100644 --- a/libtommath/bn.tex +++ b/libtommath/bn.tex @@ -1,4 +1,4 @@ -\documentclass[b5paper]{book} +\documentclass[synpaper]{book} \usepackage{hyperref} \usepackage{makeidx} \usepackage{amssymb} @@ -49,8 +49,8 @@ \begin{document} \frontmatter \pagestyle{empty} -\title{LibTomMath User Manual \\ v0.39} -\author{Tom St Denis \\ tomstdenis@iahu.ca} +\title{LibTomMath User Manual \\ v0.41} +\author{Tom St Denis \\ tomstdenis@gmail.com} \maketitle This text, the library and the accompanying textbook are all hereby placed in the public domain. This book has been formatted for B5 [176x250] paper using the \LaTeX{} {\em book} macro package. diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c index d64b4b5..6a26d4f 100644 --- a/libtommath/bn_mp_div_d.c +++ b/libtommath/bn_mp_div_d.c @@ -19,7 +19,12 @@ static int s_is_power_of_two(mp_digit b, int *p) { int x; - for (x = 1; x < DIGIT_BIT; x++) { + /* fast return if no power of two */ + if ((b==0) || (b & (b-1))) { + return 0; + } + + for (x = 0; x < DIGIT_BIT; x++) { if (b == (((mp_digit)1)< +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libtommath - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libtommath.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libtommath.mak" CFG="libtommath - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libtommath - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libtommath - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "libtommath" +# PROP Scc_LocalPath "." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libtommath - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Release\tommath.lib" + +!ELSEIF "$(CFG)" == "libtommath - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug\tommath.lib" + +!ENDIF + +# Begin Target + +# Name "libtommath - Win32 Release" +# Name "libtommath - Win32 Debug" +# Begin Source File + +SOURCE=.\bn_error.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_mp_invmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_mp_montgomery_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_s_mp_mul_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_s_mp_mul_high_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_fast_s_mp_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_2expt.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_abs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_add.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_add_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_addmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_and.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_clamp.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_clear.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_clear_multi.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cmp.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cmp_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cmp_mag.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_cnt_lsb.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_copy.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_count_bits.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_2.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_2d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_3.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_div_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_dr_is_modulus.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_dr_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_dr_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exch.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_expt_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exptmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exptmod_fast.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_exteuclid.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_fread.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_fwrite.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_gcd.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_get_int.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_grow.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_copy.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_multi.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_set.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_set_int.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_init_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_invmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_invmod_slow.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_is_square.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_jacobi.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_karatsuba_mul.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_karatsuba_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_lcm.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_lshd.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mod_2d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mod_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_montgomery_calc_normalization.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_montgomery_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_montgomery_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul_2.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul_2d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mul_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_mulmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_n_root.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_neg.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_or.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_fermat.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_is_divisible.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_is_prime.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_miller_rabin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_next_prime.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_rabin_miller_trials.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_prime_random_ex.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_radix_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_radix_smap.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_rand.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_read_radix.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_read_signed_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_read_unsigned_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k_l.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_2k_setup_l.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_is_2k.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_is_2k_l.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_reduce_setup.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_rshd.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_set.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_set_int.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_shrink.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_signed_bin_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sqrmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sqrt.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sub.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_sub_d.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_submod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_signed_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_signed_bin_n.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_unsigned_bin.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_to_unsigned_bin_n.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toom_mul.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toom_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toradix.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_toradix_n.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_unsigned_bin_size.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_xor.c +# End Source File +# Begin Source File + +SOURCE=.\bn_mp_zero.c +# End Source File +# Begin Source File + +SOURCE=.\bn_prime_tab.c +# End Source File +# Begin Source File + +SOURCE=.\bn_reverse.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_add.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_exptmod.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_mul_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_mul_high_digs.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_sqr.c +# End Source File +# Begin Source File + +SOURCE=.\bn_s_mp_sub.c +# End Source File +# Begin Source File + +SOURCE=.\bncore.c +# End Source File +# Begin Source File + +SOURCE=.\tommath.h +# End Source File +# Begin Source File + +SOURCE=.\tommath_class.h +# End Source File +# Begin Source File + +SOURCE=.\tommath_superclass.h +# End Source File +# End Target +# End Project diff --git a/libtommath/logs/addsub.png b/libtommath/logs/addsub.png index 441c7b2..a5679ac 100644 Binary files a/libtommath/logs/addsub.png and b/libtommath/logs/addsub.png differ diff --git a/libtommath/logs/expt.png b/libtommath/logs/expt.png index d779cc5..9ee8bb7 100644 Binary files a/libtommath/logs/expt.png and b/libtommath/logs/expt.png differ diff --git a/libtommath/logs/invmod.png b/libtommath/logs/invmod.png index 9dcd7d8..0a8a4ad 100644 Binary files a/libtommath/logs/invmod.png and b/libtommath/logs/invmod.png differ diff --git a/libtommath/logs/mult.png b/libtommath/logs/mult.png index d22e8c8..4f7a4ee 100644 Binary files a/libtommath/logs/mult.png and b/libtommath/logs/mult.png differ diff --git a/libtommath/makefile b/libtommath/makefile index 9f69678..3e254d4 100644 --- a/libtommath/makefile +++ b/libtommath/makefile @@ -3,7 +3,7 @@ #Tom St Denis #version of library -VERSION=0.40 +VERSION=0.41 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare diff --git a/libtommath/makefile.shared b/libtommath/makefile.shared index e230fb8..f17bbbd 100644 --- a/libtommath/makefile.shared +++ b/libtommath/makefile.shared @@ -1,7 +1,7 @@ #Makefile for GCC # #Tom St Denis -VERSION=0:40 +VERSION=0:41 CC = libtool --mode=compile --tag=CC gcc diff --git a/libtommath/pics/expt_state.tif b/libtommath/pics/expt_state.tif index 0aaee39..cb06e8e 100644 Binary files a/libtommath/pics/expt_state.tif and b/libtommath/pics/expt_state.tif differ diff --git a/libtommath/pics/primality.tif b/libtommath/pics/primality.tif index 83aafe0..76d6be3 100644 Binary files a/libtommath/pics/primality.tif and b/libtommath/pics/primality.tif differ diff --git a/libtommath/poster.pdf b/libtommath/poster.pdf index 1f705cf..f3768d7 100644 Binary files a/libtommath/poster.pdf and b/libtommath/poster.pdf differ diff --git a/libtommath/pre_gen/mpi.c b/libtommath/pre_gen/mpi.c index 62ec029..b7f4d47 100644 --- a/libtommath/pre_gen/mpi.c +++ b/libtommath/pre_gen/mpi.c @@ -13,7 +13,7 @@ * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const struct { @@ -43,9 +43,9 @@ char *mp_error_to_string(int code) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_error.c */ @@ -64,7 +64,7 @@ char *mp_error_to_string(int code) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the modular inverse via binary extended euclidean algorithm, @@ -195,9 +195,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_mp_invmod.c */ @@ -216,7 +216,7 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction @@ -371,9 +371,9 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_mp_montgomery_reduce.c */ @@ -392,7 +392,7 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Fast (comba) multiplier @@ -482,9 +482,9 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_s_mp_mul_digs.c */ @@ -503,7 +503,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this is a modified version of fast_s_mul_digs that only produces @@ -569,7 +569,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) register mp_digit *tmpc; tmpc = c->dp + digs; - for (ix = digs; ix <= pa; ix++) { + for (ix = digs; ix < pa; ix++) { /* now extract the previous digit [below the carry] */ *tmpc++ = W[ix]; } @@ -584,9 +584,9 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_s_mp_mul_high_digs.c */ @@ -605,7 +605,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* the jist of squaring... @@ -702,9 +702,9 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_fast_s_mp_sqr.c */ @@ -723,7 +723,7 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes a = 2**b @@ -754,9 +754,9 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_2expt.c */ @@ -775,7 +775,7 @@ mp_2expt (mp_int * a, int b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = |a| @@ -801,9 +801,9 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_abs.c */ @@ -822,7 +822,7 @@ mp_abs (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level addition (handles signs) */ @@ -858,9 +858,9 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_add.c */ @@ -879,7 +879,7 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit addition */ @@ -974,9 +974,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_add_d.c */ @@ -995,7 +995,7 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a + b (mod c) */ @@ -1019,9 +1019,9 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_addmod.c */ @@ -1040,7 +1040,7 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* AND two ints together */ @@ -1080,9 +1080,9 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_and.c */ @@ -1101,7 +1101,7 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* trim unused digits @@ -1128,9 +1128,9 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_clamp.c */ @@ -1149,7 +1149,7 @@ mp_clamp (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* clear one (frees) */ @@ -1176,9 +1176,9 @@ mp_clear (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_clear.c */ @@ -1197,7 +1197,7 @@ mp_clear (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include @@ -1214,9 +1214,9 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_clear_multi.c */ @@ -1235,7 +1235,7 @@ void mp_clear_multi(mp_int *mp, ...) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare two ints (signed)*/ @@ -1261,9 +1261,9 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cmp.c */ @@ -1282,7 +1282,7 @@ mp_cmp (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare a digit */ @@ -1309,9 +1309,9 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cmp_d.c */ @@ -1330,7 +1330,7 @@ int mp_cmp_d(mp_int * a, mp_digit b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* compare maginitude of two ints (unsigned) */ @@ -1368,9 +1368,9 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cmp_mag.c */ @@ -1389,7 +1389,7 @@ int mp_cmp_mag (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static const int lnz[16] = { @@ -1425,9 +1425,9 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_cnt_lsb.c */ @@ -1446,7 +1446,7 @@ int mp_cnt_lsb(mp_int *a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* copy, b = a */ @@ -1497,9 +1497,9 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_copy.c */ @@ -1518,7 +1518,7 @@ mp_copy (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns the number of bits in an int */ @@ -1546,9 +1546,9 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_count_bits.c */ @@ -1567,7 +1567,7 @@ mp_count_bits (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef BN_MP_DIV_SMALL @@ -1842,9 +1842,9 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div.c */ @@ -1863,7 +1863,7 @@ LBL_Q:mp_clear (&q); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a/2 */ @@ -1914,9 +1914,9 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div_2.c */ @@ -1935,7 +1935,7 @@ int mp_div_2(mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right by a certain bit count (store quotient in c, optional remainder in d) */ @@ -2015,9 +2015,9 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div_2d.c */ @@ -2036,7 +2036,7 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* divide by three (based on routine from MPI and the GMP manual) */ @@ -2098,9 +2098,9 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_div_3.c */ @@ -2119,14 +2119,19 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ static int s_is_power_of_two(mp_digit b, int *p) { int x; - for (x = 1; x < DIGIT_BIT; x++) { + /* fast return if no power of two */ + if ((b==0) || (b & (b-1))) { + return 0; + } + + for (x = 0; x < DIGIT_BIT; x++) { if (b == (((mp_digit)1)< @@ -3514,9 +3519,9 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_multi.c */ @@ -3535,7 +3540,7 @@ int mp_init_multi(mp_int *mp, ...) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -3550,9 +3555,9 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_set.c */ @@ -3571,7 +3576,7 @@ int mp_init_set (mp_int * a, mp_digit b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* initialize and set a digit */ @@ -3585,9 +3590,9 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_set_int.c */ @@ -3606,7 +3611,7 @@ int mp_init_set_int (mp_int * a, unsigned long b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* init an mp_init for a given size */ @@ -3637,9 +3642,9 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_init_size.c */ @@ -3658,7 +3663,7 @@ int mp_init_size (mp_int * a, int size) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -3684,9 +3689,9 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_invmod.c */ @@ -3705,7 +3710,7 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* hac 14.61, pp608 */ @@ -3863,9 +3868,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_invmod_slow.c */ @@ -3884,7 +3889,7 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Check if remainders are possible squares - fast exclude non-squares */ @@ -3976,9 +3981,9 @@ ERR:mp_clear(&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_is_square.c */ @@ -3997,7 +4002,7 @@ ERR:mp_clear(&t); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes the jacobi c = (a | n) (or Legendre if n is prime) @@ -4085,9 +4090,9 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_jacobi.c */ @@ -4106,7 +4111,7 @@ LBL_A1:mp_clear (&a1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = |a| * |b| using Karatsuba Multiplication using @@ -4256,9 +4261,9 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_karatsuba_mul.c */ @@ -4277,7 +4282,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Karatsuba squaring, computes b = a*a using three @@ -4381,9 +4386,9 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_karatsuba_sqr.c */ @@ -4402,7 +4407,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes least common multiple as |a*b|/(a, b) */ @@ -4445,9 +4450,9 @@ LBL_T: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_lcm.c */ @@ -4466,7 +4471,7 @@ LBL_T: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left a certain amount of digits */ @@ -4516,9 +4521,9 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_lshd.c */ @@ -4537,7 +4542,7 @@ int mp_lshd (mp_int * a, int b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a mod b, 0 <= c < b */ @@ -4568,9 +4573,9 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mod.c */ @@ -4589,7 +4594,7 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* calc a value mod 2**b */ @@ -4627,9 +4632,9 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mod_2d.c */ @@ -4648,7 +4653,7 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ int @@ -4658,9 +4663,9 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mod_d.c */ @@ -4679,7 +4684,7 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* @@ -4721,9 +4726,9 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_montgomery_calc_normalization.c */ @@ -4742,7 +4747,7 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes xR**-1 == x (mod N) via Montgomery Reduction */ @@ -4843,9 +4848,9 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_montgomery_reduce.c */ @@ -4864,7 +4869,7 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* setups the montgomery reduction stuff */ @@ -4900,15 +4905,15 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) #endif /* rho = -1/m mod b */ - *rho = (((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; + *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; return MP_OKAY; } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_montgomery_setup.c */ @@ -4927,7 +4932,7 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level multiplication (handles sign) */ @@ -4976,9 +4981,9 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul.c */ @@ -4997,7 +5002,7 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = a*2 */ @@ -5062,9 +5067,9 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul_2.c */ @@ -5083,7 +5088,7 @@ int mp_mul_2(mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift left by a certain bit count */ @@ -5151,9 +5156,9 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul_2d.c */ @@ -5172,7 +5177,7 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiply by a digit */ @@ -5234,9 +5239,9 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mul_d.c */ @@ -5255,7 +5260,7 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a * b (mod c) */ @@ -5278,9 +5283,9 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_mulmod.c */ @@ -5299,7 +5304,7 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* find the n'th root of an integer @@ -5414,9 +5419,9 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_n_root.c */ @@ -5435,7 +5440,7 @@ LBL_T1:mp_clear (&t1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* b = -a */ @@ -5458,9 +5463,9 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_neg.c */ @@ -5479,7 +5484,7 @@ int mp_neg (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* OR two ints together */ @@ -5512,9 +5517,9 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_or.c */ @@ -5533,7 +5538,7 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs one Fermat test. @@ -5578,9 +5583,9 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_fermat.c */ @@ -5599,7 +5604,7 @@ LBL_T:mp_clear (&t); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if an integers is divisible by one @@ -5632,9 +5637,9 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_is_divisible.c */ @@ -5653,7 +5658,7 @@ int mp_prime_is_divisible (mp_int * a, int *result) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* performs a variable number of rounds of Miller-Rabin @@ -5719,9 +5724,9 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_is_prime.c */ @@ -5740,7 +5745,7 @@ LBL_B:mp_clear (&b); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Miller-Rabin test of "a" to the base of "b" as described in @@ -5826,9 +5831,9 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_miller_rabin.c */ @@ -5847,7 +5852,7 @@ LBL_N1:mp_clear (&n1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* finds the next prime after the number "a" using "t" trials @@ -6000,9 +6005,9 @@ LBL_ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_next_prime.c */ @@ -6021,7 +6026,7 @@ LBL_ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ @@ -6056,9 +6061,9 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_rabin_miller_trials.c */ @@ -6077,7 +6082,7 @@ int mp_prime_rabin_miller_trials(int size) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a truly random prime of a given size (bits), @@ -6185,9 +6190,9 @@ error: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_prime_random_ex.c */ @@ -6206,7 +6211,7 @@ error: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* returns size of ASCII reprensentation */ @@ -6267,9 +6272,9 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_radix_size.c */ @@ -6288,16 +6293,16 @@ int mp_radix_size (mp_int * a, int radix, int *size) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* chars used in radix conversions */ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_radix_smap.c */ @@ -6316,7 +6321,7 @@ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* makes a pseudo-random int of a given size */ @@ -6354,9 +6359,9 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_rand.c */ @@ -6375,7 +6380,7 @@ mp_rand (mp_int * a, int digits) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read a string [ASCII] in a given radix */ @@ -6443,9 +6448,9 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_read_radix.c */ @@ -6464,7 +6469,7 @@ int mp_read_radix (mp_int * a, const char *str, int radix) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* read signed bin, big endian, first byte is 0==positive or 1==negative */ @@ -6488,9 +6493,9 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_read_signed_bin.c */ @@ -6509,7 +6514,7 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reads a unsigned char array, assumes the msb is stored first [big endian] */ @@ -6547,9 +6552,9 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_read_unsigned_bin.c */ @@ -6568,7 +6573,7 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces x mod m, assumes 0 < x < m**2, mu is @@ -6651,9 +6656,9 @@ CLEANUP: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce.c */ @@ -6672,7 +6677,7 @@ CLEANUP: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d */ @@ -6716,9 +6721,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k.c */ @@ -6737,7 +6742,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduces a modulo n where n is of the form 2**p - d @@ -6782,9 +6787,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k_l.c */ @@ -6803,7 +6808,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -6833,9 +6838,9 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k_setup.c */ @@ -6854,7 +6859,7 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines the setup value */ @@ -6881,9 +6886,9 @@ ERR: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_2k_setup_l.c */ @@ -6902,7 +6907,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if mp_reduce_2k can be used */ @@ -6937,9 +6942,9 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_is_2k.c */ @@ -6958,7 +6963,7 @@ int mp_reduce_is_2k(mp_int *a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* determines if reduce_2k_l can be used */ @@ -6985,9 +6990,9 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_is_2k_l.c */ @@ -7006,7 +7011,7 @@ int mp_reduce_is_2k_l(mp_int *a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* pre-calculate the value required for Barrett reduction @@ -7023,9 +7028,9 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_reduce_setup.c */ @@ -7044,7 +7049,7 @@ int mp_reduce_setup (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shift right a certain amount of digits */ @@ -7099,9 +7104,9 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_rshd.c */ @@ -7120,7 +7125,7 @@ void mp_rshd (mp_int * a, int b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to a digit */ @@ -7132,9 +7137,9 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_set.c */ @@ -7153,7 +7158,7 @@ void mp_set (mp_int * a, mp_digit b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set a 32-bit const */ @@ -7184,9 +7189,9 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_set_int.c */ @@ -7205,7 +7210,7 @@ int mp_set_int (mp_int * a, unsigned long b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* shrink a bignum */ @@ -7223,9 +7228,9 @@ int mp_shrink (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_shrink.c */ @@ -7244,7 +7249,7 @@ int mp_shrink (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an signed equivalent */ @@ -7254,9 +7259,9 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_signed_bin_size.c */ @@ -7275,7 +7280,7 @@ int mp_signed_bin_size (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* computes b = a*a */ @@ -7316,9 +7321,9 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sqr.c */ @@ -7337,7 +7342,7 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* c = a * a (mod b) */ @@ -7361,9 +7366,9 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sqrmod.c */ @@ -7382,7 +7387,7 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* this function is less generic than mp_n_root, simpler and faster */ @@ -7446,9 +7451,9 @@ E2: mp_clear(&t1); #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sqrt.c */ @@ -7467,7 +7472,7 @@ E2: mp_clear(&t1); * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* high level subtraction (handles signs) */ @@ -7509,9 +7514,9 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sub.c */ @@ -7530,7 +7535,7 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* single digit subtraction */ @@ -7606,9 +7611,9 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_sub_d.c */ @@ -7627,7 +7632,7 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* d = a - b (mod c) */ @@ -7652,9 +7657,9 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_submod.c */ @@ -7673,7 +7678,7 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -7689,9 +7694,9 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_signed_bin.c */ @@ -7710,7 +7715,7 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in signed [big endian] format */ @@ -7724,9 +7729,9 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_signed_bin_n.c */ @@ -7745,7 +7750,7 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -7776,9 +7781,9 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_unsigned_bin.c */ @@ -7797,7 +7802,7 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* store in unsigned [big endian] format */ @@ -7811,9 +7816,9 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_to_unsigned_bin_n.c */ @@ -7832,7 +7837,7 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplication using the Toom-Cook 3-way algorithm @@ -8099,9 +8104,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toom_mul.c */ @@ -8120,7 +8125,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* squaring using Toom-Cook 3-way algorithm */ @@ -8329,9 +8334,9 @@ ERR: #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toom_sqr.c */ @@ -8350,7 +8355,7 @@ ERR: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) */ @@ -8408,9 +8413,9 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toradix.c */ @@ -8429,7 +8434,7 @@ int mp_toradix (mp_int * a, char *str, int radix) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* stores a bignum as a ASCII string in a given radix (2..64) @@ -8500,9 +8505,9 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_toradix_n.c */ @@ -8521,7 +8526,7 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* get the size for an unsigned equivalent */ @@ -8532,9 +8537,9 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_unsigned_bin_size.c */ @@ -8553,7 +8558,7 @@ int mp_unsigned_bin_size (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* XOR two ints together */ @@ -8587,9 +8592,9 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_xor.c */ @@ -8608,7 +8613,7 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to zero */ @@ -8627,9 +8632,9 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_mp_zero.c */ @@ -8648,7 +8653,7 @@ void mp_zero (mp_int * a) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ const mp_digit ltm_prime_tab[] = { 0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013, @@ -8692,9 +8697,9 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_prime_tab.c */ @@ -8713,7 +8718,7 @@ const mp_digit ltm_prime_tab[] = { * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reverse an array, used for radix code */ @@ -8735,9 +8740,9 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_reverse.c */ @@ -8756,7 +8761,7 @@ bn_reverse (unsigned char *s, int len) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level addition, based on HAC pp.594, Algorithm 14.7 */ @@ -8848,9 +8853,9 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_add.c */ @@ -8869,7 +8874,7 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #ifdef MP_LOW_MEM #define TAB_SIZE 32 @@ -9104,9 +9109,9 @@ LBL_M: } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_exptmod.c */ @@ -9125,7 +9130,7 @@ LBL_M: * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and only computes upto digs digits of result @@ -9198,9 +9203,9 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_mul_digs.c */ @@ -9219,7 +9224,7 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* multiplies |a| * |b| and does not compute the lower digs digits @@ -9283,9 +9288,9 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_mul_high_digs.c */ @@ -9304,7 +9309,7 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ @@ -9371,9 +9376,9 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_sqr.c */ @@ -9392,7 +9397,7 @@ int s_mp_sqr (mp_int * a, mp_int * b) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ @@ -9464,9 +9469,9 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bn_s_mp_sub.c */ @@ -9485,7 +9490,7 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) * The library is free for all purposes without any express * guarantee it works. * - * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* Known optimal configurations @@ -9504,9 +9509,9 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/pre_gen/mpi.c,v $ */ -/* $Revision: 1.1.1.5 $ */ -/* $Date: 2006/12/01 00:08:34 $ */ +/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ /* End: bncore.c */ diff --git a/libtommath/tommath.pdf b/libtommath/tommath.pdf index c9571d8..33994c3 100644 Binary files a/libtommath/tommath.pdf and b/libtommath/tommath.pdf differ -- cgit v0.12 From fac003f85aeba679d1cc6bea4eb8a84fc0ebd9f0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Mar 2011 12:08:07 +0000 Subject: Import of tommath 0.42.0 --- libtommath/bn.ind | 156 +- libtommath/bn.pdf | Bin 345714 -> 352808 bytes libtommath/bn.tex | 2 +- libtommath/bn_error.c | 6 +- libtommath/bn_fast_mp_invmod.c | 6 +- libtommath/bn_fast_mp_montgomery_reduce.c | 6 +- libtommath/bn_fast_s_mp_mul_digs.c | 6 +- libtommath/bn_fast_s_mp_mul_high_digs.c | 6 +- libtommath/bn_fast_s_mp_sqr.c | 6 +- libtommath/bn_mp_2expt.c | 6 +- libtommath/bn_mp_abs.c | 6 +- libtommath/bn_mp_add.c | 6 +- libtommath/bn_mp_add_d.c | 6 +- libtommath/bn_mp_addmod.c | 6 +- libtommath/bn_mp_and.c | 6 +- libtommath/bn_mp_clamp.c | 6 +- libtommath/bn_mp_clear.c | 6 +- libtommath/bn_mp_clear_multi.c | 6 +- libtommath/bn_mp_cmp.c | 6 +- libtommath/bn_mp_cmp_d.c | 6 +- libtommath/bn_mp_cmp_mag.c | 6 +- libtommath/bn_mp_cnt_lsb.c | 6 +- libtommath/bn_mp_copy.c | 6 +- libtommath/bn_mp_count_bits.c | 6 +- libtommath/bn_mp_div.c | 6 +- libtommath/bn_mp_div_2.c | 6 +- libtommath/bn_mp_div_2d.c | 6 +- libtommath/bn_mp_div_3.c | 6 +- libtommath/bn_mp_div_d.c | 6 +- libtommath/bn_mp_dr_is_modulus.c | 6 +- libtommath/bn_mp_dr_reduce.c | 6 +- libtommath/bn_mp_dr_setup.c | 6 +- libtommath/bn_mp_exch.c | 6 +- libtommath/bn_mp_expt_d.c | 6 +- libtommath/bn_mp_exptmod.c | 6 +- libtommath/bn_mp_exptmod_fast.c | 6 +- libtommath/bn_mp_exteuclid.c | 6 +- libtommath/bn_mp_fread.c | 6 +- libtommath/bn_mp_fwrite.c | 6 +- libtommath/bn_mp_gcd.c | 6 +- libtommath/bn_mp_get_int.c | 6 +- libtommath/bn_mp_grow.c | 6 +- libtommath/bn_mp_init.c | 6 +- libtommath/bn_mp_init_copy.c | 6 +- libtommath/bn_mp_init_multi.c | 6 +- libtommath/bn_mp_init_set.c | 6 +- libtommath/bn_mp_init_set_int.c | 6 +- libtommath/bn_mp_init_size.c | 6 +- libtommath/bn_mp_invmod.c | 6 +- libtommath/bn_mp_invmod_slow.c | 6 +- libtommath/bn_mp_is_square.c | 6 +- libtommath/bn_mp_jacobi.c | 6 +- libtommath/bn_mp_karatsuba_mul.c | 6 +- libtommath/bn_mp_karatsuba_sqr.c | 6 +- libtommath/bn_mp_lcm.c | 6 +- libtommath/bn_mp_lshd.c | 6 +- libtommath/bn_mp_mod.c | 6 +- libtommath/bn_mp_mod_2d.c | 6 +- libtommath/bn_mp_mod_d.c | 6 +- libtommath/bn_mp_montgomery_calc_normalization.c | 6 +- libtommath/bn_mp_montgomery_reduce.c | 6 +- libtommath/bn_mp_montgomery_setup.c | 6 +- libtommath/bn_mp_mul.c | 6 +- libtommath/bn_mp_mul_2.c | 6 +- libtommath/bn_mp_mul_2d.c | 6 +- libtommath/bn_mp_mul_d.c | 6 +- libtommath/bn_mp_mulmod.c | 6 +- libtommath/bn_mp_n_root.c | 6 +- libtommath/bn_mp_neg.c | 6 +- libtommath/bn_mp_or.c | 6 +- libtommath/bn_mp_prime_fermat.c | 6 +- libtommath/bn_mp_prime_is_divisible.c | 6 +- libtommath/bn_mp_prime_is_prime.c | 6 +- libtommath/bn_mp_prime_miller_rabin.c | 6 +- libtommath/bn_mp_prime_next_prime.c | 8 +- libtommath/bn_mp_prime_rabin_miller_trials.c | 6 +- libtommath/bn_mp_prime_random_ex.c | 6 +- libtommath/bn_mp_radix_size.c | 6 +- libtommath/bn_mp_radix_smap.c | 6 +- libtommath/bn_mp_rand.c | 6 +- libtommath/bn_mp_read_radix.c | 6 +- libtommath/bn_mp_read_signed_bin.c | 6 +- libtommath/bn_mp_read_unsigned_bin.c | 6 +- libtommath/bn_mp_reduce.c | 6 +- libtommath/bn_mp_reduce_2k.c | 6 +- libtommath/bn_mp_reduce_2k_l.c | 6 +- libtommath/bn_mp_reduce_2k_setup.c | 6 +- libtommath/bn_mp_reduce_2k_setup_l.c | 6 +- libtommath/bn_mp_reduce_is_2k.c | 6 +- libtommath/bn_mp_reduce_is_2k_l.c | 6 +- libtommath/bn_mp_reduce_setup.c | 6 +- libtommath/bn_mp_rshd.c | 6 +- libtommath/bn_mp_set.c | 6 +- libtommath/bn_mp_set_int.c | 6 +- libtommath/bn_mp_shrink.c | 17 +- libtommath/bn_mp_signed_bin_size.c | 6 +- libtommath/bn_mp_sqr.c | 6 +- libtommath/bn_mp_sqrmod.c | 6 +- libtommath/bn_mp_sqrt.c | 6 +- libtommath/bn_mp_sub.c | 6 +- libtommath/bn_mp_sub_d.c | 6 +- libtommath/bn_mp_submod.c | 6 +- libtommath/bn_mp_to_signed_bin.c | 6 +- libtommath/bn_mp_to_signed_bin_n.c | 6 +- libtommath/bn_mp_to_unsigned_bin.c | 6 +- libtommath/bn_mp_to_unsigned_bin_n.c | 6 +- libtommath/bn_mp_toom_mul.c | 6 +- libtommath/bn_mp_toom_sqr.c | 6 +- libtommath/bn_mp_toradix.c | 6 +- libtommath/bn_mp_toradix_n.c | 6 +- libtommath/bn_mp_unsigned_bin_size.c | 6 +- libtommath/bn_mp_xor.c | 6 +- libtommath/bn_mp_zero.c | 6 +- libtommath/bn_prime_tab.c | 6 +- libtommath/bn_reverse.c | 6 +- libtommath/bn_s_mp_add.c | 6 +- libtommath/bn_s_mp_exptmod.c | 6 +- libtommath/bn_s_mp_mul_digs.c | 6 +- libtommath/bn_s_mp_mul_high_digs.c | 6 +- libtommath/bn_s_mp_sqr.c | 6 +- libtommath/bn_s_mp_sub.c | 6 +- libtommath/bncore.c | 6 +- libtommath/changes.txt | 6 + libtommath/demo/demo.c | 6 +- libtommath/demo/timing.c | 6 +- libtommath/etc/2kprime.c | 6 +- libtommath/etc/drprime.c | 6 +- libtommath/etc/mersenne.c | 6 +- libtommath/etc/mont.c | 6 +- libtommath/etc/pprime.c | 6 +- libtommath/etc/tune.c | 6 +- libtommath/libtommath_VS2005.sln | 20 + libtommath/libtommath_VS2005.vcproj | 2803 +++++++++++++++++++++ libtommath/libtommath_VS2008.sln | 20 + libtommath/libtommath_VS2008.vcproj | 2805 ++++++++++++++++++++++ libtommath/makefile | 2 +- libtommath/mtest/logtab.h | 6 +- libtommath/mtest/mpi-config.h | 8 +- libtommath/mtest/mpi-types.h | 6 +- libtommath/mtest/mpi.c | 8 +- libtommath/mtest/mpi.h | 8 +- libtommath/mtest/mtest.c | 6 +- libtommath/poster.pdf | Bin 37821 -> 37806 bytes libtommath/pre_gen/mpi.c | 727 +++--- libtommath/tommath.h | 6 +- libtommath/tommath.pdf | Bin 1183099 -> 1332978 bytes libtommath/tommath_class.h | 6 +- libtommath/tommath_superclass.h | 6 +- 148 files changed, 6520 insertions(+), 856 deletions(-) create mode 100755 libtommath/libtommath_VS2005.sln create mode 100755 libtommath/libtommath_VS2005.vcproj create mode 100755 libtommath/libtommath_VS2008.sln create mode 100755 libtommath/libtommath_VS2008.vcproj diff --git a/libtommath/bn.ind b/libtommath/bn.ind index c099b52..3c3d288 100644 --- a/libtommath/bn.ind +++ b/libtommath/bn.ind @@ -1,82 +1,82 @@ \begin{theindex} - \item mp\_add, \hyperpage{31} - \item mp\_add\_d, \hyperpage{56} - \item mp\_and, \hyperpage{31} - \item mp\_clear, \hyperpage{12} - \item mp\_clear\_multi, \hyperpage{13} - \item mp\_cmp, \hyperpage{25} - \item mp\_cmp\_d, \hyperpage{26} - \item mp\_cmp\_mag, \hyperpage{23} - \item mp\_div, \hyperpage{32} - \item mp\_div\_2, \hyperpage{28} - \item mp\_div\_2d, \hyperpage{30} - \item mp\_div\_d, \hyperpage{56} - \item mp\_dr\_reduce, \hyperpage{45} - \item mp\_dr\_setup, \hyperpage{45} - \item MP\_EQ, \hyperpage{23} - \item mp\_error\_to\_string, \hyperpage{9} - \item mp\_expt\_d, \hyperpage{47} - \item mp\_exptmod, \hyperpage{47} - \item mp\_exteuclid, \hyperpage{55} - \item mp\_gcd, \hyperpage{55} - \item mp\_get\_int, \hyperpage{20} - \item mp\_grow, \hyperpage{17} - \item MP\_GT, \hyperpage{23} - \item mp\_init, \hyperpage{11} - \item mp\_init\_copy, \hyperpage{14} - \item mp\_init\_multi, \hyperpage{13} - \item mp\_init\_set, \hyperpage{21} - \item mp\_init\_set\_int, \hyperpage{21} - \item mp\_init\_size, \hyperpage{15} - \item mp\_int, \hyperpage{10} - \item mp\_invmod, \hyperpage{56} - \item mp\_jacobi, \hyperpage{56} - \item mp\_lcm, \hyperpage{56} - \item mp\_lshd, \hyperpage{30} - \item MP\_LT, \hyperpage{23} - \item MP\_MEM, \hyperpage{9} - \item mp\_mod, \hyperpage{39} - \item mp\_mod\_d, \hyperpage{56} - \item mp\_montgomery\_calc\_normalization, \hyperpage{42} - \item mp\_montgomery\_reduce, \hyperpage{42} - \item mp\_montgomery\_setup, \hyperpage{42} - \item mp\_mul, \hyperpage{33} - \item mp\_mul\_2, \hyperpage{28} - \item mp\_mul\_2d, \hyperpage{29} - \item mp\_mul\_d, \hyperpage{56} - \item mp\_n\_root, \hyperpage{48} - \item mp\_neg, \hyperpage{31, 32} - \item MP\_NO, \hyperpage{9} - \item MP\_OKAY, \hyperpage{9} - \item mp\_or, \hyperpage{31} - \item mp\_prime\_fermat, \hyperpage{49} - \item mp\_prime\_is\_divisible, \hyperpage{49} - \item mp\_prime\_is\_prime, \hyperpage{51} - \item mp\_prime\_miller\_rabin, \hyperpage{50} - \item mp\_prime\_next\_prime, \hyperpage{51} - \item mp\_prime\_rabin\_miller\_trials, \hyperpage{50} - \item mp\_prime\_random, \hyperpage{51} - \item mp\_prime\_random\_ex, \hyperpage{52} - \item mp\_radix\_size, \hyperpage{53} - \item mp\_read\_radix, \hyperpage{53} - \item mp\_read\_unsigned\_bin, \hyperpage{54} - \item mp\_reduce, \hyperpage{40} - \item mp\_reduce\_2k, \hyperpage{46} - \item mp\_reduce\_2k\_setup, \hyperpage{46} - \item mp\_reduce\_setup, \hyperpage{40} - \item mp\_rshd, \hyperpage{30} - \item mp\_set, \hyperpage{19} - \item mp\_set\_int, \hyperpage{20} - \item mp\_shrink, \hyperpage{16} - \item mp\_sqr, \hyperpage{35} - \item mp\_sub, \hyperpage{31} - \item mp\_sub\_d, \hyperpage{56} - \item mp\_to\_unsigned\_bin, \hyperpage{54} - \item mp\_toradix, \hyperpage{53} - \item mp\_unsigned\_bin\_size, \hyperpage{54} - \item MP\_VAL, \hyperpage{9} - \item mp\_xor, \hyperpage{31} - \item MP\_YES, \hyperpage{9} + \item mp\_add, \hyperpage{23} + \item mp\_add\_d, \hyperpage{44} + \item mp\_and, \hyperpage{23} + \item mp\_clear, \hyperpage{9} + \item mp\_clear\_multi, \hyperpage{10} + \item mp\_cmp, \hyperpage{19} + \item mp\_cmp\_d, \hyperpage{20} + \item mp\_cmp\_mag, \hyperpage{18} + \item mp\_div, \hyperpage{24} + \item mp\_div\_2, \hyperpage{21} + \item mp\_div\_2d, \hyperpage{22} + \item mp\_div\_d, \hyperpage{44} + \item mp\_dr\_reduce, \hyperpage{33} + \item mp\_dr\_setup, \hyperpage{33} + \item MP\_EQ, \hyperpage{18} + \item mp\_error\_to\_string, \hyperpage{7} + \item mp\_expt\_d, \hyperpage{35} + \item mp\_exptmod, \hyperpage{35} + \item mp\_exteuclid, \hyperpage{43} + \item mp\_gcd, \hyperpage{43} + \item mp\_get\_int, \hyperpage{16} + \item mp\_grow, \hyperpage{13} + \item MP\_GT, \hyperpage{18} + \item mp\_init, \hyperpage{8} + \item mp\_init\_copy, \hyperpage{10} + \item mp\_init\_multi, \hyperpage{10} + \item mp\_init\_set, \hyperpage{17} + \item mp\_init\_set\_int, \hyperpage{17} + \item mp\_init\_size, \hyperpage{11} + \item mp\_int, \hyperpage{8} + \item mp\_invmod, \hyperpage{44} + \item mp\_jacobi, \hyperpage{43} + \item mp\_lcm, \hyperpage{43} + \item mp\_lshd, \hyperpage{23} + \item MP\_LT, \hyperpage{18} + \item MP\_MEM, \hyperpage{7} + \item mp\_mod, \hyperpage{29} + \item mp\_mod\_d, \hyperpage{44} + \item mp\_montgomery\_calc\_normalization, \hyperpage{31} + \item mp\_montgomery\_reduce, \hyperpage{31} + \item mp\_montgomery\_setup, \hyperpage{31} + \item mp\_mul, \hyperpage{25} + \item mp\_mul\_2, \hyperpage{21} + \item mp\_mul\_2d, \hyperpage{22} + \item mp\_mul\_d, \hyperpage{44} + \item mp\_n\_root, \hyperpage{35} + \item mp\_neg, \hyperpage{24} + \item MP\_NO, \hyperpage{7} + \item MP\_OKAY, \hyperpage{7} + \item mp\_or, \hyperpage{23} + \item mp\_prime\_fermat, \hyperpage{37} + \item mp\_prime\_is\_divisible, \hyperpage{37} + \item mp\_prime\_is\_prime, \hyperpage{38} + \item mp\_prime\_miller\_rabin, \hyperpage{37} + \item mp\_prime\_next\_prime, \hyperpage{38} + \item mp\_prime\_rabin\_miller\_trials, \hyperpage{38} + \item mp\_prime\_random, \hyperpage{38} + \item mp\_prime\_random\_ex, \hyperpage{39} + \item mp\_radix\_size, \hyperpage{41} + \item mp\_read\_radix, \hyperpage{41} + \item mp\_read\_unsigned\_bin, \hyperpage{42} + \item mp\_reduce, \hyperpage{30} + \item mp\_reduce\_2k, \hyperpage{34} + \item mp\_reduce\_2k\_setup, \hyperpage{34} + \item mp\_reduce\_setup, \hyperpage{29} + \item mp\_rshd, \hyperpage{23} + \item mp\_set, \hyperpage{15} + \item mp\_set\_int, \hyperpage{16} + \item mp\_shrink, \hyperpage{12} + \item mp\_sqr, \hyperpage{26} + \item mp\_sub, \hyperpage{23} + \item mp\_sub\_d, \hyperpage{44} + \item mp\_to\_unsigned\_bin, \hyperpage{42} + \item mp\_toradix, \hyperpage{41} + \item mp\_unsigned\_bin\_size, \hyperpage{41} + \item MP\_VAL, \hyperpage{7} + \item mp\_xor, \hyperpage{23} + \item MP\_YES, \hyperpage{7} \end{theindex} diff --git a/libtommath/bn.pdf b/libtommath/bn.pdf index 5be7123..078628c 100644 Binary files a/libtommath/bn.pdf and b/libtommath/bn.pdf differ diff --git a/libtommath/bn.tex b/libtommath/bn.tex index 9017860..71b6840 100644 --- a/libtommath/bn.tex +++ b/libtommath/bn.tex @@ -49,7 +49,7 @@ \begin{document} \frontmatter \pagestyle{empty} -\title{LibTomMath User Manual \\ v0.41} +\title{LibTomMath User Manual \\ v0.42.0} \author{Tom St Denis \\ tomstdenis@gmail.com} \maketitle This text, the library and the accompanying textbook are all hereby placed in the public domain. This book has been diff --git a/libtommath/bn_error.c b/libtommath/bn_error.c index b1b7177..250057b 100644 --- a/libtommath/bn_error.c +++ b/libtommath/bn_error.c @@ -42,6 +42,6 @@ char *mp_error_to_string(int code) #endif -/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_mp_invmod.c b/libtommath/bn_fast_mp_invmod.c index ff03dff..948a134 100644 --- a/libtommath/bn_fast_mp_invmod.c +++ b/libtommath/bn_fast_mp_invmod.c @@ -143,6 +143,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_mp_montgomery_reduce.c b/libtommath/bn_fast_mp_montgomery_reduce.c index b6c0694..1a81689 100644 --- a/libtommath/bn_fast_mp_montgomery_reduce.c +++ b/libtommath/bn_fast_mp_montgomery_reduce.c @@ -167,6 +167,6 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_digs.c b/libtommath/bn_fast_s_mp_mul_digs.c index 91e10d6..04becfd 100644 --- a/libtommath/bn_fast_s_mp_mul_digs.c +++ b/libtommath/bn_fast_s_mp_mul_digs.c @@ -102,6 +102,6 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.8 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_s_mp_mul_high_digs.c b/libtommath/bn_fast_s_mp_mul_high_digs.c index 5b114d7..98bee37 100644 --- a/libtommath/bn_fast_s_mp_mul_high_digs.c +++ b/libtommath/bn_fast_s_mp_mul_high_digs.c @@ -93,6 +93,6 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_fast_s_mp_sqr.c b/libtommath/bn_fast_s_mp_sqr.c index 19e92ef..086b52c 100644 --- a/libtommath/bn_fast_s_mp_sqr.c +++ b/libtommath/bn_fast_s_mp_sqr.c @@ -109,6 +109,6 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_2expt.c b/libtommath/bn_mp_2expt.c index f422ffc..4774aab 100644 --- a/libtommath/bn_mp_2expt.c +++ b/libtommath/bn_mp_2expt.c @@ -43,6 +43,6 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_abs.c b/libtommath/bn_mp_abs.c index 09dd722..4d1fa44 100644 --- a/libtommath/bn_mp_abs.c +++ b/libtommath/bn_mp_abs.c @@ -38,6 +38,6 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_add.c b/libtommath/bn_mp_add.c index be20644..122c850 100644 --- a/libtommath/bn_mp_add.c +++ b/libtommath/bn_mp_add.c @@ -48,6 +48,6 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c index 8ca36c1..aec8fc8 100644 --- a/libtommath/bn_mp_add_d.c +++ b/libtommath/bn_mp_add_d.c @@ -107,6 +107,6 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_addmod.c b/libtommath/bn_mp_addmod.c index 6d8afe1..0376659 100644 --- a/libtommath/bn_mp_addmod.c +++ b/libtommath/bn_mp_addmod.c @@ -36,6 +36,6 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_and.c b/libtommath/bn_mp_and.c index 8ea2287..22dfbff 100644 --- a/libtommath/bn_mp_and.c +++ b/libtommath/bn_mp_and.c @@ -52,6 +52,6 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_clamp.c b/libtommath/bn_mp_clamp.c index 359c2ff..1e0c817 100644 --- a/libtommath/bn_mp_clamp.c +++ b/libtommath/bn_mp_clamp.c @@ -39,6 +39,6 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_clear.c b/libtommath/bn_mp_clear.c index a65f0a3..72301df 100644 --- a/libtommath/bn_mp_clear.c +++ b/libtommath/bn_mp_clear.c @@ -39,6 +39,6 @@ mp_clear (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_clear_multi.c b/libtommath/bn_mp_clear_multi.c index daaea79..6bbc10c 100644 --- a/libtommath/bn_mp_clear_multi.c +++ b/libtommath/bn_mp_clear_multi.c @@ -29,6 +29,6 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cmp.c b/libtommath/bn_mp_cmp.c index 533f36b..77d00cd 100644 --- a/libtommath/bn_mp_cmp.c +++ b/libtommath/bn_mp_cmp.c @@ -38,6 +38,6 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cmp_d.c b/libtommath/bn_mp_cmp_d.c index 724c1c3..0d5bcb4 100644 --- a/libtommath/bn_mp_cmp_d.c +++ b/libtommath/bn_mp_cmp_d.c @@ -39,6 +39,6 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cmp_mag.c b/libtommath/bn_mp_cmp_mag.c index 693eb7c..063fd18 100644 --- a/libtommath/bn_mp_cmp_mag.c +++ b/libtommath/bn_mp_cmp_mag.c @@ -50,6 +50,6 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_cnt_lsb.c b/libtommath/bn_mp_cnt_lsb.c index 66d1a74..efebd2a 100644 --- a/libtommath/bn_mp_cnt_lsb.c +++ b/libtommath/bn_mp_cnt_lsb.c @@ -48,6 +48,6 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_copy.c b/libtommath/bn_mp_copy.c index b0de16d..45cac61 100644 --- a/libtommath/bn_mp_copy.c +++ b/libtommath/bn_mp_copy.c @@ -63,6 +63,6 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_count_bits.c b/libtommath/bn_mp_count_bits.c index 8bc5657..6c02ec6 100644 --- a/libtommath/bn_mp_count_bits.c +++ b/libtommath/bn_mp_count_bits.c @@ -40,6 +40,6 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div.c b/libtommath/bn_mp_div.c index aee9c94..af5c55d 100644 --- a/libtommath/bn_mp_div.c +++ b/libtommath/bn_mp_div.c @@ -287,6 +287,6 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_2.c b/libtommath/bn_mp_div_2.c index 7ee3e5b..64ef823 100644 --- a/libtommath/bn_mp_div_2.c +++ b/libtommath/bn_mp_div_2.c @@ -63,6 +63,6 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_2d.c b/libtommath/bn_mp_div_2d.c index 4f7fa59..72936a4 100644 --- a/libtommath/bn_mp_div_2d.c +++ b/libtommath/bn_mp_div_2d.c @@ -92,6 +92,6 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_3.c b/libtommath/bn_mp_div_3.c index 3c60269..7f6869b 100644 --- a/libtommath/bn_mp_div_3.c +++ b/libtommath/bn_mp_div_3.c @@ -74,6 +74,6 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c index 6a26d4f..ca34e87 100644 --- a/libtommath/bn_mp_div_d.c +++ b/libtommath/bn_mp_div_d.c @@ -110,6 +110,6 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2007/01/09 04:44:32 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_dr_is_modulus.c b/libtommath/bn_mp_dr_is_modulus.c index 5237344..52b4fdf 100644 --- a/libtommath/bn_mp_dr_is_modulus.c +++ b/libtommath/bn_mp_dr_is_modulus.c @@ -38,6 +38,6 @@ int mp_dr_is_modulus(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_is_modulus.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_dr_reduce.c b/libtommath/bn_mp_dr_reduce.c index e60b578..47f0c60 100644 --- a/libtommath/bn_mp_dr_reduce.c +++ b/libtommath/bn_mp_dr_reduce.c @@ -89,6 +89,6 @@ top: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_dr_setup.c b/libtommath/bn_mp_dr_setup.c index 1d7d856..99ee67d 100644 --- a/libtommath/bn_mp_dr_setup.c +++ b/libtommath/bn_mp_dr_setup.c @@ -27,6 +27,6 @@ void mp_dr_setup(mp_int *a, mp_digit *d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exch.c b/libtommath/bn_mp_exch.c index 38574e0..dd3098e 100644 --- a/libtommath/bn_mp_exch.c +++ b/libtommath/bn_mp_exch.c @@ -29,6 +29,6 @@ mp_exch (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_expt_d.c b/libtommath/bn_mp_expt_d.c index 4bdc2d1..f9357cc 100644 --- a/libtommath/bn_mp_expt_d.c +++ b/libtommath/bn_mp_expt_d.c @@ -52,6 +52,6 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_expt_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exptmod.c b/libtommath/bn_mp_exptmod.c index 0231916..8fbce19 100644 --- a/libtommath/bn_mp_exptmod.c +++ b/libtommath/bn_mp_exptmod.c @@ -107,6 +107,6 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exptmod_fast.c b/libtommath/bn_mp_exptmod_fast.c index 2a3b3c9..60c7e2b 100644 --- a/libtommath/bn_mp_exptmod_fast.c +++ b/libtommath/bn_mp_exptmod_fast.c @@ -316,6 +316,6 @@ LBL_M: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod_fast.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_exteuclid.c b/libtommath/bn_mp_exteuclid.c index e6c4ce2..c65928d 100644 --- a/libtommath/bn_mp_exteuclid.c +++ b/libtommath/bn_mp_exteuclid.c @@ -77,6 +77,6 @@ _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exteuclid.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_fread.c b/libtommath/bn_mp_fread.c index b344b6f..a2e51a1 100644 --- a/libtommath/bn_mp_fread.c +++ b/libtommath/bn_mp_fread.c @@ -62,6 +62,6 @@ int mp_fread(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fread.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_fwrite.c b/libtommath/bn_mp_fwrite.c index a0b4c6b..b3fd834 100644 --- a/libtommath/bn_mp_fwrite.c +++ b/libtommath/bn_mp_fwrite.c @@ -47,6 +47,6 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fwrite.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_gcd.c b/libtommath/bn_mp_gcd.c index b39ba90..b45cfed 100644 --- a/libtommath/bn_mp_gcd.c +++ b/libtommath/bn_mp_gcd.c @@ -100,6 +100,6 @@ LBL_U:mp_clear (&v); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_get_int.c b/libtommath/bn_mp_get_int.c index 17162e2..11baa0e 100644 --- a/libtommath/bn_mp_get_int.c +++ b/libtommath/bn_mp_get_int.c @@ -40,6 +40,6 @@ unsigned long mp_get_int(mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_get_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_grow.c b/libtommath/bn_mp_grow.c index cf2b949..f1c1cab 100644 --- a/libtommath/bn_mp_grow.c +++ b/libtommath/bn_mp_grow.c @@ -52,6 +52,6 @@ int mp_grow (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_grow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init.c b/libtommath/bn_mp_init.c index 8be27f5..79cca3c 100644 --- a/libtommath/bn_mp_init.c +++ b/libtommath/bn_mp_init.c @@ -41,6 +41,6 @@ int mp_init (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_copy.c b/libtommath/bn_mp_init_copy.c index 0160811..8ce0ef9 100644 --- a/libtommath/bn_mp_init_copy.c +++ b/libtommath/bn_mp_init_copy.c @@ -27,6 +27,6 @@ int mp_init_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_multi.c b/libtommath/bn_mp_init_multi.c index 59dc3a9..a40ea8e 100644 --- a/libtommath/bn_mp_init_multi.c +++ b/libtommath/bn_mp_init_multi.c @@ -54,6 +54,6 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_set.c b/libtommath/bn_mp_init_set.c index 34edad9..f9b08e9 100644 --- a/libtommath/bn_mp_init_set.c +++ b/libtommath/bn_mp_init_set.c @@ -27,6 +27,6 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_set_int.c b/libtommath/bn_mp_init_set_int.c index 5c55993..9473c3f 100644 --- a/libtommath/bn_mp_init_set_int.c +++ b/libtommath/bn_mp_init_set_int.c @@ -26,6 +26,6 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_init_size.c b/libtommath/bn_mp_init_size.c index 8e01418..69dd49c 100644 --- a/libtommath/bn_mp_init_size.c +++ b/libtommath/bn_mp_init_size.c @@ -43,6 +43,6 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_invmod.c b/libtommath/bn_mp_invmod.c index 1546514..f4bdc17 100644 --- a/libtommath/bn_mp_invmod.c +++ b/libtommath/bn_mp_invmod.c @@ -38,6 +38,6 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_invmod_slow.c b/libtommath/bn_mp_invmod_slow.c index eedd47d..2430f02 100644 --- a/libtommath/bn_mp_invmod_slow.c +++ b/libtommath/bn_mp_invmod_slow.c @@ -170,6 +170,6 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_is_square.c b/libtommath/bn_mp_is_square.c index 50c5244..12b9ec7 100644 --- a/libtommath/bn_mp_is_square.c +++ b/libtommath/bn_mp_is_square.c @@ -104,6 +104,6 @@ ERR:mp_clear(&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_jacobi.c b/libtommath/bn_mp_jacobi.c index 91cfeea..07a9d65 100644 --- a/libtommath/bn_mp_jacobi.c +++ b/libtommath/bn_mp_jacobi.c @@ -100,6 +100,6 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_karatsuba_mul.c b/libtommath/bn_mp_karatsuba_mul.c index 8ea2c27..62e885c 100644 --- a/libtommath/bn_mp_karatsuba_mul.c +++ b/libtommath/bn_mp_karatsuba_mul.c @@ -162,6 +162,6 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_karatsuba_sqr.c b/libtommath/bn_mp_karatsuba_sqr.c index a5e198b..ce5c753 100644 --- a/libtommath/bn_mp_karatsuba_sqr.c +++ b/libtommath/bn_mp_karatsuba_sqr.c @@ -116,6 +116,6 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_lcm.c b/libtommath/bn_mp_lcm.c index 781eef5..a4115da 100644 --- a/libtommath/bn_mp_lcm.c +++ b/libtommath/bn_mp_lcm.c @@ -55,6 +55,6 @@ LBL_T: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_lshd.c b/libtommath/bn_mp_lshd.c index f118cf1..87c216b 100644 --- a/libtommath/bn_mp_lshd.c +++ b/libtommath/bn_mp_lshd.c @@ -62,6 +62,6 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mod.c b/libtommath/bn_mp_mod.c index f5cf8d0..6828328 100644 --- a/libtommath/bn_mp_mod.c +++ b/libtommath/bn_mp_mod.c @@ -43,6 +43,6 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mod_2d.c b/libtommath/bn_mp_mod_2d.c index e194a06..77f13c3 100644 --- a/libtommath/bn_mp_mod_2d.c +++ b/libtommath/bn_mp_mod_2d.c @@ -50,6 +50,6 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mod_d.c b/libtommath/bn_mp_mod_d.c index 9ca37e6..4ad3d90 100644 --- a/libtommath/bn_mp_mod_d.c +++ b/libtommath/bn_mp_mod_d.c @@ -22,6 +22,6 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_montgomery_calc_normalization.c b/libtommath/bn_mp_montgomery_calc_normalization.c index c669fe0..4825ab5 100644 --- a/libtommath/bn_mp_montgomery_calc_normalization.c +++ b/libtommath/bn_mp_montgomery_calc_normalization.c @@ -54,6 +54,6 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_montgomery_reduce.c b/libtommath/bn_mp_montgomery_reduce.c index b765090..3c73268 100644 --- a/libtommath/bn_mp_montgomery_reduce.c +++ b/libtommath/bn_mp_montgomery_reduce.c @@ -113,6 +113,6 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_montgomery_setup.c b/libtommath/bn_mp_montgomery_setup.c index f082749..0de27bb 100644 --- a/libtommath/bn_mp_montgomery_setup.c +++ b/libtommath/bn_mp_montgomery_setup.c @@ -54,6 +54,6 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul.c b/libtommath/bn_mp_mul.c index 8b1117a..bd75d04 100644 --- a/libtommath/bn_mp_mul.c +++ b/libtommath/bn_mp_mul.c @@ -61,6 +61,6 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul_2.c b/libtommath/bn_mp_mul_2.c index 02455fc..6ba76be 100644 --- a/libtommath/bn_mp_mul_2.c +++ b/libtommath/bn_mp_mul_2.c @@ -77,6 +77,6 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul_2d.c b/libtommath/bn_mp_mul_2d.c index efeff2e..385ac59 100644 --- a/libtommath/bn_mp_mul_2d.c +++ b/libtommath/bn_mp_mul_2d.c @@ -80,6 +80,6 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mul_d.c b/libtommath/bn_mp_mul_d.c index 00f9a89..13c6066 100644 --- a/libtommath/bn_mp_mul_d.c +++ b/libtommath/bn_mp_mul_d.c @@ -74,6 +74,6 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_mulmod.c b/libtommath/bn_mp_mulmod.c index 003ceb9..eebca37 100644 --- a/libtommath/bn_mp_mulmod.c +++ b/libtommath/bn_mp_mulmod.c @@ -35,6 +35,6 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_n_root.c b/libtommath/bn_mp_n_root.c index 0e7bedc..e6bf725 100644 --- a/libtommath/bn_mp_n_root.c +++ b/libtommath/bn_mp_n_root.c @@ -127,6 +127,6 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_neg.c b/libtommath/bn_mp_neg.c index a7d035a..0e868ce 100644 --- a/libtommath/bn_mp_neg.c +++ b/libtommath/bn_mp_neg.c @@ -35,6 +35,6 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_or.c b/libtommath/bn_mp_or.c index bff4995..5c2761a 100644 --- a/libtommath/bn_mp_or.c +++ b/libtommath/bn_mp_or.c @@ -45,6 +45,6 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_fermat.c b/libtommath/bn_mp_prime_fermat.c index c23d77f..fe10ab2 100644 --- a/libtommath/bn_mp_prime_fermat.c +++ b/libtommath/bn_mp_prime_fermat.c @@ -57,6 +57,6 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_is_divisible.c b/libtommath/bn_mp_prime_is_divisible.c index 8e7871c..2b217ae 100644 --- a/libtommath/bn_mp_prime_is_divisible.c +++ b/libtommath/bn_mp_prime_is_divisible.c @@ -45,6 +45,6 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_is_prime.c b/libtommath/bn_mp_prime_is_prime.c index c316d62..09908df 100644 --- a/libtommath/bn_mp_prime_is_prime.c +++ b/libtommath/bn_mp_prime_is_prime.c @@ -78,6 +78,6 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_miller_rabin.c b/libtommath/bn_mp_prime_miller_rabin.c index ddf0358..fe88d94 100644 --- a/libtommath/bn_mp_prime_miller_rabin.c +++ b/libtommath/bn_mp_prime_miller_rabin.c @@ -98,6 +98,6 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_next_prime.c b/libtommath/bn_mp_prime_next_prime.c index daf2ec7..37a03c6 100644 --- a/libtommath/bn_mp_prime_next_prime.c +++ b/libtommath/bn_mp_prime_next_prime.c @@ -143,7 +143,7 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style) /* is this prime? */ for (x = 0; x < t; x++) { - mp_set(&b, ltm_prime_tab[t]); + mp_set(&b, ltm_prime_tab[x]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_ERR; } @@ -165,6 +165,6 @@ LBL_ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-07-15 13:49:00 +0000 $ */ diff --git a/libtommath/bn_mp_prime_rabin_miller_trials.c b/libtommath/bn_mp_prime_rabin_miller_trials.c index 248c2fd..b4fc323 100644 --- a/libtommath/bn_mp_prime_rabin_miller_trials.c +++ b/libtommath/bn_mp_prime_rabin_miller_trials.c @@ -47,6 +47,6 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_prime_random_ex.c b/libtommath/bn_mp_prime_random_ex.c index 07aae4b..16d2aae 100644 --- a/libtommath/bn_mp_prime_random_ex.c +++ b/libtommath/bn_mp_prime_random_ex.c @@ -120,6 +120,6 @@ error: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_radix_size.c b/libtommath/bn_mp_radix_size.c index 1b61e3a..9d95c48 100644 --- a/libtommath/bn_mp_radix_size.c +++ b/libtommath/bn_mp_radix_size.c @@ -73,6 +73,6 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_radix_smap.c b/libtommath/bn_mp_radix_smap.c index 7d72feb..b3abd3e 100644 --- a/libtommath/bn_mp_radix_smap.c +++ b/libtommath/bn_mp_radix_smap.c @@ -19,6 +19,6 @@ const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_rand.c b/libtommath/bn_mp_rand.c index af66a67..96e4e46 100644 --- a/libtommath/bn_mp_rand.c +++ b/libtommath/bn_mp_rand.c @@ -50,6 +50,6 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_read_radix.c b/libtommath/bn_mp_read_radix.c index 91c46c2..8ce103f 100644 --- a/libtommath/bn_mp_read_radix.c +++ b/libtommath/bn_mp_read_radix.c @@ -80,6 +80,6 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_read_signed_bin.c b/libtommath/bn_mp_read_signed_bin.c index 8da651c..92924e8 100644 --- a/libtommath/bn_mp_read_signed_bin.c +++ b/libtommath/bn_mp_read_signed_bin.c @@ -36,6 +36,6 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_read_unsigned_bin.c b/libtommath/bn_mp_read_unsigned_bin.c index 1ebba13..5a7fa91 100644 --- a/libtommath/bn_mp_read_unsigned_bin.c +++ b/libtommath/bn_mp_read_unsigned_bin.c @@ -50,6 +50,6 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce.c b/libtommath/bn_mp_reduce.c index 21d0730..50e1eaa 100644 --- a/libtommath/bn_mp_reduce.c +++ b/libtommath/bn_mp_reduce.c @@ -95,6 +95,6 @@ CLEANUP: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k.c b/libtommath/bn_mp_reduce_2k.c index d9620c2..6bbc5f1 100644 --- a/libtommath/bn_mp_reduce_2k.c +++ b/libtommath/bn_mp_reduce_2k.c @@ -56,6 +56,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k_l.c b/libtommath/bn_mp_reduce_2k_l.c index f06103d..067122a 100644 --- a/libtommath/bn_mp_reduce_2k_l.c +++ b/libtommath/bn_mp_reduce_2k_l.c @@ -57,6 +57,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup.c b/libtommath/bn_mp_reduce_2k_setup.c index a80e7a2..3f9ffd9 100644 --- a/libtommath/bn_mp_reduce_2k_setup.c +++ b/libtommath/bn_mp_reduce_2k_setup.c @@ -42,6 +42,6 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_2k_setup_l.c b/libtommath/bn_mp_reduce_2k_setup_l.c index 7cf002e..686368e 100644 --- a/libtommath/bn_mp_reduce_2k_setup_l.c +++ b/libtommath/bn_mp_reduce_2k_setup_l.c @@ -39,6 +39,6 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k.c b/libtommath/bn_mp_reduce_is_2k.c index 7308be7..08b62ff 100644 --- a/libtommath/bn_mp_reduce_is_2k.c +++ b/libtommath/bn_mp_reduce_is_2k.c @@ -47,6 +47,6 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_is_2k_l.c b/libtommath/bn_mp_reduce_is_2k_l.c index 14a4d21..a72e39c 100644 --- a/libtommath/bn_mp_reduce_is_2k_l.c +++ b/libtommath/bn_mp_reduce_is_2k_l.c @@ -39,6 +39,6 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_reduce_setup.c b/libtommath/bn_mp_reduce_setup.c index 370f20b..f017386 100644 --- a/libtommath/bn_mp_reduce_setup.c +++ b/libtommath/bn_mp_reduce_setup.c @@ -29,6 +29,6 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_rshd.c b/libtommath/bn_mp_rshd.c index 2a693c5..bb506e9 100644 --- a/libtommath/bn_mp_rshd.c +++ b/libtommath/bn_mp_rshd.c @@ -67,6 +67,6 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_set.c b/libtommath/bn_mp_set.c index 174adcb..412673a 100644 --- a/libtommath/bn_mp_set.c +++ b/libtommath/bn_mp_set.c @@ -24,6 +24,6 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_set_int.c b/libtommath/bn_mp_set_int.c index cf10ea1..17cfe89 100644 --- a/libtommath/bn_mp_set_int.c +++ b/libtommath/bn_mp_set_int.c @@ -43,6 +43,6 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_shrink.c b/libtommath/bn_mp_shrink.c index 4b8c5ef..2bee381 100644 --- a/libtommath/bn_mp_shrink.c +++ b/libtommath/bn_mp_shrink.c @@ -19,17 +19,22 @@ int mp_shrink (mp_int * a) { mp_digit *tmp; - if (a->alloc != a->used && a->used > 0) { - if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { + int used = 1; + + if(a->used > 0) + used = a->used; + + if (a->alloc != used) { + if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) { return MP_MEM; } a->dp = tmp; - a->alloc = a->used; + a->alloc = used; } return MP_OKAY; } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-06-02 15:09:36 +0200 $ */ diff --git a/libtommath/bn_mp_signed_bin_size.c b/libtommath/bn_mp_signed_bin_size.c index 6739d19..b28d402 100644 --- a/libtommath/bn_mp_signed_bin_size.c +++ b/libtommath/bn_mp_signed_bin_size.c @@ -22,6 +22,6 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sqr.c b/libtommath/bn_mp_sqr.c index 868ccbb..b085668 100644 --- a/libtommath/bn_mp_sqr.c +++ b/libtommath/bn_mp_sqr.c @@ -53,6 +53,6 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sqrmod.c b/libtommath/bn_mp_sqrmod.c index 161cbbb..369028b 100644 --- a/libtommath/bn_mp_sqrmod.c +++ b/libtommath/bn_mp_sqrmod.c @@ -36,6 +36,6 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sqrt.c b/libtommath/bn_mp_sqrt.c index 8fd057c..983e41c 100644 --- a/libtommath/bn_mp_sqrt.c +++ b/libtommath/bn_mp_sqrt.c @@ -76,6 +76,6 @@ E2: mp_clear(&t1); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sub.c b/libtommath/bn_mp_sub.c index f5015cc..3c8e5d4 100644 --- a/libtommath/bn_mp_sub.c +++ b/libtommath/bn_mp_sub.c @@ -54,6 +54,6 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_sub_d.c b/libtommath/bn_mp_sub_d.c index 06cdca6..13b49bc 100644 --- a/libtommath/bn_mp_sub_d.c +++ b/libtommath/bn_mp_sub_d.c @@ -88,6 +88,6 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_submod.c b/libtommath/bn_mp_submod.c index 869e23c..d919c17 100644 --- a/libtommath/bn_mp_submod.c +++ b/libtommath/bn_mp_submod.c @@ -37,6 +37,6 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_signed_bin.c b/libtommath/bn_mp_to_signed_bin.c index 9df83ca..dda9285 100644 --- a/libtommath/bn_mp_to_signed_bin.c +++ b/libtommath/bn_mp_to_signed_bin.c @@ -28,6 +28,6 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_signed_bin_n.c b/libtommath/bn_mp_to_signed_bin_n.c index 677f827..9e3b011 100644 --- a/libtommath/bn_mp_to_signed_bin_n.c +++ b/libtommath/bn_mp_to_signed_bin_n.c @@ -26,6 +26,6 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin.c b/libtommath/bn_mp_to_unsigned_bin.c index c137f10..76072a9 100644 --- a/libtommath/bn_mp_to_unsigned_bin.c +++ b/libtommath/bn_mp_to_unsigned_bin.c @@ -43,6 +43,6 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_to_unsigned_bin_n.c b/libtommath/bn_mp_to_unsigned_bin_n.c index 0dc00c6..51028d8 100644 --- a/libtommath/bn_mp_to_unsigned_bin_n.c +++ b/libtommath/bn_mp_to_unsigned_bin_n.c @@ -26,6 +26,6 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toom_mul.c b/libtommath/bn_mp_toom_mul.c index ad5d9e9..e0fd772 100644 --- a/libtommath/bn_mp_toom_mul.c +++ b/libtommath/bn_mp_toom_mul.c @@ -279,6 +279,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toom_sqr.c b/libtommath/bn_mp_toom_sqr.c index 48880d0..9076e6f 100644 --- a/libtommath/bn_mp_toom_sqr.c +++ b/libtommath/bn_mp_toom_sqr.c @@ -221,6 +221,6 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toradix.c b/libtommath/bn_mp_toradix.c index 0adc28d..bb95783 100644 --- a/libtommath/bn_mp_toradix.c +++ b/libtommath/bn_mp_toradix.c @@ -70,6 +70,6 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_toradix_n.c b/libtommath/bn_mp_toradix_n.c index 796ed55..7e425d6 100644 --- a/libtommath/bn_mp_toradix_n.c +++ b/libtommath/bn_mp_toradix_n.c @@ -83,6 +83,6 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_unsigned_bin_size.c b/libtommath/bn_mp_unsigned_bin_size.c index 6dc3bd5..b16fdcd 100644 --- a/libtommath/bn_mp_unsigned_bin_size.c +++ b/libtommath/bn_mp_unsigned_bin_size.c @@ -23,6 +23,6 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_xor.c b/libtommath/bn_mp_xor.c index 59ff2e1..5744556 100644 --- a/libtommath/bn_mp_xor.c +++ b/libtommath/bn_mp_xor.c @@ -46,6 +46,6 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_mp_zero.c b/libtommath/bn_mp_zero.c index b0977d4..99e6df2 100644 --- a/libtommath/bn_mp_zero.c +++ b/libtommath/bn_mp_zero.c @@ -31,6 +31,6 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_prime_tab.c b/libtommath/bn_prime_tab.c index bd25247..fb5ad08 100644 --- a/libtommath/bn_prime_tab.c +++ b/libtommath/bn_prime_tab.c @@ -56,6 +56,6 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_reverse.c b/libtommath/bn_reverse.c index ddfa827..17cdcc1 100644 --- a/libtommath/bn_reverse.c +++ b/libtommath/bn_reverse.c @@ -34,6 +34,6 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_add.c b/libtommath/bn_s_mp_add.c index f034ae6..0ca20b8 100644 --- a/libtommath/bn_s_mp_add.c +++ b/libtommath/bn_s_mp_add.c @@ -104,6 +104,6 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_exptmod.c b/libtommath/bn_s_mp_exptmod.c index 097d894..bc02a28 100644 --- a/libtommath/bn_s_mp_exptmod.c +++ b/libtommath/bn_s_mp_exptmod.c @@ -247,6 +247,6 @@ LBL_M: } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_mul_digs.c b/libtommath/bn_s_mp_mul_digs.c index f5bbf39..86196bf 100644 --- a/libtommath/bn_s_mp_mul_digs.c +++ b/libtommath/bn_s_mp_mul_digs.c @@ -85,6 +85,6 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_mul_high_digs.c b/libtommath/bn_s_mp_mul_high_digs.c index 2b718f2..019014e 100644 --- a/libtommath/bn_s_mp_mul_high_digs.c +++ b/libtommath/bn_s_mp_mul_high_digs.c @@ -76,6 +76,6 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_sqr.c b/libtommath/bn_s_mp_sqr.c index d2531c2..90c465d 100644 --- a/libtommath/bn_s_mp_sqr.c +++ b/libtommath/bn_s_mp_sqr.c @@ -79,6 +79,6 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bn_s_mp_sub.c b/libtommath/bn_s_mp_sub.c index 6a60c39..ccea6bd 100644 --- a/libtommath/bn_s_mp_sub.c +++ b/libtommath/bn_s_mp_sub.c @@ -84,6 +84,6 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/bncore.c b/libtommath/bncore.c index 8fb1824..1a0ac2c 100644 --- a/libtommath/bncore.c +++ b/libtommath/bncore.c @@ -31,6 +31,6 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ diff --git a/libtommath/changes.txt b/libtommath/changes.txt index b0da4da..4fc0913 100644 --- a/libtommath/changes.txt +++ b/libtommath/changes.txt @@ -1,3 +1,9 @@ +July 23rd, 2010 +v0.42.0 + -- Fix for mp_prime_next_prime() bug when checking generated prime + -- allow mp_shrink to shrink initialized, but empty MPI's + -- Added project and solution files for Visual Studio 2005 and Visual Studio 2008. + March 10th, 2007 v0.41 -- Wolfgang Ehrhardt suggested a quick fix to mp_div_d() which makes the detection of powers of two quicker. -- [CRI] Added libtommath.dsp for Visual C++ users. diff --git a/libtommath/demo/demo.c b/libtommath/demo/demo.c index bb5eb44..3e5663b 100644 --- a/libtommath/demo/demo.c +++ b/libtommath/demo/demo.c @@ -735,6 +735,6 @@ printf("compare no compare!\n"); exit(EXIT_FAILURE); } return 0; } -/* $Source: /cvs/libtom/libtommath/demo/demo.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2005/06/24 11:32:07 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/demo/timing.c b/libtommath/demo/timing.c index d4660a9..57bb6d4 100644 --- a/libtommath/demo/timing.c +++ b/libtommath/demo/timing.c @@ -314,6 +314,6 @@ int main(void) return 0; } -/* $Source: /cvs/libtom/libtommath/demo/timing.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/2kprime.c b/libtommath/etc/2kprime.c index c09818f..fff4825 100644 --- a/libtommath/etc/2kprime.c +++ b/libtommath/etc/2kprime.c @@ -79,6 +79,6 @@ int main(void) -/* $Source: /cvs/libtom/libtommath/etc/2kprime.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/drprime.c b/libtommath/etc/drprime.c index e413985..ea40bd3 100644 --- a/libtommath/etc/drprime.c +++ b/libtommath/etc/drprime.c @@ -59,6 +59,6 @@ int main(void) } -/* $Source: /cvs/libtom/libtommath/etc/drprime.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/mersenne.c b/libtommath/etc/mersenne.c index 6a6497a..6f9eed2 100644 --- a/libtommath/etc/mersenne.c +++ b/libtommath/etc/mersenne.c @@ -139,6 +139,6 @@ main (void) return 0; } -/* $Source: /cvs/libtom/libtommath/etc/mersenne.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2006/03/31 14:18:47 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/etc/mont.c b/libtommath/etc/mont.c index 393be4c..8356903 100644 --- a/libtommath/etc/mont.c +++ b/libtommath/etc/mont.c @@ -45,6 +45,6 @@ int main(void) -/* $Source: /cvs/libtom/libtommath/etc/mont.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/etc/pprime.c b/libtommath/etc/pprime.c index 317e2a0..d2d3a32 100644 --- a/libtommath/etc/pprime.c +++ b/libtommath/etc/pprime.c @@ -395,6 +395,6 @@ main (void) return 0; } -/* $Source: /cvs/libtom/libtommath/etc/pprime.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2006/03/31 14:18:47 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/etc/tune.c b/libtommath/etc/tune.c index d4a502c..0094f19 100644 --- a/libtommath/etc/tune.c +++ b/libtommath/etc/tune.c @@ -137,6 +137,6 @@ main (void) return 0; } -/* $Source: /cvs/libtom/libtommath/etc/tune.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2006/03/31 14:18:47 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/libtommath_VS2005.sln b/libtommath/libtommath_VS2005.sln new file mode 100755 index 0000000..21bc915 --- /dev/null +++ b/libtommath/libtommath_VS2005.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath_VS2005.vcproj", "{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Debug|Win32.ActiveCfg = Debug|Win32 + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Debug|Win32.Build.0 = Debug|Win32 + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Release|Win32.ActiveCfg = Release|Win32 + {0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libtommath/libtommath_VS2005.vcproj b/libtommath/libtommath_VS2005.vcproj new file mode 100755 index 0000000..7162185 --- /dev/null +++ b/libtommath/libtommath_VS2005.vcproj @@ -0,0 +1,2803 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libtommath/libtommath_VS2008.sln b/libtommath/libtommath_VS2008.sln new file mode 100755 index 0000000..1327ccf --- /dev/null +++ b/libtommath/libtommath_VS2008.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.ActiveCfg = Debug|Win32 + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.Build.0 = Debug|Win32 + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.ActiveCfg = Release|Win32 + {42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libtommath/libtommath_VS2008.vcproj b/libtommath/libtommath_VS2008.vcproj new file mode 100755 index 0000000..205aec1 --- /dev/null +++ b/libtommath/libtommath_VS2008.vcproj @@ -0,0 +1,2805 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libtommath/makefile b/libtommath/makefile index 3e254d4..70de306 100644 --- a/libtommath/makefile +++ b/libtommath/makefile @@ -3,7 +3,7 @@ #Tom St Denis #version of library -VERSION=0.41 +VERSION=0.42.0 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare diff --git a/libtommath/mtest/logtab.h b/libtommath/mtest/logtab.h index bbefaef..04c1ad3 100644 --- a/libtommath/mtest/logtab.h +++ b/libtommath/mtest/logtab.h @@ -19,6 +19,6 @@ const float s_logv_2[] = { }; -/* $Source: /cvs/libtom/libtommath/mtest/logtab.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi-config.h b/libtommath/mtest/mpi-config.h index 6049c25..21e72b2 100644 --- a/libtommath/mtest/mpi-config.h +++ b/libtommath/mtest/mpi-config.h @@ -1,5 +1,5 @@ /* Default configuration for MPI library */ -/* $Id: mpi-config.h,v 1.2 2005/05/05 14:38:47 tom Exp $ */ +/* $ID$ */ #ifndef MPI_CONFIG_H_ #define MPI_CONFIG_H_ @@ -85,6 +85,6 @@ /* crc==3287762869, version==2, Sat Feb 02 06:43:53 2002 */ -/* $Source: /cvs/libtom/libtommath/mtest/mpi-config.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi-types.h b/libtommath/mtest/mpi-types.h index 026de58..a90f11e 100644 --- a/libtommath/mtest/mpi-types.h +++ b/libtommath/mtest/mpi-types.h @@ -15,6 +15,6 @@ typedef int mp_err; #define RADIX (MP_DIGIT_MAX+1) -/* $Source: /cvs/libtom/libtommath/mtest/mpi-types.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi.c b/libtommath/mtest/mpi.c index 7c712dd..f6ef8c7 100644 --- a/libtommath/mtest/mpi.c +++ b/libtommath/mtest/mpi.c @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.c,v 1.2 2005/05/05 14:38:47 tom Exp $ + $ID$ */ #include "mpi.h" @@ -3980,6 +3980,6 @@ int s_mp_outlen(int bits, int r) /* HERE THERE BE DRAGONS */ /* crc==4242132123, version==2, Sat Feb 02 06:43:52 2002 */ -/* $Source: /cvs/libtom/libtommath/mtest/mpi.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mpi.h b/libtommath/mtest/mpi.h index 66ae873..526c3fd 100644 --- a/libtommath/mtest/mpi.h +++ b/libtommath/mtest/mpi.h @@ -6,7 +6,7 @@ Arbitrary precision integer arithmetic library - $Id: mpi.h,v 1.2 2005/05/05 14:38:47 tom Exp $ + $ID$ */ #ifndef _H_MPI_ @@ -226,6 +226,6 @@ const char *mp_strerror(mp_err ec); #endif /* end _H_MPI_ */ -/* $Source: /cvs/libtom/libtommath/mtest/mpi.h,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/mtest/mtest.c b/libtommath/mtest/mtest.c index bdfe612..92f03ad 100644 --- a/libtommath/mtest/mtest.c +++ b/libtommath/mtest/mtest.c @@ -303,6 +303,6 @@ int main(void) return 0; } -/* $Source: /cvs/libtom/libtommath/mtest/mtest.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2005/05/05 14:38:47 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/poster.pdf b/libtommath/poster.pdf index f3768d7..dc80fbb 100644 Binary files a/libtommath/poster.pdf and b/libtommath/poster.pdf differ diff --git a/libtommath/pre_gen/mpi.c b/libtommath/pre_gen/mpi.c index b7f4d47..7ba9d83 100644 --- a/libtommath/pre_gen/mpi.c +++ b/libtommath/pre_gen/mpi.c @@ -43,9 +43,9 @@ char *mp_error_to_string(int code) #endif -/* $Source: /cvs/libtom/libtommath/bn_error.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_error.c */ @@ -195,9 +195,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_mp_invmod.c */ @@ -371,9 +371,9 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_mp_montgomery_reduce.c */ @@ -482,9 +482,9 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.8 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_s_mp_mul_digs.c */ @@ -584,9 +584,9 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_s_mp_mul_high_digs.c */ @@ -702,9 +702,9 @@ int fast_s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_fast_s_mp_sqr.c */ @@ -754,9 +754,9 @@ mp_2expt (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_2expt.c */ @@ -801,9 +801,9 @@ mp_abs (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_abs.c */ @@ -858,9 +858,9 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_add.c */ @@ -974,9 +974,9 @@ mp_add_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_add_d.c */ @@ -1019,9 +1019,9 @@ mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_addmod.c */ @@ -1080,9 +1080,9 @@ mp_and (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_and.c */ @@ -1128,9 +1128,9 @@ mp_clamp (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_clamp.c */ @@ -1176,9 +1176,9 @@ mp_clear (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_clear.c */ @@ -1214,9 +1214,9 @@ void mp_clear_multi(mp_int *mp, ...) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_clear_multi.c */ @@ -1261,9 +1261,9 @@ mp_cmp (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cmp.c */ @@ -1309,9 +1309,9 @@ int mp_cmp_d(mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cmp_d.c */ @@ -1368,9 +1368,9 @@ int mp_cmp_mag (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cmp_mag.c */ @@ -1425,9 +1425,9 @@ int mp_cnt_lsb(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_cnt_lsb.c */ @@ -1497,9 +1497,9 @@ mp_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_copy.c */ @@ -1546,9 +1546,9 @@ mp_count_bits (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_count_bits.c */ @@ -1842,9 +1842,9 @@ LBL_Q:mp_clear (&q); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div.c */ @@ -1914,9 +1914,9 @@ int mp_div_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_2.c */ @@ -2015,9 +2015,9 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_2d.c */ @@ -2098,9 +2098,9 @@ mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_3.c */ @@ -2217,9 +2217,9 @@ int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_div_d.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2007/01/09 04:44:32 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_div_d.c */ @@ -2264,9 +2264,9 @@ int mp_dr_is_modulus(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_is_modulus.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_dr_is_modulus.c */ @@ -2362,9 +2362,9 @@ top: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_dr_reduce.c */ @@ -2398,9 +2398,9 @@ void mp_dr_setup(mp_int *a, mp_digit *d) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_dr_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_dr_setup.c */ @@ -2436,9 +2436,9 @@ mp_exch (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exch.c */ @@ -2497,9 +2497,9 @@ int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_expt_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_expt_d.c */ @@ -2613,9 +2613,9 @@ int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exptmod.c */ @@ -2938,9 +2938,9 @@ LBL_M: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod_fast.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exptmod_fast.c */ @@ -3024,9 +3024,9 @@ _ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_exteuclid.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_exteuclid.c */ @@ -3095,9 +3095,9 @@ int mp_fread(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fread.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_fread.c */ @@ -3151,9 +3151,9 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_fwrite.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_fwrite.c */ @@ -3260,9 +3260,9 @@ LBL_U:mp_clear (&v); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_gcd.c */ @@ -3309,9 +3309,9 @@ unsigned long mp_get_int(mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_get_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_get_int.c */ @@ -3370,9 +3370,9 @@ int mp_grow (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_grow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_grow.c */ @@ -3420,9 +3420,9 @@ int mp_init (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init.c */ @@ -3456,9 +3456,9 @@ int mp_init_copy (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_copy.c */ @@ -3519,9 +3519,9 @@ int mp_init_multi(mp_int *mp, ...) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_multi.c */ @@ -3555,9 +3555,9 @@ int mp_init_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_set.c */ @@ -3590,9 +3590,9 @@ int mp_init_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_set_int.c */ @@ -3642,9 +3642,9 @@ int mp_init_size (mp_int * a, int size) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_init_size.c */ @@ -3689,9 +3689,9 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_invmod.c */ @@ -3868,9 +3868,9 @@ LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_invmod_slow.c */ @@ -3981,9 +3981,9 @@ ERR:mp_clear(&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_is_square.c */ @@ -4090,9 +4090,9 @@ LBL_A1:mp_clear (&a1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_jacobi.c */ @@ -4261,9 +4261,9 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_mul.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_karatsuba_mul.c */ @@ -4386,9 +4386,9 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_karatsuba_sqr.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_karatsuba_sqr.c */ @@ -4450,9 +4450,9 @@ LBL_T: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_lcm.c */ @@ -4521,9 +4521,9 @@ int mp_lshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_lshd.c */ @@ -4573,9 +4573,9 @@ mp_mod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mod.c */ @@ -4632,9 +4632,9 @@ mp_mod_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mod_2d.c */ @@ -4663,9 +4663,9 @@ mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mod_d.c */ @@ -4726,9 +4726,9 @@ int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_montgomery_calc_normalization.c */ @@ -4848,9 +4848,9 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_montgomery_reduce.c */ @@ -4911,9 +4911,9 @@ mp_montgomery_setup (mp_int * n, mp_digit * rho) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_montgomery_setup.c */ @@ -4981,9 +4981,9 @@ int mp_mul (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul.c */ @@ -5067,9 +5067,9 @@ int mp_mul_2(mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul_2.c */ @@ -5156,9 +5156,9 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul_2d.c */ @@ -5239,9 +5239,9 @@ mp_mul_d (mp_int * a, mp_digit b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mul_d.c */ @@ -5283,9 +5283,9 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_mulmod.c */ @@ -5419,9 +5419,9 @@ LBL_T1:mp_clear (&t1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_n_root.c */ @@ -5463,9 +5463,9 @@ int mp_neg (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_neg.c */ @@ -5517,9 +5517,9 @@ int mp_or (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_or.c */ @@ -5583,9 +5583,9 @@ LBL_T:mp_clear (&t); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_fermat.c */ @@ -5637,9 +5637,9 @@ int mp_prime_is_divisible (mp_int * a, int *result) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_is_divisible.c */ @@ -5724,9 +5724,9 @@ LBL_B:mp_clear (&b); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_is_prime.c */ @@ -5831,9 +5831,9 @@ LBL_N1:mp_clear (&n1); } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_miller_rabin.c */ @@ -5983,7 +5983,7 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style) /* is this prime? */ for (x = 0; x < t; x++) { - mp_set(&b, ltm_prime_tab[t]); + mp_set(&b, ltm_prime_tab[x]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_ERR; } @@ -6005,9 +6005,9 @@ LBL_ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_next_prime.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-07-15 13:49:00 +0000 $ */ /* End: bn_mp_prime_next_prime.c */ @@ -6061,9 +6061,9 @@ int mp_prime_rabin_miller_trials(int size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_rabin_miller_trials.c */ @@ -6190,9 +6190,9 @@ error: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_prime_random_ex.c */ @@ -6272,9 +6272,9 @@ int mp_radix_size (mp_int * a, int radix, int *size) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_radix_size.c */ @@ -6300,9 +6300,9 @@ int mp_radix_size (mp_int * a, int radix, int *size) const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_radix_smap.c */ @@ -6359,9 +6359,9 @@ mp_rand (mp_int * a, int digits) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_rand.c */ @@ -6448,9 +6448,9 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_read_radix.c */ @@ -6493,9 +6493,9 @@ int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_read_signed_bin.c */ @@ -6552,9 +6552,9 @@ int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_read_unsigned_bin.c */ @@ -6656,9 +6656,9 @@ CLEANUP: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce.c */ @@ -6721,9 +6721,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k.c */ @@ -6787,9 +6787,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k_l.c */ @@ -6838,9 +6838,9 @@ int mp_reduce_2k_setup(mp_int *a, mp_digit *d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k_setup.c */ @@ -6886,9 +6886,9 @@ ERR: } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_2k_setup_l.c */ @@ -6942,9 +6942,9 @@ int mp_reduce_is_2k(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_is_2k.c */ @@ -6990,9 +6990,9 @@ int mp_reduce_is_2k_l(mp_int *a) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_is_2k_l.c */ @@ -7028,9 +7028,9 @@ int mp_reduce_setup (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_reduce_setup.c */ @@ -7104,9 +7104,9 @@ void mp_rshd (mp_int * a, int b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_rshd.c */ @@ -7137,9 +7137,9 @@ void mp_set (mp_int * a, mp_digit b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_set.c */ @@ -7189,9 +7189,9 @@ int mp_set_int (mp_int * a, unsigned long b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_set_int.c */ @@ -7217,20 +7217,25 @@ int mp_set_int (mp_int * a, unsigned long b) int mp_shrink (mp_int * a) { mp_digit *tmp; - if (a->alloc != a->used && a->used > 0) { - if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { + int used = 1; + + if(a->used > 0) + used = a->used; + + if (a->alloc != used) { + if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) { return MP_MEM; } a->dp = tmp; - a->alloc = a->used; + a->alloc = used; } return MP_OKAY; } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: v0.42.0 $ */ +/* $Date: 2010-06-02 15:09:36 +0200 $ */ /* End: bn_mp_shrink.c */ @@ -7259,9 +7264,9 @@ int mp_signed_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_signed_bin_size.c */ @@ -7321,9 +7326,9 @@ if (a->used >= KARATSUBA_SQR_CUTOFF) { } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sqr.c */ @@ -7366,9 +7371,9 @@ mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sqrmod.c */ @@ -7451,9 +7456,9 @@ E2: mp_clear(&t1); #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sqrt.c */ @@ -7514,9 +7519,9 @@ mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sub.c */ @@ -7611,9 +7616,9 @@ mp_sub_d (mp_int * a, mp_digit b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_sub_d.c */ @@ -7657,9 +7662,9 @@ mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_submod.c */ @@ -7694,9 +7699,9 @@ int mp_to_signed_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_signed_bin.c */ @@ -7729,9 +7734,9 @@ int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_signed_bin_n.c */ @@ -7781,9 +7786,9 @@ int mp_to_unsigned_bin (mp_int * a, unsigned char *b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_unsigned_bin.c */ @@ -7816,9 +7821,9 @@ int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_to_unsigned_bin_n.c */ @@ -8104,9 +8109,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toom_mul.c */ @@ -8334,9 +8339,9 @@ ERR: #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toom_sqr.c */ @@ -8413,9 +8418,9 @@ int mp_toradix (mp_int * a, char *str, int radix) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toradix.c */ @@ -8505,9 +8510,9 @@ int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_toradix_n.c */ @@ -8537,9 +8542,9 @@ int mp_unsigned_bin_size (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_unsigned_bin_size.c */ @@ -8592,9 +8597,9 @@ mp_xor (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_xor.c */ @@ -8632,9 +8637,9 @@ void mp_zero (mp_int * a) } #endif -/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_mp_zero.c */ @@ -8697,9 +8702,9 @@ const mp_digit ltm_prime_tab[] = { }; #endif -/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_prime_tab.c */ @@ -8740,9 +8745,9 @@ bn_reverse (unsigned char *s, int len) } #endif -/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_reverse.c */ @@ -8853,9 +8858,9 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_add.c */ @@ -9109,9 +9114,9 @@ LBL_M: } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_exptmod.c */ @@ -9203,9 +9208,9 @@ int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_mul_digs.c */ @@ -9288,9 +9293,9 @@ s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_mul_high_digs.c */ @@ -9376,9 +9381,9 @@ int s_mp_sqr (mp_int * a, mp_int * b) } #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_sqr.c */ @@ -9469,9 +9474,9 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c) #endif -/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ -/* $Revision: 1.4 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bn_s_mp_sub.c */ @@ -9509,9 +9514,9 @@ int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsub TOOM_SQR_CUTOFF = 400; #endif -/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/12/28 01:25:13 $ */ +/* $Source$ */ +/* $Revision: 0.41 $ */ +/* $Date: 2007-04-18 09:58:18 +0000 $ */ /* End: bncore.c */ diff --git a/libtommath/tommath.h b/libtommath/tommath.h index 3c00b9e..cf9c499 100644 --- a/libtommath/tommath.h +++ b/libtommath/tommath.h @@ -579,6 +579,6 @@ extern const char *mp_s_rmap; #endif -/* $Source: /cvs/libtom/libtommath/tommath.h,v $ */ -/* $Revision: 1.8 $ */ -/* $Date: 2006/03/31 14:18:44 $ */ +/* $Source$ */ +/* $Revision: 0.39 $ */ +/* $Date: 2006-04-06 19:49:59 +0000 $ */ diff --git a/libtommath/tommath.pdf b/libtommath/tommath.pdf index 33994c3..0b68941 100644 Binary files a/libtommath/tommath.pdf and b/libtommath/tommath.pdf differ diff --git a/libtommath/tommath_class.h b/libtommath/tommath_class.h index 166dd80..1e29c8f 100644 --- a/libtommath/tommath_class.h +++ b/libtommath/tommath_class.h @@ -994,6 +994,6 @@ #define LTM_LAST #endif -/* $Source: /cvs/libtom/libtommath/tommath_class.h,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2005/07/28 11:59:32 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ diff --git a/libtommath/tommath_superclass.h b/libtommath/tommath_superclass.h index 2fdebe6..89d5516 100644 --- a/libtommath/tommath_superclass.h +++ b/libtommath/tommath_superclass.h @@ -71,6 +71,6 @@ #endif -/* $Source: /cvs/libtom/libtommath/tommath_superclass.h,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2005/05/14 13:29:17 $ */ +/* $Source$ */ +/* $Revision: 0.36 $ */ +/* $Date: 2005-08-01 16:37:28 +0000 $ */ -- cgit v0.12 From f1bac0e8becc22f505069ad52dae904eae5e004d Mon Sep 17 00:00:00 2001 From: oehhar Date: Thu, 5 Jun 2014 19:09:51 +0000 Subject: Robust async connect tests by temporarely switching off auto continuation. Ticket [13d3af3ad5] --- tests/socket.test | 15 ++++++++++-- unix/tclUnixSock.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++- win/tclWinSock.c | 38 ++++++++++++++++++++++++++++++- 3 files changed, 116 insertions(+), 4 deletions(-) diff --git a/tests/socket.test b/tests/socket.test index 0c9320a..b006cb4 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -67,10 +67,19 @@ namespace import -force ::tcltest::* testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] testConstraint exec [llength [info commands exec]] + # Produce a random port number in the Dynamic/Private range # from 49152 through 65535. proc randport {} { expr {int(rand()*16383+49152)} } +# Check if socket_test option is available +testConstraint sockettest [expr {![catch { + set h [socket -async localhost [randport]] + fconfigure $h -unsupported1 1 + close $h + }]}] + + # Test the latency of tcp connections over the loopback interface. Some OSes # (e.g. NetBSD) seem to use the Nagle algorithm and delayed ACKs, so it takes # up to 200ms for a packet sent to localhost to arrive. We're measuring this @@ -2148,7 +2157,7 @@ test socket-14.10.1 {pending [socket -async] and nonblocking [puts], server is I close $sock } -result {{} ok} test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener, no flush} \ - -constraints {socket} \ + -constraints {socket } \ -body { set sock [socket -async localhost [randport]] fconfigure $sock -blocking 0 @@ -2161,12 +2170,14 @@ test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener unset x } -result {socket is not connected} -returnCodes 1 test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener, flush} \ - -constraints {socket} \ + -constraints {socket sockettest} \ -body { set sock [socket -async localhost [randport]] + fconfigure $sock -unsupported1 1 fconfigure $sock -blocking 0 puts $sock ok flush $sock + fconfigure $sock -unsupported1 0 fileevent $sock writable {set x 1} vwait x close $sock diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index a9323c4..cf5d7b9 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -89,6 +89,9 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ +#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + * Do not automatically continue connection + * process */ /* * The following defines the maximum length of the listen queue. This is the @@ -125,6 +128,9 @@ static int TcpClose2Proc(ClientData instanceData, Tcl_Interp *interp, int flags); static int TcpGetHandleProc(ClientData instanceData, int direction, ClientData *handlePtr); +static int TcpSetOptionProc(ClientData instanceData, + Tcl_Interp *interp, const char *optionName, + const char *value); static int TcpGetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); @@ -147,7 +153,7 @@ static const Tcl_ChannelType tcpChannelType = { TcpInputProc, /* Input proc. */ TcpOutputProc, /* Output proc. */ NULL, /* Seek proc. */ - NULL, /* Set option proc. */ + TcpSetOptionProc, /* Set option proc. */ TcpGetOptionProc, /* Get option proc. */ TcpWatchProc, /* Initialize notifier. */ TcpGetHandleProc, /* Get OS handles out of channel. */ @@ -439,6 +445,21 @@ WaitForConnect( if (!(statePtr->flags & TCP_ASYNC_PENDING)) { return 0; } + + /* + * In socket test mode do not continue with the connect + * Exceptions are: + * - Call by recv/send and blocking socket + * (errorCodePtr != NULL && ! flags & TCP_NONBLOCKING) + */ + + if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) + && !(errorCodePtr != NULL && !(statePtr->flags & TCP_NONBLOCKING))) { + if (errorCodePtr != NULL) { + *errorCodePtr = EWOULDBLOCK; + } + return -1; + } if (errorCodePtr == NULL || (statePtr->flags & TCP_NONBLOCKING)) { timeout = 0; @@ -748,6 +769,50 @@ TcpHostPortList( /* *---------------------------------------------------------------------- * + * TcpSetOptionProc -- + * + * Sets Tcp channel specific options. + * + * Results: + * None, unless an error happens. + * + * Side effects: + * Changes attributes of the socket at the system level. + * + *---------------------------------------------------------------------- + */ + +static int +TcpSetOptionProc( + ClientData instanceData, /* Socket state. */ + Tcl_Interp *interp, /* For error reporting - can be NULL. */ + const char *optionName, /* Name of the option to set. */ + const char *value) /* New value for option. */ +{ + TcpState *statePtr = instanceData; + + /* + * Set socket test int value + */ + if (!strcmp(optionName, "-unsupported1")) { + int intValue; + if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { + return TCL_ERROR; + } + if (intValue & 1) { + SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } else { + CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } + return TCL_OK; + } + + return Tcl_BadChannelOption(interp, optionName, ""); +} + +/* + *---------------------------------------------------------------------- + * * TcpGetOptionProc -- * * Computes an option value for a TCP socket based channel, or a list of diff --git a/win/tclWinSock.c b/win/tclWinSock.c index f343f82..2703309 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -191,6 +191,9 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ +#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + * Do not automatically continue connection + * process */ /* * The following structure is what is added to the Tcl event queue when a @@ -602,6 +605,20 @@ WaitForConnect( } /* + * In socket test mode do not continue with the connect + * Exceptions are: + * - Call by recv/send and blocking socket + * (errorCodePtr != NULL && ! flags & TCP_NONBLOCKING) + * - Call by the event queue (errorCodePtr == NULL) + */ + + if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) + && errorCodePtr != NULL && (statePtr->flags & TCP_NONBLOCKING)) { + *errorCodePtr = EWOULDBLOCK; + return -1; + } + + /* * Be sure to disable event servicing so we are truly modal. */ @@ -1123,6 +1140,7 @@ TcpSetOptionProc( const char *optionName, /* Name of the option to set. */ const char *value) /* New value for option. */ { + TcpState *statePtr = instanceData; #ifdef TCL_FEATURE_KEEPALIVE_NAGLE TcpState *statePtr = instanceData; SOCKET sock; @@ -1142,6 +1160,22 @@ TcpSetOptionProc( return TCL_ERROR; } + /* + * Set socket test int value + */ + if (!strcmp(optionName, "-unsupported1")) { + int intValue; + if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { + return TCL_ERROR; + } + if (intValue & 1) { + SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } else { + CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); + } + return TCL_OK; + } + #ifdef TCL_FEATURE_KEEPALIVE_NAGLE #error "TCL_FEATURE_KEEPALIVE_NAGLE not reviewed for whether to treat statePtr->sockets as single fd or list" sock = statePtr->sockets->fd; @@ -1254,7 +1288,9 @@ TcpGetOptionProc( * Go one step in async connect * If any error is thrown save it as backround error to report eventually below */ - WaitForConnect(statePtr, NULL); + if (! (statePtr->flags & TCP_ASYNC_TEST_MODE) ) { + WaitForConnect(statePtr, NULL); + } sock = statePtr->sockets->fd; if (optionName != NULL) { -- cgit v0.12 From 57fd7d58a12e28ba76f2bafdf441d53fabf47cb0 Mon Sep 17 00:00:00 2001 From: oehhar Date: Thu, 17 Jul 2014 09:53:36 +0000 Subject: Replaced option "-unsupported1" by test command "testsocket debugflags" (thanks Donal, Donald). --- generic/tclTest.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/socket.test | 15 ++++++---- unix/tclUnixSock.c | 67 +++++++++--------------------------------- win/tclWinSock.c | 31 +++++++------------- 4 files changed, 118 insertions(+), 80 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index a27c95a..80a2a37 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -75,6 +75,18 @@ typedef struct TestAsyncHandler { /* Next is list of handlers. */ } TestAsyncHandler; +/* + * Start of the socket driver state structure to acces field testFlags + */ + +typedef struct TcpState TcpState; + +struct TcpState { + Tcl_Channel channel; /* Channel associated with this socket. */ + int testFlags; /* bit field for tests. Is set by testsocket + * test procedure */ +}; + TCL_DECLARE_MUTEX(asyncTestMutex) static TestAsyncHandler *firstHandler = NULL; @@ -362,6 +374,8 @@ static int TestChannelCmd(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); static int TestChannelEventCmd(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); +static int TestSocketCmd(ClientData clientData, + Tcl_Interp *interp, int argc, const char **argv); static int TestFilesystemObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -666,6 +680,8 @@ Tcltest_Init( TestNumUtfCharsCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd, NULL, NULL); + Tcl_CreateCommand(interp, "testsocket", TestSocketCmd, + NULL, NULL); Tcl_CreateCommand(interp, "teststaticpkg", TeststaticpkgCmd, NULL, NULL); Tcl_CreateCommand(interp, "testtranslatefilename", @@ -5970,6 +5986,75 @@ TestChannelEventCmd( /* *---------------------------------------------------------------------- * + * TestSocketCmd -- + * + * Implements the Tcl "testsocket" debugging command and its + * subcommands. This is part of the testing environment. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + /* ARGSUSED */ +static int +TestSocketCmd( + ClientData clientData, /* Not used. */ + Tcl_Interp *interp, /* Interpreter for result. */ + int argc, /* Count of additional args. */ + const char **argv) /* Additional arg strings. */ +{ + const char *cmdName; /* Sub command. */ + size_t len; /* Length of subcommand string. */ + + if (argc < 2) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " subcommand ?additional args..?\"", NULL); + return TCL_ERROR; + } + cmdName = argv[1]; + len = strlen(cmdName); + + if ((cmdName[0] == 't') && (strncmp(cmdName, "testflags", len) == 0)) { + Tcl_Channel hChannel; + int modePtr; + TcpState *statePtr; + /* Set test value in the socket driver + */ + /* Check for argument "channel name" + */ + if (argc < 4) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " testflags channel flags\"", NULL); + return TCL_ERROR; + } + hChannel = Tcl_GetChannel(interp, argv[2], &modePtr); + if ( NULL == hChannel ) { + Tcl_AppendResult(interp, "unknown channel:", argv[2], NULL); + return TCL_ERROR; + } + statePtr = (TcpState *)Tcl_GetChannelInstanceData(hChannel); + if ( NULL == statePtr) { + Tcl_AppendResult(interp, "No channel instance data:", argv[2], + NULL); + return TCL_ERROR; + } + statePtr->testFlags = atoi(argv[3]); + return TCL_OK; + } + + Tcl_AppendResult(interp, "bad option \"", cmdName, "\": should be " + "testflags", NULL); + return TCL_ERROR; +} + +/* + *---------------------------------------------------------------------- + * * TestWrongNumArgsObjCmd -- * * Test the Tcl_WrongNumArgs function. diff --git a/tests/socket.test b/tests/socket.test index b006cb4..839e9d2 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -72,10 +72,10 @@ testConstraint exec [llength [info commands exec]] # from 49152 through 65535. proc randport {} { expr {int(rand()*16383+49152)} } -# Check if socket_test option is available -testConstraint sockettest [expr {![catch { +# Check if testsocket testflags is available +testConstraint testsocket_testflags [expr {![catch { set h [socket -async localhost [randport]] - fconfigure $h -unsupported1 1 + testsocket testflags $h 0 close $h }]}] @@ -2170,14 +2170,17 @@ test socket-14.11.0 {pending [socket -async] and nonblocking [puts], no listener unset x } -result {socket is not connected} -returnCodes 1 test socket-14.11.1 {pending [socket -async] and nonblocking [puts], no listener, flush} \ - -constraints {socket sockettest} \ + -constraints {socket testsocket_testflags} \ -body { set sock [socket -async localhost [randport]] - fconfigure $sock -unsupported1 1 + # Set the socket in async test mode. + # The async connect will not be continued on the following fconfigure + # and puts/flush. Thus, the connect will fail after them. + testsocket testflags $sock 1 fconfigure $sock -blocking 0 puts $sock ok flush $sock - fconfigure $sock -unsupported1 0 + testsocket testflags $sock 0 fileevent $sock writable {set x 1} vwait x close $sock diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index cf5d7b9..fdd4287 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -52,6 +52,8 @@ typedef struct TcpFdList { struct TcpState { Tcl_Channel channel; /* Channel associated with this file. */ + int testFlags; /* bit field for tests. Is set by testsocket + * test procedure */ TcpFdList fds; /* The file descriptors of the sockets. */ int flags; /* ORed combination of the bitfields defined * below. */ @@ -89,7 +91,13 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ -#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + +/* + * These bits may be ORed together into the "testFlags" field of a TcpState + * structure. + */ + +#define TCP_ASYNC_TEST_MODE (1<<0) /* Async testing activated * Do not automatically continue connection * process */ @@ -128,9 +136,6 @@ static int TcpClose2Proc(ClientData instanceData, Tcl_Interp *interp, int flags); static int TcpGetHandleProc(ClientData instanceData, int direction, ClientData *handlePtr); -static int TcpSetOptionProc(ClientData instanceData, - Tcl_Interp *interp, const char *optionName, - const char *value); static int TcpGetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char *optionName, Tcl_DString *dsPtr); @@ -153,7 +158,7 @@ static const Tcl_ChannelType tcpChannelType = { TcpInputProc, /* Input proc. */ TcpOutputProc, /* Output proc. */ NULL, /* Seek proc. */ - TcpSetOptionProc, /* Set option proc. */ + NULL, /* Set option proc. */ TcpGetOptionProc, /* Get option proc. */ TcpWatchProc, /* Initialize notifier. */ TcpGetHandleProc, /* Get OS handles out of channel. */ @@ -453,11 +458,9 @@ WaitForConnect( * (errorCodePtr != NULL && ! flags & TCP_NONBLOCKING) */ - if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) - && !(errorCodePtr != NULL && !(statePtr->flags & TCP_NONBLOCKING))) { - if (errorCodePtr != NULL) { - *errorCodePtr = EWOULDBLOCK; - } + if ( (statePtr->testFlags & TCP_ASYNC_TEST_MODE) + && ! (errorCodePtr != NULL && ! (statePtr->flags & TCP_NONBLOCKING))) { + *errorCodePtr = EWOULDBLOCK; return -1; } @@ -769,50 +772,6 @@ TcpHostPortList( /* *---------------------------------------------------------------------- * - * TcpSetOptionProc -- - * - * Sets Tcp channel specific options. - * - * Results: - * None, unless an error happens. - * - * Side effects: - * Changes attributes of the socket at the system level. - * - *---------------------------------------------------------------------- - */ - -static int -TcpSetOptionProc( - ClientData instanceData, /* Socket state. */ - Tcl_Interp *interp, /* For error reporting - can be NULL. */ - const char *optionName, /* Name of the option to set. */ - const char *value) /* New value for option. */ -{ - TcpState *statePtr = instanceData; - - /* - * Set socket test int value - */ - if (!strcmp(optionName, "-unsupported1")) { - int intValue; - if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { - return TCL_ERROR; - } - if (intValue & 1) { - SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } else { - CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } - return TCL_OK; - } - - return Tcl_BadChannelOption(interp, optionName, ""); -} - -/* - *---------------------------------------------------------------------- - * * TcpGetOptionProc -- * * Computes an option value for a TCP socket based channel, or a list of diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 2703309..d6c8e3a 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -133,6 +133,8 @@ typedef struct TcpFdList { struct TcpState { Tcl_Channel channel; /* Channel associated with this socket. */ + int testFlags; /* bit field for tests. Is set by testsocket + * test procedure */ struct TcpFdList *sockets; /* Windows SOCKET handle. */ int flags; /* Bit field comprised of the flags described * below. */ @@ -191,7 +193,13 @@ struct TcpState { * flag indicates that reentry is * still pending */ #define TCP_ASYNC_FAILED (1<<5) /* An async connect finally failed */ -#define TCP_ASYNC_TEST_MODE (1<<6) /* Async testing activated + +/* + * These bits may be ORed together into the "testFlags" field of a TcpState + * structure. + */ + +#define TCP_ASYNC_TEST_MODE (1<<0) /* Async testing activated * Do not automatically continue connection * process */ @@ -612,7 +620,7 @@ WaitForConnect( * - Call by the event queue (errorCodePtr == NULL) */ - if ( (statePtr->flags & TCP_ASYNC_TEST_MODE) + if ( (statePtr->testFlags & TCP_ASYNC_TEST_MODE) && errorCodePtr != NULL && (statePtr->flags & TCP_NONBLOCKING)) { *errorCodePtr = EWOULDBLOCK; return -1; @@ -1140,7 +1148,6 @@ TcpSetOptionProc( const char *optionName, /* Name of the option to set. */ const char *value) /* New value for option. */ { - TcpState *statePtr = instanceData; #ifdef TCL_FEATURE_KEEPALIVE_NAGLE TcpState *statePtr = instanceData; SOCKET sock; @@ -1160,22 +1167,6 @@ TcpSetOptionProc( return TCL_ERROR; } - /* - * Set socket test int value - */ - if (!strcmp(optionName, "-unsupported1")) { - int intValue; - if (Tcl_GetInt(interp, value, &intValue) != TCL_OK) { - return TCL_ERROR; - } - if (intValue & 1) { - SET_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } else { - CLEAR_BITS(statePtr->flags,TCP_ASYNC_TEST_MODE); - } - return TCL_OK; - } - #ifdef TCL_FEATURE_KEEPALIVE_NAGLE #error "TCL_FEATURE_KEEPALIVE_NAGLE not reviewed for whether to treat statePtr->sockets as single fd or list" sock = statePtr->sockets->fd; @@ -1288,7 +1279,7 @@ TcpGetOptionProc( * Go one step in async connect * If any error is thrown save it as backround error to report eventually below */ - if (! (statePtr->flags & TCP_ASYNC_TEST_MODE) ) { + if (! (statePtr->testFlags & TCP_ASYNC_TEST_MODE) ) { WaitForConnect(statePtr, NULL); } -- cgit v0.12 From 1990c76e8d05fcf48cccabb5d2f1a49c3c99ecd1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Jul 2014 10:00:52 +0000 Subject: Make sure the "sockettest" command is available even when running socket.test individually. --- tests/socket.test | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/socket.test b/tests/socket.test index 8ffd86b..29f1015 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -60,8 +60,13 @@ # listening at port 2048. If all fails, a message is printed and the tests # using the remote server are not performed. -package require tcltest 2 -namespace import -force ::tcltest::* +if {[lsearch [namespace children] ::tcltest] == -1} { + package require tcltest + namespace import -force ::tcltest::* +} + +::tcltest::loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] # Some tests require the Thread package or exec command testConstraint thread [expr {0 == [catch {package require Thread 2.7-}]}] -- cgit v0.12 From a7258480c26f267158b30ff494c04bc04c6cfae0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 25 Sep 2015 10:39:39 +0000 Subject: proposed fix for [219866c1e9]: platform::identify: regexp doesn't match platform --- library/platform/pkgIndex.tcl | 2 +- library/platform/platform.tcl | 13 ++++++++++--- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl index 5250163..5970a3f 100644 --- a/library/platform/pkgIndex.tcl +++ b/library/platform/pkgIndex.tcl @@ -1,3 +1,3 @@ -package ifneeded platform 1.0.13 [list source [file join $dir platform.tcl]] +package ifneeded platform 1.0.14 [list source [file join $dir platform.tcl]] package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]] diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 1bce7b5..6843210 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -95,7 +95,11 @@ proc ::platform::generic {} { switch -- $plat { windows { - set plat win32 + if {$tcl_platform(platform) == "unix"} { + set plat cygwin_nt + } else { + set plat win32 + } if {$cpu eq "amd64"} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 @@ -158,9 +162,12 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)-([^-]+)$} $id -> plat cpu + regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu switch -- $plat { + cygwin_nt { + return "${plat}-${cpu}" + } solaris { regsub {^5} $tcl_platform(osVersion) 2 text append plat $text @@ -371,7 +378,7 @@ proc ::platform::patterns {id} { # ### ### ### ######### ######### ######### ## Ready -package provide platform 1.0.13 +package provide platform 1.0.14 # ### ### ### ######### ######### ######### ## Demo application diff --git a/unix/Makefile.in b/unix/Makefile.in index 1358f29..1f2cd77 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -788,8 +788,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs @echo "Installing package tcltest 2.3.8 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.8.tm; - @echo "Installing package platform 1.0.13 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.13.tm; + @echo "Installing package platform 1.0.14 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.14.tm; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm; diff --git a/win/Makefile.in b/win/Makefile.in index dd568ba..c0d8668 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -653,8 +653,8 @@ install-libraries: libraries install-tzdata install-msgs @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.5.2.tm; @echo "Installing package tcltest 2.3.8 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.8.tm; - @echo "Installing package platform 1.0.13 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.13.tm; + @echo "Installing package platform 1.0.14 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.14.tm; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.4.tm; @echo "Installing encodings"; -- cgit v0.12 From 4bdba0452a35fd38357a21020579d0151a1c25d6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 28 Sep 2015 11:11:00 +0000 Subject: align comment, no functional change --- generic/tclIO.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclIO.h b/generic/tclIO.h index 20e0ccd..348a9c5 100644 --- a/generic/tclIO.h +++ b/generic/tclIO.h @@ -126,7 +126,7 @@ typedef struct Channel { */ typedef struct ChannelState { - char *channelName; /* The name of the channel instance in Tcl + char *channelName; /* The name of the channel instance in Tcl * commands. Storage is owned by the generic * IO code, is dynamically allocated. */ int flags; /* ORed combination of the flags defined -- cgit v0.12 From a2540e5ece3d78a4ea38164cdbcb92d6f0c769c3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 08:25:37 +0000 Subject: Fix [b1f19286f0]: for command documentation. Minor addendum to previous commit: Make OS version number available in ::platform::generic for Cygwin --- doc/for.n | 2 +- library/platform/platform.tcl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/for.n b/doc/for.n index 9773677..7537e10 100644 --- a/doc/for.n +++ b/doc/for.n @@ -48,7 +48,7 @@ expression is evaluated (before each loop iteration), so changes in the variables will be visible. See below for an example: .SH EXAMPLES -Print a line for each of the integers from 0 to 10: +Print a line for each of the integers from 0 to 9: .CS for {set x 0} {$x<10} {incr x} { puts "x is $x" diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 6843210..d510541 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -104,6 +104,7 @@ proc ::platform::generic {} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 } + append plat -$tcl_platform(osVersion) } sunos { set plat solaris -- cgit v0.12 From 5572aa0ec790cb0075eca068cf30ae366abb7f4c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 11:11:33 +0000 Subject: Don't limit Universal runtime support VisualStudio version 14 only, future versions will probably have it as well. --- win/configure | 4 ++-- win/tcl.m4 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/win/configure b/win/configure index f417981..1dcc9d2 100755 --- a/win/configure +++ b/win/configure @@ -3691,7 +3691,7 @@ echo "${ECHO_T}using shared flags" >&6 LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -3736,7 +3736,7 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) LIBS="$LIBS ucrt.lib" ;; *) diff --git a/win/tcl.m4 b/win/tcl.m4 index 6f10a96..aa3c4b3 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -784,7 +784,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -826,7 +826,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) LIBS="$LIBS ucrt.lib" ;; *) -- cgit v0.12 From 3964ec3d8cef652a7ff8f12578bf910bedd0f50b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 12:57:02 +0000 Subject: Fix [738bc50e93]: auto_execok doesn't recognise mklink on windows. Remove some unnecessary end-of-line spacing. --- library/auto.tcl | 14 ++-- library/clock.tcl | 168 +++++++++++++++++++++--------------------- library/init.tcl | 12 +-- library/package.tcl | 44 +++++------ library/platform/platform.tcl | 2 +- library/safe.tcl | 18 ++--- library/tm.tcl | 2 +- 7 files changed, 128 insertions(+), 132 deletions(-) diff --git a/library/auto.tcl b/library/auto.tcl index f7cf5f0..ec680de 100644 --- a/library/auto.tcl +++ b/library/auto.tcl @@ -16,7 +16,7 @@ # so that the information gets recomputed the next time it's needed. # Also delete any commands that are listed in the auto-load index. # -# Arguments: +# Arguments: # None. proc auto_reset {} { @@ -172,7 +172,7 @@ proc tcl_findLibrary {basename version patch initScript enVarName varName} { # parse Tcl source files, writing out index entries as "proc" # commands are encountered. This implementation won't work in a # safe interpreter, since a safe interpreter can't create the -# special parser and mess with its commands. +# special parser and mess with its commands. if {[interp issafe]} { return ;# Stop sourcing the file here @@ -184,7 +184,7 @@ if {[interp issafe]} { # followed by any number of glob patterns to use in that directory to # locate all of the relevant files. # -# Arguments: +# Arguments: # dir - Name of the directory in which to create an index. # args - Any number of additional arguments giving the # names of files within dir. If no additional @@ -338,7 +338,7 @@ namespace eval auto_mkindex_parser { # handles things like the "proc" command by adding an entry for the # index file. Returns a string that represents the index file. # -# Arguments: +# Arguments: # file Name of Tcl source file to be indexed. proc auto_mkindex_parser::mkindex {file} { @@ -455,7 +455,7 @@ proc auto_mkindex_parser::commandInit {name arglist body} { if {[string match *::* $name]} { set exportCmd [list _%@namespace export [namespace tail $name]] $parser eval [list _%@namespace eval $ns $exportCmd] - + # The following proc definition does not work if you # want to tolerate space or something else diabolical # in the procedure name, (i.e., space in $alias) @@ -528,7 +528,7 @@ auto_mkindex_parser::command proc {name args} { variable scriptFile # Do some fancy reformatting on the "source" call to handle platform # differences with respect to pathnames. Use format just so that the - # command is a little easier to read (otherwise it'd be full of + # command is a little easier to read (otherwise it'd be full of # backslashed dollar signs, etc. append index [list set auto_index([fullname $name])] \ [format { [list source [file join $dir %s]]} \ @@ -553,7 +553,7 @@ auto_mkindex_parser::hook { # AUTO MKINDEX: tbcload::bcproc name arglist body # Adds an entry to the auto index list for the given pre-compiled - # procedure name. + # procedure name. auto_mkindex_parser::commandInit tbcload::bcproc {name args} { variable index diff --git a/library/clock.tcl b/library/clock.tcl index 1f83716..eb87251 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -43,7 +43,7 @@ namespace eval ::tcl::clock \ # The 'clock' command manipulates time. Refer to the user documentation # for the available subcommands and what they do. # -#---------------------------------------------------------------------- +#---------------------------------------------------------------------- namespace eval ::tcl::clock { @@ -189,7 +189,7 @@ proc ::tcl::clock::Initialize {} { # Germany, Norway, Denmark (Catholic Germany changed earlier) ::msgcat::mcset de_DE GREGORIAN_CHANGE_DATE 2342032 - ::msgcat::mcset nb GREGORIAN_CHANGE_DATE 2342032 + ::msgcat::mcset nb GREGORIAN_CHANGE_DATE 2342032 ::msgcat::mcset nn GREGORIAN_CHANGE_DATE 2342032 ::msgcat::mcset no GREGORIAN_CHANGE_DATE 2342032 ::msgcat::mcset da GREGORIAN_CHANGE_DATE 2342032 @@ -225,7 +225,7 @@ proc ::tcl::clock::Initialize {} { # Greece ::msgcat::mcset el GREGORIAN_CHANGE_DATE 2423480 - + #------------------------------------------------------------------ # # CONSTANTS @@ -378,7 +378,7 @@ proc ::tcl::clock::Initialize {} { {46800 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :Pacific/Tongatapu }] - # Groups of fields that specify the date, priorities, and + # Groups of fields that specify the date, priorities, and # code bursts that determine Julian Day Number given those groups. # The code in [clock scan] will choose the highest priority # (lowest numbered) set of fields that determines the date. @@ -670,7 +670,7 @@ proc ::tcl::clock::format { args } { set clockval [lindex $args 0] # Get the data for time changes in the given zone - + if {$timezone eq ""} { set timezone [GetSystemTimeZone] } @@ -680,11 +680,11 @@ proc ::tcl::clock::format { args } { return -options $opts $retval } } - + # Build a procedure to format the result. Cache the built procedure's # name in the 'FormatProc' array to avoid losing its internal # representation, which contains the name resolution. - + set procName formatproc'$format'$locale set procName [namespace current]::[string map {: {\:} \\ {\\}} $procName] if {[info exists FormatProc($procName)]} { @@ -693,7 +693,7 @@ proc ::tcl::clock::format { args } { set FormatProc($procName) \ [ParseClockFormatFormat $procName $format $locale] } - + return [$procName $clockval $timezone] } @@ -720,7 +720,7 @@ proc ::tcl::clock::ParseClockFormatFormat {procName format locale} { } # Map away the locale-dependent composite format groups - + EnterLocale $locale oldLocale # Change locale if a fresh locale has been given on the command line. @@ -767,7 +767,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { set formatString {} set substituents {} set state {} - + set format [LocalizeFormat $locale $format] foreach char [split $format {}] { @@ -794,7 +794,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { { [lindex @DAYS_OF_WEEK_ABBREV@ \ [expr {[dict get $date dayOfWeek] \ % 7}]]}] - } + } A { # Day of week, spelt out. append formatString %s append substituents \ @@ -895,7 +895,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { k { # Hour (0-23), no leading zero append formatString %2d append substituents \ - { [expr { [dict get $date localSeconds] + { [expr { [dict get $date localSeconds] / 3600 % 24 }]} } @@ -916,7 +916,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { M { # Minute of the hour, leading zero append formatString %02d append substituents \ - { [expr { [dict get $date localSeconds] + { [expr { [dict get $date localSeconds] / 60 % 60 }]} } @@ -957,7 +957,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { { [expr {(([dict get $date localSeconds] % 86400) < 43200) ? $am : $pm}]} - + } Q { # Hi, Jeff! append formatString %s @@ -967,11 +967,11 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents { [dict get $date seconds]} } - S { # Second of the minute, with + S { # Second of the minute, with # leading zero append formatString %02d append substituents \ - { [expr { [dict get $date localSeconds] + { [expr { [dict get $date localSeconds] % 60 }]} } t { # A literal tab character @@ -992,7 +992,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { } incr dow set UweekNumber \ - [expr { ( [dict get $date dayOfYear] + [expr { ( [dict get $date dayOfYear] - $dow + 7 ) / 7 }] } @@ -1015,7 +1015,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { set WweekNumber \ [expr { ( [dict get $date dayOfYear] - [dict get $date dayOfWeek] - + 7 ) + + 7 ) / 7 }] } append formatString %02d @@ -1084,7 +1084,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { percentO { # Character following %O set state {} switch -exact -- $char { - d - e { # Day of the month in alternative + d - e { # Day of the month in alternative # numerals append formatString %s append substituents \ @@ -1096,7 +1096,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents \ { [lindex $localeNumerals \ - [expr { [dict get $date localSeconds] + [expr { [dict get $date localSeconds] / 3600 % 24 }]]} } @@ -1122,7 +1122,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents \ { [lindex $localeNumerals \ - [expr { [dict get $date localSeconds] + [expr { [dict get $date localSeconds] / 60 % 60 }]]} } @@ -1131,7 +1131,7 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { append formatString %s append substituents \ { [lindex $localeNumerals \ - [expr { [dict get $date localSeconds] + [expr { [dict get $date localSeconds] % 60 }]]} } u { # Day of the week (Monday=1,Sunday=7) @@ -1162,9 +1162,9 @@ proc ::tcl::clock::ParseClockFormatFormat2 {format locale procName} { } } } - + # Clean up any improperly terminated groups - + switch -exact -- $state { percent { append formatString %% @@ -1263,7 +1263,7 @@ proc ::tcl::clock::scan { args } { } if { [catch { expr { wide($base) } } result] } { return -code error \ - "expected integer but got \"$base\"" + "expected integer but got \"$base\"" } if { ![string is boolean $gmt] } { return -code error \ @@ -1340,7 +1340,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { variable TZData # Get the data for time changes in the given zone - + if {[catch {SetupTimeZone $timezone} retval opts]} { dict unset opts -errorinfo return -options $opts $retval @@ -1353,7 +1353,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { $base \ $TZData($timezone) \ 2361222] - dict set date secondOfDay [expr { [dict get $date localSeconds] + dict set date secondOfDay [expr { [dict get $date localSeconds] % 86400 }] # Parse the date. The parser will return a list comprising @@ -1400,7 +1400,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { # east of Greenwich, and the second is a Daylight Saving Time # indicator ( 1 == yes, 0 == no, -1 == unknown ). We make it into # a time zone indicator of +-hhmm. - + if { [llength $parseZone] > 0 } { lassign $parseZone minEast dstFlag set timezone [FormatNumericTimeZone \ @@ -1414,9 +1414,9 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { set date [GetJulianDayFromEraYearMonthDay $date[set date {}] 2361222] if { $parseTime ne {} } { dict set date secondOfDay $parseTime - } elseif { [llength $parseWeekday] != 0 - || [llength $parseOrdinalMonth] != 0 - || ( [llength $parseRel] != 0 + } elseif { [llength $parseWeekday] != 0 + || [llength $parseOrdinalMonth] != 0 + || ( [llength $parseRel] != 0 && ( [lindex $parseRel 0] != 0 || [lindex $parseRel 1] != 0 ) ) } { dict set date secondOfDay 0 @@ -1437,17 +1437,17 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { set seconds [add $seconds \ $relMonth months $relDay days $relSecond seconds \ -timezone $timezone -locale $locale] - } + } # Do relative weekday - + if { [llength $parseWeekday] > 0 } { lassign $parseWeekday dayOrdinal dayOfWeek set date2 [GetDateFields $seconds $TZData($timezone) 2361222] dict set date2 era CE set jdwkday [WeekdayOnOrBefore $dayOfWeek \ - [expr { [dict get $date2 julianDay] + [expr { [dict get $date2 julianDay] + 6 }]] incr jdwkday [expr { 7 * $dayOrdinal }] if { $dayOrdinal > 0 } { @@ -1506,7 +1506,7 @@ proc ::tcl::clock::FreeScan { string base timezone locale } { # # Results: # Constructs and returns a procedure that accepts the -# string being scanned, the base time, and the time zone. +# string being scanned, the base time, and the time zone. # The procedure will either return the scanned time or # else throw an error that should be rethrown to the caller # of [clock scan] @@ -1776,7 +1776,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { append re \\s*\\d\\d? } V { # Week of ISO8601 year - + append re \\s*(\\d\\d?) dict set fieldSet iso8601Week [incr fieldCount] append postcode "dict set date iso8601Week \[" \ @@ -1948,7 +1948,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { "day of week is greater than 7" } dict set date dayOfWeek $dow - } + } } y { lassign [LocaleNumeralMatcher $locale] regex lookup @@ -1996,7 +1996,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { # Get time zone if needed - if { ![dict exists $fieldSet seconds] + if { ![dict exists $fieldSet seconds] && ![dict exists $fieldSet starDate] } { if { [dict exists $fieldSet tzName] } { append procBody { @@ -2018,7 +2018,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { # Assemble seconds, and convert local nominal time to UTC. - if { ![dict exists $fieldSet seconds] + if { ![dict exists $fieldSet seconds] && ![dict exists $fieldSet starDate] } { append procBody { if { [dict get $date julianDay] > 5373484 } { @@ -2047,7 +2047,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { return $procName } - + #---------------------------------------------------------------------- # # LocaleNumeralMatcher -- @@ -2087,7 +2087,7 @@ proc ::tcl::clock::LocaleNumeralMatcher {l} { } return [dict get $LocaleNumeralCache $l] } - + #---------------------------------------------------------------------- @@ -2128,7 +2128,7 @@ proc ::tcl::clock::UniquePrefixRegexp { data } { foreach { key value } $data { - # Construct all prefixes of the key; + # Construct all prefixes of the key; set prefix {} foreach char [split $key {}] { @@ -2191,7 +2191,7 @@ proc ::tcl::clock::UniquePrefixRegexp { data } { # #---------------------------------------------------------------------- -proc ::tcl::clock::MakeUniquePrefixRegexp { successors +proc ::tcl::clock::MakeUniquePrefixRegexp { successors uniquePrefixMapping prefixString } { @@ -2322,7 +2322,7 @@ proc ::tcl::clock::MakeParseCodeFromFields { dateFields parseActions } { set currPrio $prio set currFieldPos $fPos set currCodeBurst $parseAction - + } return $currCodeBurst @@ -2401,7 +2401,7 @@ proc ::tcl::clock::EnterLocale { locale oldLocaleVar } { dict set McLoaded $locale {} } -} +} #---------------------------------------------------------------------- # @@ -2565,7 +2565,7 @@ proc ::tcl::clock::LocalizeFormat { locale format } { # string. Note that the order of the [string map] operations is # significant because later formats can refer to later ones; for example # %c can refer to %X, which in turn can refer to %T. - + set list { %% %% %D %m/%d/%Y @@ -2582,7 +2582,7 @@ proc ::tcl::clock::LocalizeFormat { locale format } { lappend list %c [string map $list [mc DATE_TIME_FORMAT]] lappend list %Ec [string map $list [mc LOCALE_DATE_TIME_FORMAT]] set format [string map $list $format] - + dict set McLoaded $locale FORMAT $inFormat $format return $format } @@ -2790,7 +2790,7 @@ proc ::tcl::clock::ScanWide { str } { # #---------------------------------------------------------------------- -proc ::tcl::clock::InterpretTwoDigitYear { date baseTime +proc ::tcl::clock::InterpretTwoDigitYear { date baseTime { twoDigitField yearOfCentury } { fourDigitField year } } { @@ -2886,7 +2886,7 @@ proc ::tcl::clock::AssignBaseIso8601Year {date baseTime timeZone changeover} { # # AssignBaseMonth -- # -# Places the number of the current year and month into a +# Places the number of the current year and month into a # dictionary. # # Parameters: @@ -3191,10 +3191,10 @@ proc ::tcl::clock::SetupTimeZone { timezone } { set TZData($timezone) [list [list $MINWIDE $offset -1 $timezone]] } elseif { [string index $timezone 0] eq {:} } { - + # Convert using a time zone file - if { + if { [catch { LoadTimeZoneFile [string range $timezone 1 end] }] @@ -3206,9 +3206,9 @@ proc ::tcl::clock::SetupTimeZone { timezone } { -errorcode [list CLOCK badTimeZone $timezone] \ "time zone \"$timezone\" not found" } - + } elseif { ![catch {ParsePosixTimeZone $timezone} tzfields] } { - + # This looks like a POSIX time zone - try to process it if { [catch {ProcessPosixTimeZone $tzfields} data opts] } { @@ -3255,7 +3255,7 @@ proc ::tcl::clock::SetupTimeZone { timezone } { # no time zone information supplied with Windows actually uses # them! # -# On a Windows system where neither $env(TCL_TZ) nor $env(TZ) is +# On a Windows system where neither $env(TCL_TZ) nor $env(TZ) is # specified, GuessWindowsTimeZone looks in the Registry for the # system time zone information. It then attempts to find an entry # in WinZoneInfo for a time zone that uses the same rules. If @@ -3378,7 +3378,7 @@ proc ::tcl::clock::GuessWindowsTimeZone {} { : [::format %02d $stdSecond] } dict set WinZoneInfo $data $tzname - } + } return [dict get $WinZoneInfo $data] @@ -3533,10 +3533,10 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { if {$version eq "2"} { set seek [expr {44 - + 5 * $nTime - + 6 * $nType + + 5 * $nTime + + 6 * $nType + 4 * $nLeap - + $nIsStd + + $nIsStd + $nIsGMT + $nChar }] @@ -3652,7 +3652,7 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { # The following keys are present in the dictionary: # stdName - Name of the time zone when Daylight Saving Time # is not in effect. -# stdSignum - Sign (+, -, or empty) of the offset from Greenwich +# stdSignum - Sign (+, -, or empty) of the offset from Greenwich # to the given (non-DST) time zone. + and the empty # string denote zones west of Greenwich, - denotes east # of Greenwich; this is contrary to the ISO convention @@ -3697,7 +3697,7 @@ proc ::tcl::clock::ReadZoneinfoFile {fileName fname} { # endHours, endMinutes, endSeconds - # Specify the end of DST in the same way that the start* fields # specify the beginning of DST. -# +# # This procedure serves only to break the time specifier into fields. # No attempt is made to canonicalize the fields or supply default values. # @@ -3715,8 +3715,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ([[:digit:]]{1,2}) (?: # 4 - Standard time zone offset, minutes - : ([[:digit:]]{1,2}) - (?: + : ([[:digit:]]{1,2}) + (?: # 5 - Standard time zone offset, seconds : ([[:digit:]]{1,2} ) )? @@ -3732,8 +3732,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ([[:digit:]]{1,2}) (?: # 9 - DST time zone offset, minutes - : ([[:digit:]]{1,2}) - (?: + : ([[:digit:]]{1,2}) + (?: # 10 - DST time zone offset, seconds : ([[:digit:]]{1,2}) )? @@ -3746,8 +3746,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ( J ? ) ( [[:digit:]]+ ) | M # 13 - Month number 14 - Week of month 15 - Day of week - ( [[:digit:]] + ) - [.] ( [[:digit:]] + ) + ( [[:digit:]] + ) + [.] ( [[:digit:]] + ) [.] ( [[:digit:]] + ) ) (?: @@ -3768,8 +3768,8 @@ proc ::tcl::clock::ParsePosixTimeZone { tz } { ( J ? ) ( [[:digit:]]+ ) | M # 21 - Month number 22 - Week of month 23 - Day of week - ( [[:digit:]] + ) - [.] ( [[:digit:]] + ) + ( [[:digit:]] + ) + [.] ( [[:digit:]] + ) [.] ( [[:digit:]] + ) ) (?: @@ -3845,14 +3845,14 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { } else { set stdSignum -1 } - set stdHours [lindex [::scan [dict get $z stdHours] %d] 0] + set stdHours [lindex [::scan [dict get $z stdHours] %d] 0] if { [dict get $z stdMinutes] ne {} } { - set stdMinutes [lindex [::scan [dict get $z stdMinutes] %d] 0] + set stdMinutes [lindex [::scan [dict get $z stdMinutes] %d] 0] } else { set stdMinutes 0 } if { [dict get $z stdSeconds] ne {} } { - set stdSeconds [lindex [::scan [dict get $z stdSeconds] %d] 0] + set stdSeconds [lindex [::scan [dict get $z stdSeconds] %d] 0] } else { set stdSeconds 0 } @@ -3881,14 +3881,14 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { if { [dict get $z dstHours] eq {} } { set dstOffset [expr { 3600 + $stdOffset }] } else { - set dstHours [lindex [::scan [dict get $z dstHours] %d] 0] + set dstHours [lindex [::scan [dict get $z dstHours] %d] 0] if { [dict get $z dstMinutes] ne {} } { - set dstMinutes [lindex [::scan [dict get $z dstMinutes] %d] 0] + set dstMinutes [lindex [::scan [dict get $z dstMinutes] %d] 0] } else { set dstMinutes 0 } if { [dict get $z dstSeconds] ne {} } { - set dstSeconds [lindex [::scan [dict get $z dstSeconds] %d] 0] + set dstSeconds [lindex [::scan [dict get $z dstSeconds] %d] 0] } else { set dstSeconds 0 } @@ -3903,7 +3903,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { # US end time is the first Sunday in November. # EU end time is the last Sunday in October - if { [dict get $z startDayOfYear] eq {} + if { [dict get $z startDayOfYear] eq {} && [dict get $z startMonth] eq {} } { if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} { # EU @@ -3923,7 +3923,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { dict set z startMinutes 0 dict set z startSeconds 0 } - if { [dict get $z endDayOfYear] eq {} + if { [dict get $z endDayOfYear] eq {} && [dict get $z endMonth] eq {} } { if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} { # EU @@ -3964,8 +3964,8 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { } return $data - -} + +} #---------------------------------------------------------------------- # @@ -4000,7 +4000,7 @@ proc ::tcl::clock::DeterminePosixDSTTime { z bound y } { # Time was specified as a day of the year if { [dict get $z ${bound}J] ne {} - && [IsGregorianLeapYear $y] + && [IsGregorianLeapYear $y] && ( $doy > $FEB_28 ) } { incr doy } @@ -4078,7 +4078,7 @@ proc ::tcl::clock::GetLocaleEra { date etable } { [expr { [dict get $date year] % 100 }] } else { dict set date localeEra [lindex $etable $index 1] - dict set date localeYear [expr { [dict get $date year] + dict set date localeYear [expr { [dict get $date year] - [lindex $etable $index 2] }] } return $date @@ -4136,7 +4136,7 @@ proc ::tcl::clock::GetJulianDayFromEraYearDay {date changeover} { + ( $ym1 / 4 ) - ( $ym1 / 100 ) + ( $ym1 / 400 ) }] - + # If the date is before the Gregorian change, use the Julian calendar. if { $jd < $changeover } { @@ -4219,7 +4219,7 @@ proc ::tcl::clock::GetJulianDayFromEraYearMonthWeekDay {date changeover} { proc ::tcl::clock::IsGregorianLeapYear { date } { switch -exact -- [dict get $date era] { - BCE { + BCE { set year [expr { 1 - [dict get $date year]}] } CE { @@ -4415,7 +4415,7 @@ proc ::tcl::clock::add { clockval args } { } if { [catch { expr { wide($clockval) } } result] } { return -code error \ - "expected integer but got \"$clockval\"" + "expected integer but got \"$clockval\"" } if { ![string is boolean $gmt] } { return -code error \ @@ -4427,7 +4427,7 @@ proc ::tcl::clock::add { clockval args } { } EnterLocale $locale oldLocale - + set changeover [mc GREGORIAN_CHANGE_DATE] if {[catch {SetupTimeZone $timezone} retval opts]} { diff --git a/library/init.tcl b/library/init.tcl index 4981cd6..62729e6 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -12,7 +12,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# This test intentionally written in pre-7.5 Tcl +# This test intentionally written in pre-7.5 Tcl if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } @@ -346,7 +346,7 @@ proc unknown args { } } - if {([info level] == 1) && ([info script] eq "") + if {([info level] == 1) && ([info script] eq "") && [info exists tcl_interactive] && $tcl_interactive} { if {![info exists auto_noexec]} { set new [auto_execok $name] @@ -649,12 +649,8 @@ proc auto_execok name { } set auto_execs($name) "" - set shellBuiltins [list cls copy date del erase dir echo mkdir \ - md rename ren rmdir rd time type ver vol] - if {$tcl_platform(os) eq "Windows NT"} { - # NT includes the 'start' built-in - lappend shellBuiltins "start" - } + set shellBuiltins [list cls copy date del dir echo erase md mkdir \ + mklink rd ren rename rmdir start time type ver vol] if {[info exists env(PATHEXT)]} { # Add an initial ; to have the {} extension check first. set execExtensions [split ";$env(PATHEXT)" ";"] diff --git a/library/package.tcl b/library/package.tcl index 06f619c..3783722 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -40,7 +40,7 @@ proc tcl::Pkg::CompareExtension { fileName {ext {}} } { set currExt [file extension $root] if {$currExt eq $ext} { return 1 - } + } # The current extension does not match; if it is not a numeric # value, quit, as we are only looking to ignore version number @@ -289,22 +289,22 @@ proc pkg_mkIndex {args} { set ::tcl::type source } - # As a performance optimization, if we are creating - # direct load packages, don't bother figuring out the - # set of commands created by the new packages. We - # only need that list for setting up the autoloading + # As a performance optimization, if we are creating + # direct load packages, don't bother figuring out the + # set of commands created by the new packages. We + # only need that list for setting up the autoloading # used in the non-direct case. if { !$::tcl::direct } { # See what new namespaces appeared, and import commands # from them. Only exported commands go into the index. - + foreach ::tcl::x [::tcl::GetAllNamespaces] { if {! [info exists ::tcl::namespaces($::tcl::x)]} { namespace import -force ${::tcl::x}::* } # Figure out what commands appeared - + foreach ::tcl::x [info commands] { set ::tcl::newCmds($::tcl::x) 1 } @@ -313,18 +313,18 @@ proc pkg_mkIndex {args} { } foreach ::tcl::x [array names ::tcl::newCmds] { # determine which namespace a command comes from - + set ::tcl::abs [namespace origin $::tcl::x] - + # special case so that global names have no leading # ::, this is required by the unknown command - + set ::tcl::abs \ [lindex [auto_qualify $::tcl::abs ::] 0] - + if {$::tcl::x ne $::tcl::abs} { # Name changed during qualification - + set ::tcl::newCmds($::tcl::abs) 1 unset ::tcl::newCmds($::tcl::x) } @@ -437,7 +437,7 @@ proc tclPkgSetup {dir pkg version files} { set auto_index($cmd) [list load [file join $dir $f] $pkg] } else { set auto_index($cmd) [list source [file join $dir $f]] - } + } } } } @@ -466,7 +466,7 @@ proc tclPkgUnknown {name args} { set old_path [set use_path $auto_path] while {[llength $use_path]} { set dir [lindex $use_path end] - + # Make sure we only scan each directory one time. if {[info exists tclSeenPath($dir)]} { set use_path [lrange $use_path 0 end-1] @@ -500,7 +500,7 @@ proc tclPkgUnknown {name args} { set dir [lindex $use_path end] if {![info exists procdDirs($dir)]} { set file [file join $dir pkgIndex.tcl] - # safe interps usually don't have "file exists", + # safe interps usually don't have "file exists", if {([interp issafe] || [file exists $file])} { set code [catch {source $file} msg opt] if {$code == 1 && @@ -653,11 +653,11 @@ proc tcl::MacOSXPkgUnknown {original name args} { # # Any number of -load and -source parameters may be # specified, so long as there is at least one -load or -# -source parameter. If the procs component of a +# -source parameter. If the procs component of a # module specifier is left off, that module will be # set up for direct loading; otherwise, it will be # set up for lazy loading. If both -source and -load -# are specified, the -load'ed files will be loaded +# are specified, the -load'ed files will be loaded # first, followed by the -source'd files. # # Results: @@ -679,7 +679,7 @@ proc ::tcl::Pkg::Create {args} { if { $len < 6 } { error $err(wrongNumArgs) } - + # Initialize parameters array set opts {-name {} -version {} -source {} -load {}} @@ -715,14 +715,14 @@ proc ::tcl::Pkg::Create {args} { if { [llength $opts(-version)] == 0 } { error [format $err(valueMissing) "-version"] } - + if { [llength $opts(-source)] == 0 && [llength $opts(-load)] == 0 } { error $err(noLoadOrSource) } # OK, now everything is good. Generate the package ifneeded statment. set cmdline "package ifneeded $opts(-name) $opts(-version) " - + set cmdList {} set lazyFileList {} @@ -730,7 +730,7 @@ proc ::tcl::Pkg::Create {args} { foreach key {load source} { foreach filespec $opts(-$key) { lassign $filespec filename proclist - + if { [llength $proclist] == 0 } { set cmd "\[list $key \[file join \$dir [list $filename]\]\]" lappend cmdList $cmd @@ -748,4 +748,4 @@ proc ::tcl::Pkg::Create {args} { return $cmdline } -interp alias {} ::pkg::create {} ::tcl::Pkg::Create +interp alias {} ::pkg::create {} ::tcl::Pkg::Create diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index d510541..8dd91ee 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -331,7 +331,7 @@ proc ::platform::patterns {id} { lappend res macosx-universal macosx-i386-x86_64 } macosx*-* { - # 10.5+ + # 10.5+ if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} { switch -exact -- $cpu { diff --git a/library/safe.tcl b/library/safe.tcl index 1a340a1..2dd4aed 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -4,7 +4,7 @@ # It implements a virtual path mecanism to hide the real pathnames from the # slave. It runs in a master interpreter and sets up data structure and # aliases that will be invoked when used from a slave interpreter. -# +# # See the safe.n man page for details. # # Copyright (c) 1996-1997 Sun Microsystems, Inc. @@ -36,7 +36,7 @@ proc ::safe::InterpStatics {} { upvar $v $v } set flag [::tcl::OptProcArgGiven -noStatics] - if {$flag && (!$noStatics == !$statics) + if {$flag && (!$noStatics == !$statics) && ([::tcl::OptProcArgGiven -statics])} { return -code error\ "conflicting values given for -statics and -noStatics" @@ -57,7 +57,7 @@ proc ::safe::InterpNested {} { set flag [::tcl::OptProcArgGiven -nestedLoadOk] # note that the test here is the opposite of the "InterpStatics" one # (it is not -noNested... because of the wanted default value) - if {$flag && (!$nestedLoadOk != !$nested) + if {$flag && (!$nestedLoadOk != !$nested) && ([::tcl::OptProcArgGiven -nested])} { return -code error\ "conflicting values given for -nested and -nestedLoadOk" @@ -238,7 +238,7 @@ proc ::safe::interpConfigure {args} { # # Returns the slave name. # -# Optional Arguments : +# Optional Arguments : # + slave name : if empty, generated name will be used # + access_path: path list controlling where load/source can occur, # if empty: the master auto_path will be used. @@ -249,7 +249,7 @@ proc ::safe::interpConfigure {args} { # use the full name and no indent so auto_mkIndex can find us proc ::safe::InterpCreate { - slave + slave access_path staticsok nestedok @@ -424,7 +424,7 @@ proc ::safe::interpAddToAccessPath {slave path} { # interpreter. It is useful when you want to install the safe base aliases # into a preexisting safe interpreter. proc ::safe::InterpInit { - slave + slave access_path staticsok nestedok @@ -563,7 +563,7 @@ proc ::safe::interpDelete {slave} { return } -# Set (or get) the logging mecanism +# Set (or get) the logging mecanism proc ::safe::setLogCmd {args} { variable Log @@ -823,7 +823,7 @@ proc ::safe::AliasSource {slave args} { return -code error $msg } set file [lindex $args $at] - + # get the real path from the virtual one. if {[catch { set realfile [TranslatePath $slave $file] @@ -831,7 +831,7 @@ proc ::safe::AliasSource {slave args} { Log $slave $msg return -code error "permission denied" } - + # check that the path is in the access path of that slave if {[catch { FileInAccessPath $slave $realfile diff --git a/library/tm.tcl b/library/tm.tcl index 7b9cafe..87db0df 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -191,7 +191,7 @@ proc ::tcl::tm::list {} { proc ::tcl::tm::UnknownHandler {original name args} { # Import the list of paths to search for packages in module form. - # Import the pattern used to check package names in detail. + # Import the pattern used to check package names in detail. variable paths variable pkgpattern -- cgit v0.12 From 48e066711f2f019314605b45c4b136118d9c1b45 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 13:44:52 +0000 Subject: Mutch simpler solution to [219866c1e9]: In stead of filtering out version information from the string, make sure that ::platform::generic doesn't contain this version information in the first place. --- library/platform/platform.tcl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl index 8dd91ee..c596e60 100644 --- a/library/platform/platform.tcl +++ b/library/platform/platform.tcl @@ -93,10 +93,13 @@ proc ::platform::generic {} { } } - switch -- $plat { + switch -glob -- $plat { + cygwin* { + set plat cygwin + } windows { if {$tcl_platform(platform) == "unix"} { - set plat cygwin_nt + set plat cygwin } else { set plat win32 } @@ -104,7 +107,6 @@ proc ::platform::generic {} { # Do not check wordSize, win32-x64 is an IL32P64 platform. set cpu x86_64 } - append plat -$tcl_platform(osVersion) } sunos { set plat solaris @@ -163,12 +165,9 @@ proc ::platform::identify {} { global tcl_platform set id [generic] - regexp {^([^-]+)(-[0-9\.]+)?(-wow)?-([^-]+)$} $id -> plat ver wow cpu + regexp {^([^-]+)-([^-]+)$} $id -> plat ver wow cpu switch -- $plat { - cygwin_nt { - return "${plat}-${cpu}" - } solaris { regsub {^5} $tcl_platform(osVersion) 2 text append plat $text -- cgit v0.12 From 03a3a2d78e1c26683170d32685d3f4d3b9ed902d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 1 Oct 2015 11:04:19 +0000 Subject: Eliminate a few gcc compiler warnings, when using -Wwrite-strings (tested with the brand-new gcc 5.2.0) --- generic/tclCmdAH.c | 8 ++++---- generic/tclCmdMZ.c | 6 ++++-- generic/tclExecute.c | 30 +++++++++++++++--------------- generic/tclLiteral.c | 11 ++++++----- generic/tclObj.c | 42 +++++++++++++++++++++--------------------- generic/tclTest.c | 6 +++--- unix/tclUnixChan.c | 10 +++++----- unix/tclUnixNotfy.c | 2 +- unix/tclUnixTest.c | 2 +- 9 files changed, 60 insertions(+), 57 deletions(-) diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 7f0df83..5484002 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -25,7 +25,7 @@ static int EncodingDirsObjCmd(ClientData dummy, Tcl_Obj *const objv[]); static int GetStatBuf(Tcl_Interp *interp, Tcl_Obj *pathPtr, Tcl_FSStatProc *statProc, Tcl_StatBuf *statPtr); -static char * GetTypeFromMode(int mode); +static const char * GetTypeFromMode(int mode); static int StoreStatData(Tcl_Interp *interp, Tcl_Obj *varName, Tcl_StatBuf *statPtr); @@ -1289,7 +1289,7 @@ Tcl_FileObjCmd( return TCL_ERROR; } if (objc == 2) { - char *separator = NULL; /* lint */ + const char *separator = NULL; /* lint */ switch (tclPlatform) { case TCL_PLATFORM_UNIX: @@ -1554,7 +1554,7 @@ StoreStatData( *---------------------------------------------------------------------- */ -static char * +static const char * GetTypeFromMode( int mode) { @@ -1757,7 +1757,7 @@ Tcl_ForeachObjCmd( maxj = 0; for (i=0 ; imarkerPtr = tmpMarkerPtr; - memStart = tmpMarkerPtr + offset; + memStart = tmpMarkerPtr + offset; esPtr->tosPtr = memStart - 1; *esPtr->markerPtr = (Tcl_Obj *) markerPtr; return memStart; @@ -982,7 +982,7 @@ GrowEvaluationStack( esPtr->markerPtr = &esPtr->stackWords[0]; memStart = MEMSTART(esPtr->markerPtr); esPtr->tosPtr = memStart - 1; - + if (move) { memcpy(memStart, MEMSTART(markerPtr), moveWords*sizeof(Tcl_Obj *)); esPtr->tosPtr += moveWords; @@ -1486,19 +1486,19 @@ TclCompEvalObj( * Note: Type BC => ctx.data.eval.path is not used. * ctx.data.tebc.codePtr used instead */ - + TclGetSrcInfoForPc(ctxPtr); if (ctxPtr->type == TCL_LOCATION_SOURCE) { /* * The reference made by 'TclGetSrcInfoForPc' is * dead. */ - + Tcl_DecrRefCount(ctxPtr->data.eval.path); ctxPtr->data.eval.path = NULL; } } - + if (word < ctxPtr->nline) { /* * Note: We do not care if the line[word] is -1. This @@ -1510,15 +1510,15 @@ TclCompEvalObj( * test info-32.0 using literal of info-24.8 * (dict with ... vs set body ...). */ - + redo = ((eclPtr->type == TCL_LOCATION_SOURCE) && (eclPtr->start != ctxPtr->line[word])) || ((eclPtr->type == TCL_LOCATION_BC) && (ctxPtr->type == TCL_LOCATION_SOURCE)); } - + TclStackFree(interp, ctxPtr); - + if (redo) { goto recompileObj; } @@ -1778,7 +1778,7 @@ TclExecuteByteCode( int traceInstructions = (tclTraceExec == 3); char cmdNameBuf[21]; #endif - char *curInstName = NULL; + const char *curInstName = NULL; /* * The execution uses a unified stack: first the catch stack, immediately @@ -5802,9 +5802,9 @@ TclExecuteByteCode( /* * We refuse to accept exponent arguments that exceed * one mp_digit which means the max exponent value is - * 2**28-1 = 0x0fffffff = 268435455, which fits into + * 2**28-1 = 0x0fffffff = 268435455, which fits into * a signed 32 bit int which is within the range of the - * long int type. This means any numeric Tcl_Obj value + * long int type. This means any numeric Tcl_Obj value * not using TCL_NUMBER_LONG type must hold a value larger * than we accept. */ diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 6a617b0..fb7c28a 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -153,7 +153,7 @@ TclDeleteLiteralTable( * Find, or if necessary create, an object in the interpreter's literal * table that has a string representation matching the argument * string. If nsPtr!=NULL then only literals stored for the namespace are - * considered. + * considered. * * Results: * The literal object. If it was created in this call *newPtr is set to @@ -161,7 +161,7 @@ TclDeleteLiteralTable( * * Side effects: * Increments the ref count of the global LiteralEntry since the caller - * now holds a reference. + * now holds a reference. * If LITERAL_ON_HEAP is set in flags, this function is given ownership * of the string: if an object is created then its string representation * is set directly from string, otherwise the string is freed. Typically, @@ -186,7 +186,7 @@ TclCreateLiteral( LiteralEntry *globalPtr; int globalHash; Tcl_Obj *objPtr; - + /* * Is it in the interpreter's global literal table? */ @@ -709,7 +709,7 @@ ExpandLocalLiteralArray( if (currArrayPtr != newArrayPtr) { for (i=0 ; inumBuckets; oldBuckets = tablePtr->buckets; diff --git a/generic/tclObj.c b/generic/tclObj.c index d278b1f..230842a 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -569,7 +569,7 @@ TclContinuationsEnter(Tcl_Obj* objPtr, Tcl_HashEntry* hPtr = Tcl_CreateHashEntry (tsdPtr->lineCLPtr, (char*) objPtr, &newEntry); - ContLineLoc* clLocPtr = + ContLineLoc* clLocPtr = (ContLineLoc*) ckalloc (sizeof(ContLineLoc) + num*sizeof(int)); if (!newEntry) { @@ -675,7 +675,7 @@ TclContinuationsEnterDerived(Tcl_Obj* objPtr, int start, int* clNext) num = wordCLLast - clNext; if (num) { int i; - ContLineLoc* clLocPtr = + ContLineLoc* clLocPtr = TclContinuationsEnter(objPtr, num, clNext); /* @@ -1371,10 +1371,10 @@ TclFreeObj( */ objPtr->refCount = -1; - /* Invalidate the string rep first so we can use the bytes value + /* Invalidate the string rep first so we can use the bytes value * for our pointer chain, and signal an obj deletion (as opposed - * to shimmering) with 'length == -1' */ - + * to shimmering) with 'length == -1' */ + TclInvalidateStringRep(objPtr); objPtr->length = -1; @@ -1436,13 +1436,13 @@ void TclFreeObj( register Tcl_Obj *objPtr) /* The object to be freed. */ { - /* Invalidate the string rep first so we can use the bytes value + /* Invalidate the string rep first so we can use the bytes value * for our pointer chain, and signal an obj deletion (as opposed - * to shimmering) with 'length == -1' */ + * to shimmering) with 'length == -1' */ TclInvalidateStringRep(objPtr); objPtr->length = -1; - + if (!objPtr->typePtr || !objPtr->typePtr->freeIntRepProc) { /* * objPtr can be freed safely, as it will not attempt to free any @@ -2799,7 +2799,7 @@ Tcl_GetLongFromObj( tooLarge: #endif if (interp != NULL) { - char *s = "integer value too large to represent"; + const char *s = "integer value too large to represent"; Tcl_Obj *msg = Tcl_NewStringObj(s, -1); Tcl_SetObjResult(interp, msg); @@ -3098,7 +3098,7 @@ Tcl_GetWideIntFromObj( } } if (interp != NULL) { - char *s = "integer value too large to represent"; + const char *s = "integer value too large to represent"; Tcl_Obj* msg = Tcl_NewStringObj(s, -1); Tcl_SetObjResult(interp, msg); @@ -4084,7 +4084,7 @@ Tcl_GetCommandFromObj( * is not deleted. * * If any check fails, then force another conversion to the command type, - * to discard the old rep and create a new one. + * to discard the old rep and create a new one. */ resPtr = (ResolvedCmdName *) objPtr->internalRep.twoPtrValue.ptr1; @@ -4094,15 +4094,15 @@ Tcl_GetCommandFromObj( || (cmdPtr->flags & CMD_IS_DELETED) || (interp != cmdPtr->nsPtr->interp) || (cmdPtr->nsPtr->flags & NS_DYING) - || ((resPtr->refNsPtr != NULL) && + || ((resPtr->refNsPtr != NULL) && (((refNsPtr = (Namespace *) TclGetCurrentNamespace(interp)) != resPtr->refNsPtr) || (resPtr->refNsId != refNsPtr->nsId) || (resPtr->refNsCmdEpoch != refNsPtr->cmdRefEpoch))) ) { - + result = tclCmdNameType.setFromAnyProc(interp, objPtr); - + resPtr = (ResolvedCmdName *) objPtr->internalRep.twoPtrValue.ptr1; if ((result == TCL_OK) && resPtr) { cmdPtr = resPtr->cmdPtr; @@ -4110,7 +4110,7 @@ Tcl_GetCommandFromObj( cmdPtr = NULL; } } - + return (Tcl_Command) cmdPtr; } @@ -4162,7 +4162,7 @@ TclSetCmdNameObj( if ((*name++ == ':') && (*name == ':')) { /* * The name is fully qualified: set the referring namespace to - * NULL. + * NULL. */ resPtr->refNsPtr = NULL; @@ -4172,7 +4172,7 @@ TclSetCmdNameObj( */ currNsPtr = iPtr->varFramePtr->nsPtr; - + resPtr->refNsPtr = currNsPtr; resPtr->refNsId = currNsPtr->nsId; resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; @@ -4332,7 +4332,7 @@ SetCmdNameFromAny( /* * Reuse the old ResolvedCmdName struct instead of freeing it */ - + Command *oldCmdPtr = resPtr->cmdPtr; if (--oldCmdPtr->refCount == 0) { TclCleanupCommandMacro(oldCmdPtr); @@ -4349,8 +4349,8 @@ SetCmdNameFromAny( resPtr->cmdEpoch = cmdPtr->cmdEpoch; if ((*name++ == ':') && (*name == ':')) { /* - * The name is fully qualified: set the referring namespace to - * NULL. + * The name is fully qualified: set the referring namespace to + * NULL. */ resPtr->refNsPtr = NULL; @@ -4360,7 +4360,7 @@ SetCmdNameFromAny( */ currNsPtr = iPtr->varFramePtr->nsPtr; - + resPtr->refNsPtr = currNsPtr; resPtr->refNsId = currNsPtr->nsId; resPtr->refNsCmdEpoch = currNsPtr->cmdRefEpoch; diff --git a/generic/tclTest.c b/generic/tclTest.c index 5b51baa..1d92ff5 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -909,7 +909,7 @@ TestasyncCmd( static int AsyncHandlerProc( - ClientData clientData, /* If of TestAsyncHandler structure. + ClientData clientData, /* If of TestAsyncHandler structure. * in global list. */ Tcl_Interp *interp, /* Interpreter in which command was * executed, or NULL. */ @@ -3606,7 +3606,7 @@ PrintParse( Tcl_Parse *parsePtr) /* Parse structure to print out. */ { Tcl_Obj *objPtr; - char *typeString; + const char *typeString; Tcl_Token *tokenPtr; int i; @@ -6518,7 +6518,7 @@ TestGetIndexFromObjStructObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char *ary[] = { + const char *ary[] = { "a", "b", "c", "d", "e", "f", NULL, NULL }; int idx,target; diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index a0d9811..8448b77 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -2181,7 +2181,7 @@ TcpGetOptionProc( * We don't want to resolve INADDR_ANY; it can sometimes cause * problems (and never has a name). */ - + hostEntPtr = NULL; } else { hostEntPtr = TclpGetHostByAddr( /* INTL: Native. */ @@ -2292,7 +2292,7 @@ TcpWatchProc( * to the guarantees Tcl makes that its channels become * writable and fire writable events on an error conditon. * This has caused a leak of file descriptors in a state of - * background flushing. See Tcl ticket 1758a0b603. + * background flushing. See Tcl ticket 1758a0b603. * * As a workaround, when our caller indicates an interest in * writable notifications, we must tell the notifier built @@ -2303,7 +2303,7 @@ TcpWatchProc( * channel states and report the chan events as best it can. * We save a copy of the mask passed in to assist with that. */ - + statePtr->interest = mask; Tcl_CreateFileHandler(statePtr->fd, mask|TCL_READABLE, (Tcl_FileProc *) WrapNotify, (ClientData) statePtr); @@ -2927,7 +2927,7 @@ TclpGetDefaultStdChannel( Tcl_Channel channel = NULL; int fd = 0; /* Initializations needed to prevent */ int mode = 0; /* compiler warning (used before set). */ - char *bufMode = NULL; + const char *bufMode = NULL; /* * Some #def's to make the code a little clearer! @@ -3216,7 +3216,7 @@ TclUnixWaitForFile( if (FD_ISSET(fd, &writableMask)) { SET_BITS(result, TCL_WRITABLE); } - if (FD_ISSET(fd, &exceptionalMask)) { + if (FD_ISSET(fd, &exceptionalMask)) { SET_BITS(result, TCL_EXCEPTION); } result &= mask; diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 5c7f8b5..2df704b 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -238,7 +238,7 @@ typedef struct { void *hCursor; void *hbrBackground; void *lpszMenuName; - void *lpszClassName; + const void *lpszClassName; } WNDCLASS; extern void __stdcall CloseHandle(void *); diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index 0747c2d..722ded9 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -53,7 +53,7 @@ static Pipe testPipes[MAX_PIPES]; * The stuff below is used by the testalarm and testgotsig ommands. */ -static char *gotsig = "0"; +static const char *gotsig = "0"; /* * Forward declarations of functions defined later in this file: -- cgit v0.12 From 5cfe99ddfef51d700eee80c9f766fab9c458038e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 4 Oct 2015 10:10:58 +0000 Subject: Eliminate unnessessary end-of-line spacing. No functional change. --- generic/tclCompCmds.c | 4 +- generic/tclDictObj.c | 2 +- generic/tclEvent.c | 2 +- generic/tclFCmd.c | 2 +- generic/tclHistory.c | 8 +- generic/tclParse.c | 2 +- generic/tclStrToD.c | 198 ++++++++++++++++++++++----------------------- generic/tclStringObj.c | 4 +- generic/tclThreadStorage.c | 12 +-- generic/tclUtil.c | 50 ++++++------ unix/tclUnixNotfy.c | 2 +- 11 files changed, 143 insertions(+), 143 deletions(-) diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 106c293..3b234b0 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -5913,7 +5913,7 @@ TclCompileGlobalCmd( return TCL_ERROR; } - /* TODO: Consider what values can pass through the + /* TODO: Consider what values can pass through the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); @@ -5988,7 +5988,7 @@ TclCompileVariableCmd( return TCL_ERROR; } - /* TODO: Consider what values can pass through the + /* TODO: Consider what values can pass through the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 4adc5ce..4fec2c1 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -593,7 +593,7 @@ SetDictFromAny( } for (i=0 ; itype = TCL_TOKEN_SIMPLE_WORD; tokenPtr->numComponents = 1; diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index ec5e764..cff9bdd 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -64,7 +64,7 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); /* * MIPS floating-point units need special settings in control registers * to use gradual underflow as we expect. This fix is for the MIPSpro - * compiler. + * compiler. */ #if defined(__sgi) && defined(_COMPILER_VERSION) #include @@ -102,7 +102,7 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); /* Mask for the exponent field in the * first word of a double */ #define EXP_SHIFT 20 - /* Shift count to make the exponent an + /* Shift count to make the exponent an * integer */ #define HIDDEN_BIT (((Tcl_WideUInt) 0x00100000) << 32) /* Hidden 1 bit for the significand */ @@ -263,7 +263,7 @@ static const Tcl_WideUInt wuipow5[27] = { * Static functions defined in this file. */ -static int AccumulateDecimalDigit(unsigned, int, +static int AccumulateDecimalDigit(unsigned, int, Tcl_WideUInt *, mp_int *, int); static double MakeHighPrecisionDouble(int signum, mp_int *significand, int nSigDigs, int exponent); @@ -286,7 +286,7 @@ static void ComputeScale(int, int, int*, int*, int*, int*); static void SetPrecisionLimits(int, int, int*, int*, int*, int*); static char* BumpUp(char*, char*, int*); static int AdjustRange(double*, int); -static char* ShorteningQuickFormat(double, int, int, double, +static char* ShorteningQuickFormat(double, int, int, double, char*, int*); static char* StrictQuickFormat(double, int, int, double, char*, int*); @@ -302,15 +302,15 @@ static char* StrictInt64Conversion(Double*, int, Tcl_WideUInt, static int ShouldBankerRoundUpPowD(mp_int*, int, int); static int ShouldBankerRoundUpToNextPowD(mp_int*, mp_int*, int, int, int, mp_int*); -static char* ShorteningBignumConversionPowD(Double* dPtr, +static char* ShorteningBignumConversionPowD(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, int b5, int m2plus, int m2minus, int m5, - int sd, int k, int len, + int sd, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static char* StrictBignumConversionPowD(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, int b5, - int sd, int k, int len, + int sd, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static int ShouldBankerRoundUp(mp_int*, mp_int*, int); @@ -319,12 +319,12 @@ static int ShouldBankerRoundUpToNext(mp_int*, mp_int*, mp_int*, static char* ShorteningBignumConversion(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, int m2plus, int m2minus, - int s2, int s5, int k, int len, + int s2, int s5, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static char* StrictBignumConversion(Double* dPtr, int convType, Tcl_WideUInt bw, int b2, - int s2, int s5, int k, int len, + int s2, int s5, int k, int len, int ilim, int ilim1, int* decpt, char** endPtr); static double BignumToBiasedFrExp(mp_int *big, int *machexp); @@ -1905,7 +1905,7 @@ RefineApproximation( if ((rteSigWide & 1) == 0) { return approxResult; } - } + } /* * Convert the numerator and denominator of the corrector term accurately @@ -1994,7 +1994,7 @@ NormalizeRightward(Tcl_WideUInt* wPtr) Tcl_WideUInt w = *wPtr; if (!(w & (Tcl_WideUInt) 0xffffffff)) { w >>= 32; rv += 32; - } + } if (!(w & (Tcl_WideUInt) 0xffff)) { w >>= 16; rv += 16; } @@ -2145,7 +2145,7 @@ TakeAbsoluteValue(Double* d, /* Number to replace with absolute value */ * * Side effects: * Stores 9999 in *decpt, and sets '*endPtr' to designate the - * terminating NUL byte of the string if 'endPtr' is not NULL. + * terminating NUL byte of the string if 'endPtr' is not NULL. * * The string returned must be freed by the caller using 'ckfree'. * @@ -2233,8 +2233,8 @@ ApproximateLog10(Tcl_WideUInt bw, /* * Compute i and d2 such that d = d2*2**i, and 1 < d2 < 2. - * Compute an approximation to log10(d), - * log10(d) ~ log10(2) * i + log10(1.5) + * Compute an approximation to log10(d), + * log10(d) ~ log10(2) * i + log10(1.5) * + (significand-1.5)/(1.5 * log(10)) */ @@ -2274,7 +2274,7 @@ BetterLog10(double d, /* Original number to format */ int k, /* Characteristic(Log base 10) of the number */ int* k_check) /* Flag == 1 if k is inexact */ { - /* + /* * Performance hack. If k is in the range 0..TEN_PMAX, then we can * use a powers-of-ten table to check it. */ @@ -2318,7 +2318,7 @@ ComputeScale(int be, /* Exponent part of number: d = bw * 2**be */ int* s5) /* OUTPUT: Power of 5 in the denominator */ { - /* + /* * Scale numerator and denominator powers of 2 so that the * input binary number is the ratio of integers */ @@ -2330,7 +2330,7 @@ ComputeScale(int be, /* Exponent part of number: d = bw * 2**be */ *s2 = 0; } - /* + /* * Scale numerator and denominator so that the output decimal number * is the ratio of integers */ @@ -2438,7 +2438,7 @@ SetPrecisionLimits(int convType, inline static char* BumpUp(char* s, /* Cursor pointing one past the end of the - * string */ + * string */ char* retval, /* Start of the string of digits */ int* kPtr) /* Position of the decimal point */ { @@ -2527,7 +2527,7 @@ AdjustRange(double* dPtr, /* INOUT: Number to adjust */ * * Returns a 'quick' format of a double precision number to a string * of digits, preferring a shorter string of digits if the shorter - * string is still within 1/2 ulp of the number. + * string is still within 1/2 ulp of the number. * * Results: * Returns the string of digits. Returns NULL if the 'quick' method @@ -2638,7 +2638,7 @@ StrictQuickFormat(double d, /* Number to convert */ } *s++ = '0' + digit; - /* + /* * When the given digit count is reached, handle trailing strings * of 0 and 9. */ @@ -2852,13 +2852,13 @@ ShorteningInt64Conversion(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ Tcl_WideUInt b = (bw * wuipow5[b5]) << b2; /* Numerator of the fraction being converted */ Tcl_WideUInt S = wuipow5[s5] << s2; - /* Denominator of the fraction being + /* Denominator of the fraction being * converted */ Tcl_WideUInt mplus, mminus; /* Ranges for testing whether the result * is within roundoff of being exact */ @@ -2890,7 +2890,7 @@ ShorteningInt64Conversion(Double* dPtr, } b = b % S; - /* + /* * Does the current digit put us on the low side of the exact value * but within within roundoff of being exact? */ @@ -2948,16 +2948,16 @@ ShorteningInt64Conversion(Double* dPtr, } break; } - + /* Advance to the next digit */ - + b = 10 * b; mplus = 10 * mplus; mminus = 10 * mminus; ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3020,13 +3020,13 @@ StrictInt64Conversion(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ Tcl_WideUInt b = (bw * wuipow5[b5]) << b2; /* Numerator of the fraction being converted */ Tcl_WideUInt S = wuipow5[s5] << s2; - /* Denominator of the fraction being + /* Denominator of the fraction being * converted */ int digit; /* Current output digit */ char* s = retval; /* Cursor in the output buffer */ @@ -3066,14 +3066,14 @@ StrictInt64Conversion(Double* dPtr, } break; } - + /* Advance to the next digit */ - + b = 10 * b; ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3144,10 +3144,10 @@ ShouldBankerRoundUpToNextPowD(mp_int* b, /* Numerator of the fraction */ mp_int* m, /* Numerator of the rounding tolerance */ - int sd, + int sd, /* Common denominator is 2**(sd*DIGIT_BIT) */ int convType, - /* Conversion type: STEELE defeats + /* Conversion type: STEELE defeats * round-to-even (Not sure why one wants to * do this; I copied it from Gay) FIXME */ int isodd, @@ -3157,7 +3157,7 @@ ShouldBankerRoundUpToNextPowD(mp_int* b, { int i; - /* + /* * Compare B and S-m -- which is the same as comparing B+m and S -- * which we do by computing b+m and doing a bitwhack compare against * 2**(DIGIT_BIT*sd) @@ -3238,7 +3238,7 @@ ShorteningBignumConversionPowD(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ mp_int b; /* Numerator of the fraction being converted */ @@ -3249,7 +3249,7 @@ ShorteningBignumConversionPowD(Double* dPtr, mp_int temp; int r1; - /* + /* * b = bw * 2**b2 * 5**b5 * mminus = 5**m5 */ @@ -3296,11 +3296,11 @@ ShorteningBignumConversionPowD(Double* dPtr, --b.used; mp_clamp(&b); } - /* + /* * Does the current digit put us on the low side of the exact value * but within within roundoff of being exact? */ - + r1 = mp_cmp_mag(&b, (m2plus > m2minus)? &mplus : &mminus); if (r1 == MP_LT || (r1 == MP_EQ @@ -3329,8 +3329,8 @@ ShorteningBignumConversionPowD(Double* dPtr, * Does one plus the current digit put us within roundoff of the * number? */ - - if (ShouldBankerRoundUpToNextPowD(&b, &mminus, sd, + + if (ShouldBankerRoundUpToNextPowD(&b, &mminus, sd, convType, dPtr->w.word1 & 1, &temp)) { if (digit == 9) { @@ -3353,9 +3353,9 @@ ShorteningBignumConversionPowD(Double* dPtr, } break; } - + /* Advance to the next digit */ - + mp_mul_d(&b, 10, &b); mp_mul_d(&mminus, 10, &mminus); if (m2plus > m2minus) { @@ -3364,7 +3364,7 @@ ShorteningBignumConversionPowD(Double* dPtr, ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3388,7 +3388,7 @@ ShorteningBignumConversionPowD(Double* dPtr, * Converts a double-precision number to a fixed-lengt string of * 'ilim' digits (or 'ilim1' if log10(d) has been overestimated.) * The denominator in David Gay's conversion algorithm is known to - * be a power of 2**DIGIT_BIT, and hence the division in the main + * be a power of 2**DIGIT_BIT, and hence the division in the main * loop may be replaced by a digit shift and mask. * * Results: @@ -3430,7 +3430,7 @@ StrictBignumConversionPowD(Double* dPtr, /* OUTPUT: Position of the terminal '\0' * at the end of the returned string */ { - + char* retval = ckalloc(len + 1); /* Output buffer */ mp_int b; /* Numerator of the fraction being converted */ @@ -3439,7 +3439,7 @@ StrictBignumConversionPowD(Double* dPtr, int i; /* Index in the output buffer */ mp_int temp; - /* + /* * b = bw * 2**b2 * 5**b5 */ @@ -3456,9 +3456,9 @@ StrictBignumConversionPowD(Double* dPtr, } mp_init(&temp); - /* + /* * Loop through the digits. Do division and mod by s == 2**(sd*DIGIT_BIT) - * by mp_digit extraction + * by mp_digit extraction */ i = 1; @@ -3488,14 +3488,14 @@ StrictBignumConversionPowD(Double* dPtr, } break; } - + /* Advance to the next digit */ - + mp_mul_d(&b, 10, &b); ++i; } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3592,7 +3592,7 @@ ShouldBankerRoundUpToNext(mp_int* b, Tcl_Panic("in ShouldBankerRoundUpToNext, trichotomy fails!"); return 0; } - + /* *----------------------------------------------------------------------------- * @@ -3662,10 +3662,10 @@ ShorteningBignumConversion(Double* dPtr, MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S); /* - * Handle the case where we guess the position of the decimal point - * wrong. + * Handle the case where we guess the position of the decimal point + * wrong. */ - + if (mp_cmp_mag(&b, &S) == MP_LT) { mp_mul_d(&b, 10, &b); minit = 10; @@ -3694,7 +3694,7 @@ ShorteningBignumConversion(Double* dPtr, } digit = dig.dp[0]; - /* + /* * Does the current digit leave us with a remainder small enough to * round to it? */ @@ -3740,7 +3740,7 @@ ShorteningBignumConversion(Double* dPtr, if (i == ilim) { mp_mul_2d(&b, 1, &b); if (ShouldBankerRoundUp(&b, &S, digit&1)) { - s = BumpUp(s, retval, &k); + s = BumpUp(s, retval, &k); } break; } @@ -3757,7 +3757,7 @@ ShorteningBignumConversion(Double* dPtr, } mp_div_d(&S, 5, &S, NULL); --s5; - /* + /* * IDEA: It might possibly be a win to fall back to * int64 arithmetic here if S < 2**64/10. But it's * a win only for a fairly narrow range of magnitudes @@ -3767,7 +3767,7 @@ ShorteningBignumConversion(Double* dPtr, * Possible savings: * 10**26 1 trip through loop before fallback possible * 10**27 1 trip - * 10**28 2 trips + * 10**28 2 trips * 10**29 3 trips * 10**30 4 trips * 10**31 5 trips @@ -3796,7 +3796,7 @@ ShorteningBignumConversion(Double* dPtr, } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -3812,7 +3812,7 @@ ShorteningBignumConversion(Double* dPtr, return retval; } - + /* *----------------------------------------------------------------------------- * @@ -3862,7 +3862,7 @@ StrictBignumConversion(Double* dPtr, mp_int temp; /* Work area */ int g; /* Size of the current digit groun */ int i, j; - + /* * b = bw * 2**b2 * 5**b5 * S = 2**s2 * 5*s5 @@ -3875,10 +3875,10 @@ StrictBignumConversion(Double* dPtr, MulPow5(&S, s5, &S); mp_mul_2d(&S, s2, &S); /* - * Handle the case where we guess the position of the decimal point - * wrong. + * Handle the case where we guess the position of the decimal point + * wrong. */ - + if (mp_cmp_mag(&b, &S) == MP_LT) { mp_mul_d(&b, 10, &b); ilim =ilim1; @@ -3900,7 +3900,7 @@ StrictBignumConversion(Double* dPtr, if (++i >= ilim) { mp_mul_2d(&b, 1, &b); if (ShouldBankerRoundUp(&b, &S, digit&1)) { - s = BumpUp(s, retval, &k); + s = BumpUp(s, retval, &k); } } else { @@ -3923,7 +3923,7 @@ StrictBignumConversion(Double* dPtr, mp_mul_d(&b, dpow5[g], &b); } mp_mul_2d(&b, g, &b); - + /* * As with the shortening bignum conversion, it's possible at * this point that we will have reduced the denominator to @@ -3936,7 +3936,7 @@ StrictBignumConversion(Double* dPtr, */ /* Extract the next group of digits */ - + mp_div(&b, &S, &dig, &b); if (dig.used > 1) { Tcl_Panic("wrong digit!"); @@ -3948,24 +3948,24 @@ StrictBignumConversion(Double* dPtr, digit %= t; } i += g; - + /* Have we converted all the requested digits? */ - + if (i == ilim) { mp_mul_2d(&b, 1, &b); if (ShouldBankerRoundUp(&b, &S, digit&1)) { - s = BumpUp(s, retval, &k); + s = BumpUp(s, retval, &k); } else { while (*--s == '0') { /* do nothing */ } ++s; - } + } break; } } } - /* + /* * Endgame - store the location of the decimal point and the end of the * string. */ @@ -4009,7 +4009,7 @@ StrictBignumConversion(Double* dPtr, * TCL_DD_STEELE - This value is not recommended and may be removed * in the future. It follows the conversion algorithm outlined * in "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, + * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, * pp. 112-126]. This rule has the effect of rendering 1e23 * as 9.9999999999999999e22 - which is a 'better' approximation * in the sense that it will reconvert correctly even if @@ -4021,14 +4021,14 @@ StrictBignumConversion(Double* dPtr, * 'ndigits' digits, choosing the one that is closest to the * given number (and resolving ties with 'round to even'). * It is allowed to return fewer than 'ndigits' if the number - * converts exactly; if the TCL_DD_E_FORMAT|TCL_DD_SHORTEN_FLAG - * is supplied instead, it also returns fewer digits if the + * converts exactly; if the TCL_DD_E_FORMAT|TCL_DD_SHORTEN_FLAG + * is supplied instead, it also returns fewer digits if the * shorter string will still reconvert to the given input number. * In any case, strings of trailing zeroes are suppressed. * TCL_DD_F_FORMAT - This value is used to prepare numbers for %f * format conversion. It requests that conversion proceed until * 'ndigits' digits after the decimal point have been converted. - * It is possible for this format to result in a zero-length + * It is possible for this format to result in a zero-length * string if the number is sufficiently small. Again, it * is permissible for TCL_DD_F_FORMAT to return fewer digits * for a number that converts exactly, and changing the @@ -4045,12 +4045,12 @@ StrictBignumConversion(Double* dPtr, * midpoint between two decimal strings that more precision is needed * to resolve which string is correct. * - * The value stored in the 'decpt' argument on return may be negative - * (indicating that the decimal point falls to the left of the string) + * The value stored in the 'decpt' argument on return may be negative + * (indicating that the decimal point falls to the left of the string) * or greater than the length of the string. In addition, the value -9999 * is used as a sentinel to indicate that the string is one of the special * values "Infinity" and "NaN", and that no decimal point should be inserted. - * + * *----------------------------------------------------------------------------- */ char* @@ -4076,12 +4076,12 @@ TclDoubleDigits(double dv, /* Number to convert */ int denorm; /* Flag == 1 iff the input number was * denormalized */ int k; /* Estimate of floor(log10(d)) */ - int k_check; /* Flag == 1 if d is near enough to a + int k_check; /* Flag == 1 if d is near enough to a * power of ten that k must be checked */ int b2, b5, s2, s5; /* Powers of 2 and 5 in the numerator and * denominator of intermediate results */ int ilim = -1, ilim1 = -1; /* Number of digits to convert, and number - * to convert if log10(d) has been + * to convert if log10(d) has been * overestimated */ char* retval; /* Return value from this function */ int i = -1; @@ -4090,7 +4090,7 @@ TclDoubleDigits(double dv, /* Number to convert */ d.d = dv; - /* + /* * Handle the cases of negative numbers (by taking the absolute value: * this includes -Inf and -NaN!), infinity, Not a Number, and zero. */ @@ -4103,7 +4103,7 @@ TclDoubleDigits(double dv, /* Number to convert */ return FormatZero(decpt, endPtr); } - /* + /* * Unpack the floating point into a wide integer and an exponent. * Determine the number of bits that the big integer requires, and * compute a quick approximation (which may be one too high) of @@ -4116,12 +4116,12 @@ TclDoubleDigits(double dv, /* Number to convert */ /* At this point, we have: * d is the number to convert. - * bw are significand and exponent: d == bw*2**be, + * bw are significand and exponent: d == bw*2**be, * bbits is the length of bw: 2**bbits-1 <= bw < 2**bbits * k is either ceil(log10(d)) or ceil(log10(d))+1. k_check is 0 * if we know that k is exactly ceil(log10(d)) and 1 if we need to * check. - * We want a rational number + * We want a rational number * r = b * 10**(1-k) = bw * 2**b2 * 5**b5 / (2**s2 / 5**s5), * with b2, b5, s2, s5 >= 0. Note that the most significant decimal * digit is floor(r) and that successive digits can be obtained @@ -4149,7 +4149,7 @@ TclDoubleDigits(double dv, /* Number to convert */ SetPrecisionLimits(convType, k, &ndigits, &i, &ilim, &ilim1); - /* + /* * Try to do low-precision conversion in floating point rather * than resorting to expensive multiprecision arithmetic */ @@ -4161,7 +4161,7 @@ TclDoubleDigits(double dv, /* Number to convert */ } } - /* + /* * For shortening conversions, determine the upper and lower bounds * for the remainder at which we can stop. * m+ = (2**m2plus * 5**m5) / (2**s2 * 5**s5) is the limit on the @@ -4178,9 +4178,9 @@ TclDoubleDigits(double dv, /* Number to convert */ int m5 = b5; int len = i; - /* + /* * Find the quantity i so that (2**i*5**b5)/(2**s2*5**s5) - * is 1/2 unit in the least significant place of the floating + * is 1/2 unit in the least significant place of the floating * point number. */ if (denorm) { @@ -4191,7 +4191,7 @@ TclDoubleDigits(double dv, /* Number to convert */ b2 += i; s2 += i; - /* + /* * Reduce the fractions to lowest terms, since the above calculation * may have left excess powers of 2 in numerator and denominator */ @@ -4220,7 +4220,7 @@ TclDoubleDigits(double dv, /* Number to convert */ return ShorteningInt64Conversion(&d, convType, bw, b2, b5, m2plus, m2minus, m5, - s2, s5, k, len, ilim, ilim1, + s2, s5, k, len, ilim, ilim1, decpt, endPtr); } else if (s5 == 0) { /* @@ -4239,11 +4239,11 @@ TclDoubleDigits(double dv, /* Number to convert */ } return ShorteningBignumConversionPowD(&d, convType, bw, b2, b5, m2plus, m2minus, m5, - s2/DIGIT_BIT, k, len, + s2/DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr); } else { - /* + /* * Alas, there's no helpful special case; use full-up * bignum arithmetic for the conversion */ @@ -4279,7 +4279,7 @@ TclDoubleDigits(double dv, /* Number to convert */ */ return StrictInt64Conversion(&d, convType, bw, b2, b5, - s2, s5, k, len, ilim, ilim1, + s2, s5, k, len, ilim, ilim1, decpt, endPtr); } else if (s5 == 0) { @@ -4296,7 +4296,7 @@ TclDoubleDigits(double dv, /* Number to convert */ s2 += delta; } return StrictBignumConversionPowD(&d, convType, bw, b2, b5, - s2/DIGIT_BIT, k, len, + s2/DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr); } else { /* @@ -4308,7 +4308,7 @@ TclDoubleDigits(double dv, /* Number to convert */ return StrictBignumConversion(&d, convType, bw, b2, s2, s5, k, len, ilim, ilim1, decpt, endPtr); } - } + } } @@ -4558,7 +4558,7 @@ TclBignumToDouble( /* - * We need a 'mantBits'-bit significand. Determine what shift will + * We need a 'mantBits'-bit significand. Determine what shift will * give us that. */ @@ -4573,7 +4573,7 @@ TclBignumToDouble( } shift = mantBits - bits; - /* + /* * If shift > 0, shift the significand left by the requisite number of * bits. If shift == 0, the significand is already exactly 'mantBits' * in length. If shift < 0, we will need to shift the significand right diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 8c6a376..86f0c62 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1392,7 +1392,7 @@ AppendUnicodeToUnicodeRep( + stringPtr->uallocated / sizeof(Tcl_UniChar)) { offset = unicode - stringPtr->unicode; } - + GrowUnicodeBuffer(objPtr, numChars); stringPtr = GET_STRING(objPtr); @@ -1575,7 +1575,7 @@ AppendUtfToUtfRep( unsigned int limit = INT_MAX - newLength; unsigned int extra = numBytes + TCL_GROWTH_MIN_ALLOC; int growth = (int) ((extra > limit) ? limit : extra); - + Tcl_SetObjLength(objPtr, newLength + growth); } diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c index f1df888..1578b40 100644 --- a/generic/tclThreadStorage.c +++ b/generic/tclThreadStorage.c @@ -135,7 +135,7 @@ AllocThreadStorageEntry( hPtr = (Tcl_HashEntry *) TclpSysAlloc(sizeof(Tcl_HashEntry), 0); hPtr->key.oneWordValue = keyPtr; hPtr->clientData = NULL; - + return hPtr; } @@ -170,7 +170,7 @@ FreeThreadStorageEntry( * ThreadStorageGetHashTable -- * * This procedure returns a hash table pointer to be used for thread - * storage for the specified thread. + * storage for the specified thread. * * Results: * A hash table pointer for the specified thread, or NULL if the hash @@ -182,8 +182,8 @@ FreeThreadStorageEntry( * * Thread safety: * This function assumes that integer operations are safe (atomic) - * on all (currently) supported Tcl platforms. Hence there are - * places where shared integer arithmetic is done w/o protective locks. + * on all (currently) supported Tcl platforms. Hence there are + * places where shared integer arithmetic is done w/o protective locks. * *---------------------------------------------------------------------- */ @@ -205,12 +205,12 @@ ThreadStorageGetHashTable( * Thread safety: threadStorageCache is accessed w/o locks in order to * avoid serialization of all threads at this hot-spot. It is safe to * do this here because (threadStorageCache[index].id != id) test below - * should be atomic on all (currently) supported platforms and there + * should be atomic on all (currently) supported platforms and there * are no devastatig side effects of the test. * * Note Valgrind users: this place will show up as a race-condition in * helgrind-tool output. To silence this warnings, define VALGRIND - * symbol at compilation time. + * symbol at compilation time. */ #if !defined(VALGRIND) diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 8c6adfe..69d0b17 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -63,7 +63,7 @@ static ProcessGlobalValue executableName = { * CONVERT_MASK A mask value used to extract the conversion mode from * the flags argument. * Also indicates a strange conversion mode where all - * special characters are escaped with backslashes + * special characters are escaped with backslashes * *except for braces*. This is a strange and unnecessary * case, but it's part of the historical way in which * lists have been formatted in Tcl. To experiment with @@ -81,7 +81,7 @@ static ProcessGlobalValue executableName = { * in other cases this means an overestimate of the * required size. * - * For more details, see the comments on the Tcl*Scan*Element and + * For more details, see the comments on the Tcl*Scan*Element and * Tcl*Convert*Element routines. */ @@ -171,12 +171,12 @@ Tcl_ObjType tclEndOffsetType = { * rules similar to the parsing of the words of a command in a Tcl script. * Backslash substitution plays a key role, and is defined exactly as it is * in command parsing. The same routine, TclParseBackslash() is used in both - * command parsing and list parsing. + * command parsing and list parsing. * * NOTE: This means that if and when backslash substitution rules ever * change for command parsing, the interpretation of strings as lists also * changes. - * + * * Backslash substitution replaces an "escape sequence" of one or more * characters starting with * \u005c \ BACKSLASH @@ -189,7 +189,7 @@ Tcl_ObjType tclEndOffsetType = { * * * If the first character of a formatted substring is * \u007b { OPEN BRACE - * then the end of the substring is the matching + * then the end of the substring is the matching * \u007d } CLOSE BRACE * character, where matching is determined by counting nesting levels, * and not including any brace characters that are contained within a @@ -211,7 +211,7 @@ Tcl_ObjType tclEndOffsetType = { * that includes an unbalanced brace not in a backslash escape sequence, * and any value that ends with a backslash not itself in a backslash * escape sequence. - * + * * * If the first character of a formatted substring is * \u0022 " QUOTE * then the end of the substring is the next QUOTE character, not counting @@ -246,7 +246,7 @@ Tcl_ObjType tclEndOffsetType = { * minimum be able to produce escape sequences for the 10 characters * identified above that have significance to a list parser. * - * * * CANONICAL LISTS * * * * * + * * * CANONICAL LISTS * * * * * * * In addition to the basic rules for parsing strings into Tcl lists, there * are additional properties to be met by the set of list values that are @@ -297,7 +297,7 @@ Tcl_ObjType tclEndOffsetType = { * This sort of coding was once fairly common, though it's become more * idiomatic to see the following instead: * set script [list puts [list $one $two $three]]; eval $script - * In order to support this guarantee, every canonical list must have + * In order to support this guarantee, every canonical list must have * balance when counting those braces that are not in escape sequences. * * Within these constraints, the canonical list generation routines @@ -339,7 +339,7 @@ Tcl_ObjType tclEndOffsetType = { * #if COMPAT directives. This makes it easy to experiment with eliminating * this formatting mode simply with "#define COMPAT 0" above. I believe * this is worth considering. - * + * * Another consideration is the treatment of QUOTE characters in list elements. * TclConvertElement() must have the ability to produce the escape sequence * \" so that when a list element begins with a QUOTE we do not confuse @@ -396,7 +396,7 @@ TclMaxListLength( } /* No list element before leading white space */ - count += 1 - TclIsSpaceProc(*bytes); + count += 1 - TclIsSpaceProc(*bytes); /* Count white space runs as potential element separators */ while (numBytes) { @@ -420,7 +420,7 @@ TclMaxListLength( } /* No list element following trailing white space */ - count -= TclIsSpaceProc(bytes[-1]); + count -= TclIsSpaceProc(bytes[-1]); done: if (endPtr) { @@ -488,7 +488,7 @@ TclFindElement( * indicate that the substring of *sizePtr * bytes starting at **elementPtr is/is not * the literal list element and therefore - * does not/does require a call to + * does not/does require a call to * TclCopyAndCollapse() by the caller. */ { CONST char *p = list; @@ -945,7 +945,7 @@ TclScanElement( int preferBrace = 0; /* CONVERT_MASK mode. */ int braceCount = 0; /* Count of all braces '{' '}' seen. */ #endif - + if ((p == NULL) || (length == 0) || ((*p == '\0') && (length == -1))) { /* Empty string element must be brace quoted. */ *flagPtr = CONVERT_BRACE; @@ -1012,7 +1012,7 @@ TclScanElement( extra++; /* Escape '\' => '\\' */ if ((length == 1) || ((length == -1) && (p[1] == '\0'))) { /* Final backslash. Cannot format with brace quoting. */ - requireEscape = 1; + requireEscape = 1; break; } if (p[1] == '\n') { @@ -1087,7 +1087,7 @@ TclScanElement( if (preferEscape && !preferBrace) { /* * If we are quoting solely due to ] or internal " characters - * use the CONVERT_MASK mode where we escape all special + * use the CONVERT_MASK mode where we escape all special * characters except for braces. "extra" counted space needed * to escape braces too, so substract "braceCount" to get our * actual needs. @@ -1351,7 +1351,7 @@ int TclConvertElement( if (length == -1) { return p - dst; } - /* + /* * If we reach this point, there's an embedded NULL in the * string range being processed, which should not happen when * the encoding rules for Tcl strings are properly followed. @@ -1417,7 +1417,7 @@ Tcl_Merge( /* * We cannot allocate a large enough flag array to format this * list in one pass. We could imagine converting this routine - * to a multi-pass implementation, but for sizeof(int) == 4, + * to a multi-pass implementation, but for sizeof(int) == 4, * the limit is a max of 2^30 list elements and since each element * is at least one byte formatted, and requires one byte space * between it and the next one, that a minimum space requirement @@ -1678,7 +1678,7 @@ Tcl_Concat( } if (bytesNeeded + argc - 1 < 0) { /* - * Panic test could be tighter, but not going to bother for + * Panic test could be tighter, but not going to bother for * this legacy routine. */ Tcl_Panic("Tcl_Concat: max size of Tcl value exceeded"); @@ -1689,7 +1689,7 @@ Tcl_Concat( for (p = result, i = 0; i < argc; i++) { int trim, elemLength; const char *element; - + element = argv[i]; elemLength = strlen(argv[i]); @@ -1827,7 +1827,7 @@ Tcl_ConcatObj( for (i = 0; i < objc; i++) { int trim; - + element = TclGetStringFromObj(objv[i], &elemLength); /* Trim away the leading whitespace */ @@ -2828,7 +2828,7 @@ Tcl_PrintDouble( /* * Remember to copy the terminating NUL too. */ - + if (value < 0) { memcpy(dst, "-Inf", 5); } else { @@ -2885,7 +2885,7 @@ Tcl_PrintDouble( */ digits = TclDoubleDigits(value, *precisionPtr, - TCL_DD_E_FORMAT /* | TCL_DD_SHORTEN_FLAG */, + TCL_DD_E_FORMAT /* | TCL_DD_SHORTEN_FLAG */, &exponent, &signum, &end); } if (signum) { @@ -2896,7 +2896,7 @@ Tcl_PrintDouble( /* * E format for numbers < 1e-3 or >= 1e17. */ - + *dst++ = *p++; c = *p; if (c != '\0') { @@ -2906,7 +2906,7 @@ Tcl_PrintDouble( c = *++p; } } - /* + /* * Tcl 8.4 appears to format with at least a two-digit exponent; \ * preserve that behaviour when tcl_precision != 0 */ @@ -2919,7 +2919,7 @@ Tcl_PrintDouble( /* * F format for others. */ - + if (exponent < 0) { *dst++ = '0'; } diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 2df704b..a57a89a 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -111,7 +111,7 @@ typedef struct ThreadSpecificData { * event is ready to be processed by signaling * this condition variable. */ #endif /* __CYGWIN__ */ - int waitCVinitialized; /* Variable to flag initialization of the structure */ + int waitCVinitialized; /* Variable to flag initialization of the structure */ int eventReady; /* True if an event is ready to be processed. * Used as condition flag together with waitCV * above. */ -- cgit v0.12 From a3a5372cf6ffd69dbf4628f2c0dd5295f79888ae Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 4 Oct 2015 10:58:48 +0000 Subject: [05489ce335] Constrain broken tests. --- tests/for.test | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/for.test b/tests/for.test index a0eeff6..59e62fb 100644 --- a/tests/for.test +++ b/tests/for.test @@ -14,6 +14,8 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } +testConstraint bug-05489ce335 [testConstraint knownBug] + # Basic "for" operation. test for-1.1 {TclCompileForCmd: missing initial command} { @@ -824,7 +826,7 @@ test for-8.0 {Coverity CID 1251203: break vs continue in for-step clause} { list $i $j $k }} } {6 5 3} -test for-8.1 {Coverity CID 1251203: break vs continue in for-step clause} { +test for-8.1 {Coverity CID 1251203: break vs continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -837,7 +839,7 @@ test for-8.1 {Coverity CID 1251203: break vs continue in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.2 {Coverity CID 1251203: break vs continue in for-step clause} { +test for-8.2 {Coverity CID 1251203: break vs continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -863,7 +865,7 @@ test for-8.3 {break in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.4 {continue in for-step clause} { +test for-8.4 {continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -876,7 +878,7 @@ test for-8.4 {continue in for-step clause} { list $i $j $k }} } {1 1 3} -test for-8.5 {break in for-step clause} { +test for-8.5 {break in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -889,7 +891,7 @@ test for-8.5 {break in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.6 {continue in for-step clause} { +test for-8.6 {continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -915,7 +917,7 @@ test for-8.7 {break in for-step clause} { list $i $j $k }} } {2 1 3} -test for-8.8 {continue in for-step clause} { +test for-8.8 {continue in for-step clause} bug-05489ce335 { apply {{} { for {set k 0} {$k < 3} {incr k} { set j 0 @@ -976,8 +978,11 @@ test for-8.12 {continue in for-step clause} { list $i $j $k }} } {1 1 3} - - + # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: -- cgit v0.12 From 9cac91e2eb9f49a1227ec078f49d8130706a6125 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 5 Oct 2015 09:23:12 +0000 Subject: Use "cygpath -m" in stead of "cygpath -w", so paths (even windows ones) always have forward slashes. Suggested by pooryorick for [http://core.tcl.tk/tclconfig/tktview/06f1692bbe29449ac3f2161ebf9dd153d0349845|TEA], but a good idea anyway --- win/configure | 2 +- win/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/win/configure b/win/configure index 1dcc9d2..dc03e62 100755 --- a/win/configure +++ b/win/configure @@ -3288,7 +3288,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CYGPATH="cygpath -w" + ac_cv_prog_CYGPATH="cygpath -m" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi diff --git a/win/tcl.m4 b/win/tcl.m4 index aa3c4b3..46d3518 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -558,7 +558,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # Set some defaults (may get changed below) EXTRA_CFLAGS="" - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) SHLIB_SUFFIX=".dll" -- cgit v0.12 From 5580f4a403b6c1487e27c93960c07cab1691d8f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 08:18:46 +0000 Subject: Double '[' and ']', otherwise re-generating "configure" doesn't give the expected result. --- win/tcl.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tcl.m4 b/win/tcl.m4 index 46d3518..2795086 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -784,7 +784,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x1[4-9]*) + x1[[4-9]]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -826,7 +826,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x1[4-9]*) + x1[[4-9]]*) LIBS="$LIBS ucrt.lib" ;; *) -- cgit v0.12 From 1781dd91805d388923c459d467c95112a815d1bf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 09:19:18 +0000 Subject: Revise content of generate win/tclConfig.sh: Make sure that all entries use windows paths with forward slashes. --- win/configure.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/win/configure.in b/win/configure.in index 88270cf..6b30162 100644 --- a/win/configure.in +++ b/win/configure.in @@ -186,21 +186,21 @@ TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}" TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}" -eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\"" +eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\"" eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}" eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}" eval "TCL_LIB_FLAG=\"-ltcl${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_LIB_SPEC=\"-L`pwd` ${TCL_LIB_FLAG}\"" +eval "TCL_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"-L${libdir} ${TCL_LIB_FLAG}\"" eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\"" eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\"" -eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\"" +eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\"" -eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\"" +eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\"" # Install time header dir can be set via --includedir -- cgit v0.12 From 40ba2e067496a7fab51129617bbcd0f5553f285f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 14:25:36 +0000 Subject: Fix [b42a851475]: file normalize ~user returns wrong directory on Windows --- win/tclWinFile.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index fe30c55..73a2183 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -17,6 +17,7 @@ #include #include #include /* For TclpGetUserHome(). */ +#include /* For TclpGetUserHome(). */ /* * The number of 100-ns intervals between the Windows system epoch (1601-01-01 @@ -177,6 +178,10 @@ typedef NET_API_STATUS NET_API_FUNCTION NETAPIBUFFERFREEPROC(LPVOID Buffer); typedef NET_API_STATUS NET_API_FUNCTION NETGETDCNAMEPROC( LPWSTR servername, LPWSTR domainname, LPBYTE *bufptr); +typedef BOOL WINAPI GETPROFILESDIRECTORYPROC( + LPWSTR lpProfilesDir, LPDWORD lpcchSize +); + /* * Declarations for local functions defined in this file: */ @@ -1418,15 +1423,18 @@ TclpGetUserHome( { char *result; HINSTANCE netapiInst; + HINSTANCE userenvInst; result = NULL; Tcl_DStringInit(bufferPtr); netapiInst = LoadLibraryA("netapi32.dll"); - if (netapiInst != NULL) { + userenvInst = LoadLibraryA("userenv.dll"); + if (netapiInst != NULL && userenvInst != NULL) { NETAPIBUFFERFREEPROC *netApiBufferFreeProc; NETGETDCNAMEPROC *netGetDCNameProc; NETUSERGETINFOPROC *netUserGetInfoProc; + GETPROFILESDIRECTORYPROC *getProfilesDirectoryProc; netApiBufferFreeProc = (NETAPIBUFFERFREEPROC *) GetProcAddress(netapiInst, "NetApiBufferFree"); @@ -1434,8 +1442,10 @@ TclpGetUserHome( GetProcAddress(netapiInst, "NetGetDCName"); netUserGetInfoProc = (NETUSERGETINFOPROC *) GetProcAddress(netapiInst, "NetUserGetInfo"); + getProfilesDirectoryProc = (GETPROFILESDIRECTORYPROC *) + GetProcAddress(userenvInst, "GetProfilesDirectoryW"); if ((netUserGetInfoProc != NULL) && (netGetDCNameProc != NULL) - && (netApiBufferFreeProc != NULL)) { + && (netApiBufferFreeProc != NULL) && (getProfilesDirectoryProc != NULL)) { USER_INFO_1 *uiPtr, **uiPtrPtr = &uiPtr; Tcl_DString ds; int nameLen, badDomain; @@ -1467,12 +1477,17 @@ TclpGetUserHome( } else { /* * User exists but has no home dir. Return - * "{Windows Drive}:/users/default". + * "{GetProfilesDirectory}/". */ - - GetWindowsDirectoryW(buf, MAX_PATH); - Tcl_UniCharToUtfDString(buf, 2, bufferPtr); - Tcl_DStringAppend(bufferPtr, "/users/default", -1); + DWORD size = MAX_PATH; + int i; + getProfilesDirectoryProc(buf, &size); + for (i = 0; i < size; ++i){ + if (buf[i] == '\\') buf[i] = '/'; + } + Tcl_UniCharToUtfDString(buf, size-1, bufferPtr); + Tcl_DStringAppend(bufferPtr, "/", -1); + Tcl_DStringAppend(bufferPtr, name, -1); } result = Tcl_DStringValue(bufferPtr); (*netApiBufferFreeProc)((void *) uiPtr); @@ -1483,6 +1498,7 @@ TclpGetUserHome( (*netApiBufferFreeProc)((void *) wDomain); } } + FreeLibrary(userenvInst); FreeLibrary(netapiInst); } if (result == NULL) { -- cgit v0.12 From 236c0f4ffd3ac7f1cef522c0c0e00b9e72cf995f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 7 Oct 2015 08:40:23 +0000 Subject: Fix surrogate handling in PrintSourceToObj(), differenciating for TCL_UTF_MAX = 6 (androwish) and TCL_UTF_MAX = 4 (tip-389-impl). No effect when TCL_UTF_MAX = 3. --- generic/tclDisassemble.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 15502e7..86f0e1d 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -833,8 +833,19 @@ PrintSourceToObj( continue; default: #if TCL_UTF_MAX > 4 - if ((int) ch > 0xffff) { - Tcl_AppendPrintfToObj(appendObj, "\\U%08x", (int) ch); + if (ch > 0xffff) { + Tcl_AppendPrintfToObj(appendObj, "\\U%08x", ch); + i += 10; + } else +#elif TCL_UTF_MAX > 3 + /* If len == 0, this means we have a char > 0xffff, resulting in + * TclUtfToUniChar producing a surrogate pair. We want to output + * this pair as a single Unicode character. + */ + if (len == 0) { + int upper = ((ch & 0x3ff) + 1) << 10; + len = TclUtfToUniChar(p, &ch); + Tcl_AppendPrintfToObj(appendObj, "\\U%08x", upper + (ch & 0x3ff)); i += 10; } else #endif -- cgit v0.12 From 81cbdd313896511542f19465bf012631591474db Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 7 Oct 2015 13:14:27 +0000 Subject: Where "interp" is only used for error-reporting, it can be allowed to be NULL. This should fix [5da26d4760]: Tcl_LoadFile() segfaults if "interp" is NULL. --- generic/tclIOUtil.c | 34 +++++++++++++++++++--------- generic/tclLoadNone.c | 14 +++++++----- unix/tclLoadDl.c | 25 ++++++++++++--------- win/tclWinLoad.c | 62 ++++++++++++++++++++++++++------------------------- 4 files changed, 79 insertions(+), 56 deletions(-) diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 1d4f277..1330c02 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -3254,7 +3254,9 @@ Tcl_LoadFile( if (*handlePtr == NULL) { return TCL_ERROR; } - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } goto resolveSymbols; } if (Tcl_GetErrno() != EXDEV) { @@ -3270,9 +3272,11 @@ Tcl_LoadFile( */ if (Tcl_FSAccess(pathPtr, R_OK) != 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "couldn't load library \"%s\": %s", - Tcl_GetString(pathPtr), Tcl_PosixError(interp))); + if (interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "couldn't load library \"%s\": %s", + Tcl_GetString(pathPtr), Tcl_PosixError(interp))); + } return TCL_ERROR; } @@ -3321,7 +3325,9 @@ Tcl_LoadFile( } mustCopyToTempAnyway: - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } #endif /* TCL_LOAD_FROM_MEMORY */ /* @@ -3345,8 +3351,10 @@ Tcl_LoadFile( Tcl_FSDeleteFile(copyToPtr); Tcl_DecrRefCount(copyToPtr); - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "couldn't load from current filesystem", -1)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "couldn't load from current filesystem", -1)); + } return TCL_ERROR; } @@ -3386,7 +3394,9 @@ Tcl_LoadFile( * have stored the number of bytes in the result. */ - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } retVal = Tcl_LoadFile(interp, copyToPtr, symbols, flags, procPtrs, &newLoadHandle); @@ -3418,7 +3428,9 @@ Tcl_LoadFile( */ *handlePtr = newLoadHandle; - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } return TCL_OK; } @@ -3479,7 +3491,9 @@ Tcl_LoadFile( divertedLoadHandle->unloadFileProcPtr = DivertUnloadFile; *handlePtr = divertedLoadHandle; - Tcl_ResetResult(interp); + if (interp) { + Tcl_ResetResult(interp); + } return retVal; resolveSymbols: diff --git a/generic/tclLoadNone.c b/generic/tclLoadNone.c index 6cb4378..6af5c4f 100644 --- a/generic/tclLoadNone.c +++ b/generic/tclLoadNone.c @@ -45,9 +45,11 @@ TclpDlopen( * file. */ int flags) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "dynamic loading is not currently available on this system", - -1)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "dynamic loading is not currently available on this system", + -1)); + } return TCL_ERROR; } @@ -109,8 +111,10 @@ TclpLoadMemory( int flags) /* Dummy: unused by this implementation */ { - Tcl_SetObjResult(interp, Tcl_NewStringObj("dynamic loading from memory " - "is not available on this system", -1)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_NewStringObj("dynamic loading from memory " + "is not available on this system", -1)); + } return TCL_ERROR; } diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index dc711f8..aec071c 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.c @@ -124,9 +124,11 @@ TclpDlopen( const char *errorStr = dlerror(); - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "couldn't load file \"%s\": %s", - Tcl_GetString(pathPtr), errorStr)); + if (interp) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "couldn't load file \"%s\": %s", + Tcl_GetString(pathPtr), errorStr)); + } return TCL_ERROR; } newHandle = ckalloc(sizeof(*newHandle)); @@ -187,17 +189,18 @@ FindSymbol( Tcl_DStringFree(&newName); } Tcl_DStringFree(&ds); - if (proc == NULL && interp != NULL) { + if (proc == NULL) { const char *errorStr = dlerror(); - if (!errorStr) { - errorStr = "unknown"; + if (interp) { + if (!errorStr) { + errorStr = "unknown"; + } + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "cannot find symbol \"%s\": %s", symbol, errorStr)); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, + NULL); } - - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "cannot find symbol \"%s\": %s", symbol, errorStr)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LOAD_SYMBOL", symbol, - NULL); } return proc; } diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index 3e11224..26512b1 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.c @@ -102,37 +102,39 @@ TclpDlopen( * better if there was a way to get what DLLs */ - switch (lastError) { - case ERROR_MOD_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", NULL); - goto notFoundMsg; - case ERROR_DLL_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", NULL); - notFoundMsg: - Tcl_AppendToObj(errMsg, "this library or a dependent library" - " could not be found in library path", -1); - break; - case ERROR_PROC_NOT_FOUND: - Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", NULL); - Tcl_AppendToObj(errMsg, "A function specified in the import" - " table could not be resolved by the system. Windows" - " is not telling which one, I'm sorry.", -1); - break; - case ERROR_INVALID_DLL: - Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", NULL); - Tcl_AppendToObj(errMsg, "this library or a dependent library" - " is damaged", -1); - break; - case ERROR_DLL_INIT_FAILED: - Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", NULL); - Tcl_AppendToObj(errMsg, "the library initialization" - " routine failed", -1); - break; - default: - TclWinConvertError(lastError); - Tcl_AppendToObj(errMsg, Tcl_PosixError(interp), -1); + if (interp) { + switch (lastError) { + case ERROR_MOD_NOT_FOUND: + Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", NULL); + goto notFoundMsg; + case ERROR_DLL_NOT_FOUND: + Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", NULL); + notFoundMsg: + Tcl_AppendToObj(errMsg, "this library or a dependent library" + " could not be found in library path", -1); + break; + case ERROR_PROC_NOT_FOUND: + Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", NULL); + Tcl_AppendToObj(errMsg, "A function specified in the import" + " table could not be resolved by the system. Windows" + " is not telling which one, I'm sorry.", -1); + break; + case ERROR_INVALID_DLL: + Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", NULL); + Tcl_AppendToObj(errMsg, "this library or a dependent library" + " is damaged", -1); + break; + case ERROR_DLL_INIT_FAILED: + Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", NULL); + Tcl_AppendToObj(errMsg, "the library initialization" + " routine failed", -1); + break; + default: + TclWinConvertError(lastError); + Tcl_AppendToObj(errMsg, Tcl_PosixError(interp), -1); + } + Tcl_SetObjResult(interp, errMsg); } - Tcl_SetObjResult(interp, errMsg); return TCL_ERROR; } -- cgit v0.12 From 87bfeefdb63886437c8e4143e939eac72ca27660 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 7 Oct 2015 13:32:29 +0000 Subject: Fix [8587cb648c445f7]: clock default format incorrect --- doc/clock.n | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/clock.n b/doc/clock.n index a0cc63e..0460a54 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -16,13 +16,13 @@ package require \fBTcl 8.5\fR .sp \fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...? .sp -\fBclock microseconds\fR +\fBclock microseconds\fR .sp -\fBclock milliseconds\fR +\fBclock milliseconds\fR .sp \fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? .sp -\fBclock seconds\fR +\fBclock seconds\fR .sp .BE .SH "DESCRIPTION" @@ -58,10 +58,10 @@ Formats a time that is expressed as an integer number of seconds into a format intended for consumption by users or external programs. See \fBFORMATTING TIMES\fR for a full description. .TP -\fBclock microseconds\fR +\fBclock microseconds\fR Returns the current time as an integer number of microseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP -\fBclock milliseconds\fR +\fBclock milliseconds\fR Returns the current time as an integer number of milliseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP \fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? @@ -69,7 +69,7 @@ Scans a time that is expressed as a character string and produces an integer number of seconds. See \fBSCANNING TIMES\fR for a full description. .TP -\fBclock seconds\fR +\fBclock seconds\fR Returns the current time as an integer number of seconds. .SS "PARAMETERS" .TP @@ -112,7 +112,7 @@ and their interpretation, are described under \fBFORMAT GROUPS\fR. .PP On \fBclock format\fR, the default format is .CS -%a %b %d %H:%M:%S %z %Y +%a %b %d %H:%M:%S %Z %Y .CE .PP On \fBclock scan\fR, the lack of a \fI\-format\fR option indicates that a @@ -514,7 +514,7 @@ string of the same meaning in the locale, to indicate whether \fB%Y\fR refers to years before or after Year 1 of the Common Era. On input, accepts the string \fBB.C.E.\fR, \fBB.C.\fR, \fBC.E.\fR, \fBA.D.\fR, or the abbreviation appropriate to the current locale, and uses it to fix -whether \fB%Y\fR refers to years before or after Year 1 of the +whether \fB%Y\fR refers to years before or after Year 1 of the Common Era. .TP \fB%Ex\fR @@ -673,8 +673,8 @@ ISO8601 week number. \fB%w\fR On output, produces the ordinal number of the day of the week (Sunday==0; Saturday==6). On input, accepts a single digit and -interprets it as the day of the week; Sunday may be represented as -either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number, +interprets it as the day of the week; Sunday may be represented as +either 0 or 7. Note that \fB%w\fR is not the ISO8601 weekday number, which is produced and accepted by \fB%u\fR. .TP \fB%W\fR @@ -753,7 +753,7 @@ The local time zone from the Control Panel on Windows systems. The C library's idea of the local time zone, as defined by the \fBmktime\fR and \fBlocaltime\fR functions. .PP -In case [1] \fIonly,\fR the string is tested to see if it is one +In case [1] \fIonly,\fR the string is tested to see if it is one of the strings: .CS gmt ut utc bst wet wat at @@ -769,7 +769,7 @@ of the strings: If it is a string in the above list, it designates a known time zone, and is interpreted as such. .PP -For time zones in case [1] that do not match any of the above strings, +For time zones in case [1] that do not match any of the above strings, and always for cases [2]-[6], the following rules apply. .PP If the time zone begins with a colon, it is one of a @@ -876,7 +876,7 @@ giving an explicit \fI\-format\fR option to the \fBclock scan\fR command. .TP \fIrelative time\fR A specification relative to the current time. The format is \fBnumber -unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR, +unit\fR. Acceptable units are \fByear\fR, \fBfortnight\fR, \fBmonth\fR, \fBweek\fR, \fBday\fR, \fBhour\fR, \fBminute\fR (or \fBmin\fR), and \fBsecond\fR (or \fBsec\fR). The unit can be specified as a singular or plural, as in \fB3 weeks\fR. -- cgit v0.12 From 404bcc3435d7a5ce178b4b84c86833285d3aa1d4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 8 Oct 2015 14:41:46 +0000 Subject: Decorate Tcl_Exit() and Tcl_SetExitProc()'s argument with TCL_NORETURN as appropriate, as already done with Tcl_Panic() earlier. Fix minor msvc compiler warning in tclWinFile.c --- generic/tcl.decls | 4 ++-- generic/tclDecls.h | 8 ++++---- generic/tclEvent.c | 8 ++++---- win/tclWinFile.c | 3 +-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index a5cd24d..797a5a7 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -480,7 +480,7 @@ declare 132 { void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc) } declare 133 { - void Tcl_Exit(int status) + TCL_NORETURN void Tcl_Exit(int status) } declare 134 { int Tcl_ExposeCommand(Tcl_Interp *interp, const char *hiddenCmdToken, @@ -1872,7 +1872,7 @@ declare 518 { # TIP#121 (exit handler) dkf for Joe Mistachkin declare 519 { - Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc) + Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc) } # TIP#143 (resource limits) dkf diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 996129d..b022d3c 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -417,7 +417,7 @@ EXTERN int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr); EXTERN void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc); /* 133 */ -EXTERN void Tcl_Exit(int status); +EXTERN TCL_NORETURN void Tcl_Exit(int status); /* 134 */ EXTERN int Tcl_ExposeCommand(Tcl_Interp *interp, const char *hiddenCmdToken, @@ -1500,7 +1500,7 @@ EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp, EXTERN int Tcl_FSEvalFileEx(Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 519 */ -EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc); +EXTERN Tcl_ExitProc * Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc); /* 520 */ EXTERN void Tcl_LimitAddHandler(Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, @@ -1976,7 +1976,7 @@ typedef struct TclStubs { int (*tcl_EvalFile) (Tcl_Interp *interp, const char *fileName); /* 130 */ int (*tcl_EvalObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 131 */ void (*tcl_EventuallyFree) (ClientData clientData, Tcl_FreeProc *freeProc); /* 132 */ - void (*tcl_Exit) (int status); /* 133 */ + TCL_NORETURN1 void (*tcl_Exit) (int status); /* 133 */ int (*tcl_ExposeCommand) (Tcl_Interp *interp, const char *hiddenCmdToken, const char *cmdName); /* 134 */ int (*tcl_ExprBoolean) (Tcl_Interp *interp, const char *expr, int *ptr); /* 135 */ int (*tcl_ExprBooleanObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *ptr); /* 136 */ @@ -2370,7 +2370,7 @@ typedef struct TclStubs { Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 516 */ void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 517 */ int (*tcl_FSEvalFileEx) (Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 518 */ - Tcl_ExitProc * (*tcl_SetExitProc) (Tcl_ExitProc *proc); /* 519 */ + Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */ void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */ void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 521 */ int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */ diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 281ff6c..8305410 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -89,7 +89,7 @@ static int subsystemsInitialized = 0; * non-NULL value. */ -static Tcl_ExitProc *appExitPtr = NULL; +static TCL_NORETURN1 Tcl_ExitProc *appExitPtr = NULL; typedef struct ThreadSpecificData { ExitHandler *firstExitPtr; /* First in list of all exit handlers for this @@ -857,7 +857,7 @@ Tcl_DeleteThreadExitHandler( Tcl_ExitProc * Tcl_SetExitProc( - Tcl_ExitProc *proc) /* New exit handler for app or NULL */ + TCL_NORETURN1 Tcl_ExitProc *proc) /* New exit handler for app or NULL */ { Tcl_ExitProc *prevExitProc; @@ -933,12 +933,12 @@ InvokeExitHandlers(void) *---------------------------------------------------------------------- */ -void +TCL_NORETURN void Tcl_Exit( int status) /* Exit status for application; typically 0 * for normal return, 1 for error return. */ { - Tcl_ExitProc *currentAppExitPtr; + TCL_NORETURN1 Tcl_ExitProc *currentAppExitPtr; Tcl_MutexLock(&exitMutex); currentAppExitPtr = appExitPtr; diff --git a/win/tclWinFile.c b/win/tclWinFile.c index be9c947..25c6ea4 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1467,8 +1467,7 @@ TclpGetUserHome( * User exists but has no home dir. Return * "{GetProfilesDirectory}/". */ - DWORD size = MAX_PATH; - int i; + DWORD i, size = MAX_PATH; GetProfilesDirectoryW(buf, &size); for (i = 0; i < size; ++i){ if (buf[i] == '\\') buf[i] = '/'; -- cgit v0.12 From 6816e77cbfb64f58b952d8cd4fe20e69141729ee Mon Sep 17 00:00:00 2001 From: stwo Date: Fri, 9 Oct 2015 13:18:48 +0000 Subject: Tcl/OpenBSD/Sparc needs -fPIC. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 31758c3..27e147b 100755 --- a/unix/configure +++ b/unix/configure @@ -7527,7 +7527,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index d896d05..83c3fb1 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1518,7 +1518,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 2a1ef7e5c60cf8a23a9da2c301fd4044c9f0db0e Mon Sep 17 00:00:00 2001 From: stwo Date: Fri, 9 Oct 2015 13:30:49 +0000 Subject: Tcl/OpenBSD/Sparc needs -fPIC. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 1899aa3..bbac11d 100755 --- a/unix/configure +++ b/unix/configure @@ -7579,7 +7579,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3db997a..d7d6a7b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1542,7 +1542,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 2c3171b7932c069b7f8c7bbfdbdb199251e2399e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 9 Oct 2015 14:40:28 +0000 Subject: Make autoconf > 2.59 work warning-free --- win/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/win/Makefile.in b/win/Makefile.in index c0d8668..b3417e7 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -22,6 +22,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ +datarootdir = @datarootdir@ mandir = @mandir@ # The following definition can be set to non-null for special systems like AFS -- cgit v0.12 From 7ac2d8cc226958fbe8a0c9014c2cadae69a31e06 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 10 Oct 2015 12:37:34 +0000 Subject: Fix minor msvc compiler warning in tclWinFile.c --- win/tclWinFile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 73a2183..41de4a8 100755 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1479,8 +1479,7 @@ TclpGetUserHome( * User exists but has no home dir. Return * "{GetProfilesDirectory}/". */ - DWORD size = MAX_PATH; - int i; + DWORD i, size = MAX_PATH; getProfilesDirectoryProc(buf, &size); for (i = 0; i < size; ++i){ if (buf[i] == '\\') buf[i] = '/'; -- cgit v0.12 From de3fd77202d2f00e549b962c6b56a85f5d8d7042 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 12 Oct 2015 09:57:26 +0000 Subject: Various build fixes, when using Cygwin shell in combination with native MinGW compiler. Contributed by pooryorick. --- win/Makefile.in | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/win/Makefile.in b/win/Makefile.in index b3417e7..e9a28c4 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -102,10 +102,15 @@ COMPAT_DIR = @srcdir@/../compat # Converts a POSIX path to a Windows native path. CYGPATH = @CYGPATH@ -GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)' | sed 's!\\!/!g') -TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)' | sed 's!\\!/!g') -WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)' | sed 's!\\!/!g') -ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)' | sed 's!\\!/!g') +libdir_native = $(shell $(CYGPATH) '$(libdir)') +bindir_native = $(shell $(CYGPATH) '$(bindir)') +includedir_native = $(shell $(CYGPATH) '$(includedir)') +mandir_native = $(shell $(CYGPATH) '$(mandir)') +TCL_LIBRARY_NATIVE = $(shell $(CYGPATH) '$(TCL_LIBRARY)') +GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)') +TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)') +WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)') +ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)') #GENERIC_DIR_NATIVE = $(GENERIC_DIR) #TOMMATH_DIR_NATIVE = $(TOMMATH_DIR) #WIN_DIR_NATIVE = $(WIN_DIR) @@ -114,7 +119,7 @@ ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)' | sed 's!\\!/!g') # Fully qualify library path so that `make test` # does not depend on the current directory. LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd) -LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)' | sed 's!\\!/!g') +LIBRARY_DIR = $(shell $(CYGPATH) '$(LIBRARY_DIR1)') DLLSUFFIX = @DLLSUFFIX@ LIBSUFFIX = @LIBSUFFIX@ EXESUFFIX = @EXESUFFIX@ @@ -503,17 +508,17 @@ tclWinDde.${OBJEXT} : tclWinDde.c tclPkgConfig.${OBJEXT}: tclPkgConfig.c $(CC) -c $(CC_SWITCHES) \ - -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR)\" \ - -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR)\" \ - -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \ - -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \ + -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR_NATIVE)\" \ + -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR_NATIVE)\" \ -DCFG_INSTALL_DOCDIR=\"$(MAN_INSTALL_DIR)\" \ \ - -DCFG_RUNTIME_LIBDIR=\"$(libdir)\" \ - -DCFG_RUNTIME_BINDIR=\"$(bindir)\" \ - -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY)\" \ - -DCFG_RUNTIME_INCDIR=\"$(includedir)\" \ - -DCFG_RUNTIME_DOCDIR=\"$(mandir)\" \ + -DCFG_RUNTIME_LIBDIR=\"$(libdir_native)\" \ + -DCFG_RUNTIME_BINDIR=\"$(bindir_native)\" \ + -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY_NATIVE)\" \ + -DCFG_RUNTIME_INCDIR=\"$(includedir_native)\" \ + -DCFG_RUNTIME_DOCDIR=\"$(mandir_native)\" \ -DBUILD_tcl \ @DEPARG@ $(CC_OBJNAME) -- cgit v0.12 From b26b272f52e27f26233144697e4526a6f156e4c0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 17 Oct 2015 07:21:19 +0000 Subject: Proposed fix for [ba44e415a0]: "Use of mutexLock causes problem with reactive event handling in AndroWish". This basically undoes the retry mechamism in Tcl_MutexLock, introduced in [9f8b7bea53]. Does this retry mechamism hurt more than it helps? Feedback requested. --- unix/tclUnixThrd.c | 51 +++++---------------------------------------------- win/tclWinThrd.c | 37 +++++-------------------------------- 2 files changed, 10 insertions(+), 78 deletions(-) diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index ae81c5f..0e8070d 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -22,19 +22,6 @@ typedef struct ThreadSpecificData { static Tcl_ThreadDataKey dataKey; /* - * This is the number of milliseconds to wait between internal retries in - * the Tcl_MutexLock function. This value must be greater than zero and - * should be a suitable value for the given platform. - * - * TODO: This may need to be dynamically determined, based on the relative - * performance of the running process. - */ - -#ifndef TCL_MUTEX_LOCK_SLEEP_TIME -# define TCL_MUTEX_LOCK_SLEEP_TIME (25) -#endif - -/* * masterLock is used to serialize creation of mutexes, condition variables, * and thread local storage. This is the only place that can count on the * ability to statically initialize the mutex. @@ -58,13 +45,6 @@ static pthread_mutex_t allocLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t *allocLockPtr = &allocLock; /* - * The mutexLock serializes Tcl_MutexLock. This is necessary to prevent - * races when finalizing a mutex that some other thread may want to lock. - */ - -static pthread_mutex_t mutexLock = PTHREAD_MUTEX_INITIALIZER; - -/* * These are for the critical sections inside this file. */ @@ -380,7 +360,6 @@ TclpMasterUnlock(void) pthread_mutex_unlock(&masterLock); #endif } - /* *---------------------------------------------------------------------- @@ -457,32 +436,12 @@ retry: } MASTER_UNLOCK; } - while (1) { - pthread_mutex_lock(&mutexLock); - pmutexPtr = *((pthread_mutex_t **)mutexPtr); - if (pmutexPtr == NULL) { - pthread_mutex_unlock(&mutexLock); - goto retry; - } - if (pthread_mutex_trylock(pmutexPtr) == 0) { - pthread_mutex_unlock(&mutexLock); - return; - } - pthread_mutex_unlock(&mutexLock); - /* - * BUGBUG: All core and Thread package tests pass when usleep() - * is used; however, the Thread package tests hang at - * various places when Tcl_Sleep() is used, typically - * while running test "thread-17.8", "thread-17.9", or - * "thread-17.11a". Really, what we want here is just - * to yield to other threads for a while. - */ -#ifdef HAVE_USLEEP - usleep(TCL_MUTEX_LOCK_SLEEP_TIME * 1000); -#else - Tcl_Sleep(TCL_MUTEX_LOCK_SLEEP_TIME); -#endif + + pmutexPtr = *((pthread_mutex_t **)mutexPtr); + if (pmutexPtr == NULL) { + goto retry; } + pthread_mutex_lock(pmutexPtr); } /* diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index ae7ce80..927e115 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -24,16 +24,6 @@ _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask #endif /* - * This is the number of milliseconds to wait between internal retries in - * the Tcl_MutexLock function. This value must be greater than or equal - * to zero and should be a suitable value for the given platform. - */ - -#ifndef TCL_MUTEX_LOCK_SLEEP_TIME -# define TCL_MUTEX_LOCK_SLEEP_TIME (0) -#endif - -/* * This is the master lock used to serialize access to other serialization * data structures. */ @@ -67,13 +57,6 @@ static int allocOnce = 0; #endif /* TCL_THREADS */ /* - * The mutexLock serializes Tcl_MutexLock. This is necessary to prevent - * races when finalizing a mutex that some other thread may want to lock. - */ - -static CRITICAL_SECTION mutexLock; - -/* * The joinLock serializes Create- and ExitThread. This is necessary to * prevent a race where a new joinable thread exits before the creating thread * had the time to create the necessary data structures in the emulation @@ -386,7 +369,6 @@ TclpInitLock(void) */ init = 1; - InitializeCriticalSection(&mutexLock); InitializeCriticalSection(&joinLock); InitializeCriticalSection(&initLock); InitializeCriticalSection(&masterLock); @@ -534,7 +516,6 @@ void TclFinalizeLock(void) { MASTER_LOCK; - DeleteCriticalSection(&mutexLock); DeleteCriticalSection(&joinLock); /* @@ -605,20 +586,12 @@ retry: } MASTER_UNLOCK; } - while (1) { - EnterCriticalSection(&mutexLock); - csPtr = *((CRITICAL_SECTION **)mutexPtr); - if (csPtr == NULL) { - LeaveCriticalSection(&mutexLock); - goto retry; - } - if (TryEnterCriticalSection(csPtr)) { - LeaveCriticalSection(&mutexLock); - return; - } - LeaveCriticalSection(&mutexLock); - Tcl_Sleep(TCL_MUTEX_LOCK_SLEEP_TIME); + + csPtr = *((CRITICAL_SECTION **)mutexPtr); + if (csPtr == NULL) { + goto retry; } + EnterCriticalSection(csPtr); } /* -- cgit v0.12 From ec590efe63eabdd8f4a8768f8cadab88ba95033e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 19 Oct 2015 13:52:58 +0000 Subject: typo in comment. Eliminate unnecessary end-of-line spacing. --- generic/tclCompCmdsGR.c | 4 ++-- generic/tclCompCmdsSZ.c | 12 ++++++------ generic/tclDictObj.c | 4 ++-- generic/tclEncoding.c | 2 +- generic/tclFCmd.c | 2 +- generic/tclIORTrans.c | 6 +++--- generic/tclIOSock.c | 10 +++++----- generic/tclObj.c | 4 ++-- generic/tclParse.c | 4 ++-- generic/tclProc.c | 4 ++-- generic/tclResult.c | 4 ++-- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index ec9d054..e674fb0 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -144,7 +144,7 @@ TclCompileGlobalCmd( return TCL_ERROR; } - /* TODO: Consider what value can pass throug the + /* TODO: Consider what value can pass throug the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); @@ -2890,7 +2890,7 @@ TclCompileVariableCmd( return TCL_ERROR; } - /* TODO: Consider what value can pass throug the + /* TODO: Consider what value can pass throug the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ CompileWord(envPtr, varTokenPtr, interp, i); diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 5d3ffd3..ef9340e 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -292,7 +292,7 @@ TclCompileStringCatCmd( PushStringLiteral(envPtr, ""); return TCL_OK; } - + /* General case: issue CONCAT1's (by chunks of 254 if needed), folding contiguous constants along the way */ @@ -313,7 +313,7 @@ TclCompileStringCatCmd( if (folded) { int len; const char *bytes = Tcl_GetStringFromObj(folded, &len); - + PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(folded); folded = NULL; @@ -331,7 +331,7 @@ TclCompileStringCatCmd( if (folded) { int len; const char *bytes = Tcl_GetStringFromObj(folded, &len); - + PushLiteral(envPtr, bytes, len); Tcl_DecrRefCount(folded); folded = NULL; @@ -1003,7 +1003,7 @@ TclCompileStringRangeCmd( /* * Push the operands onto the stack and then the substring operation. - */ + */ nonConstantIndices: CompileWord(envPtr, stringTokenPtr, interp, 1); @@ -2182,7 +2182,7 @@ IssueSwitchChainedTests( } /* - * Now do the actual compilation. Note that we do not use BODY() + * Now do the actual compilation. Note that we do not use BODY() * because we may have synthesized the tokens in a non-standard * pattern. */ @@ -2640,7 +2640,7 @@ TclCompileThrowCmd( } CompileWord(envPtr, msgToken, interp, 2); - codeIsList = codeKnown && (TCL_OK == + codeIsList = codeKnown && (TCL_OK == Tcl_ListObjLength(interp, objPtr, &len)); codeIsValid = codeIsList && (len != 0); diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 980f0a8..c8474e6 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -3051,14 +3051,14 @@ DictFilterCmd( Tcl_IncrRefCount(valueObj); if (Tcl_ObjSetVar2(interp, keyVarObj, NULL, keyObj, TCL_LEAVE_ERR_MSG) == NULL) { - Tcl_AddErrorInfo(interp, + Tcl_AddErrorInfo(interp, "\n (\"dict filter\" filter script key variable)"); result = TCL_ERROR; goto abnormalResult; } if (Tcl_ObjSetVar2(interp, valueVarObj, NULL, valueObj, TCL_LEAVE_ERR_MSG) == NULL) { - Tcl_AddErrorInfo(interp, + Tcl_AddErrorInfo(interp, "\n (\"dict filter\" filter script value variable)"); result = TCL_ERROR; goto abnormalResult; diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 4ae017d..4edebcf 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1450,7 +1450,7 @@ Tcl_UtfToExternal( * * Side effects: * The absolute pathname for the application is computed and stored to be - * returned later be [info nameofexecutable]. + * returned later by [info nameofexecutable]. * *--------------------------------------------------------------------------- */ diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index f335269..bb814ea 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -120,7 +120,7 @@ FileCopyRename( } i++; if ((objc - i) < 2) { - Tcl_WrongNumArgs(interp, 1, objv, + Tcl_WrongNumArgs(interp, 1, objv, "?-option value ...? source ?source ...? target"); return TCL_ERROR; } diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 8baa9ad..af86ba5 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -943,7 +943,7 @@ ReflectClose( Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); return errorCode; - } + } #endif /* TCL_THREADS */ errorCodeSet = 1; goto cleanup; @@ -957,7 +957,7 @@ ReflectClose( Tcl_EventuallyFree(rtPtr, (Tcl_FreeProc *) FreeReflectedTransform); return errorCode; - } + } #endif /* TCL_THREADS */ errorCodeSet = 1; goto cleanup; @@ -1177,7 +1177,7 @@ ReflectInput( */ rtPtr->eofPending = 1; - + /* * Now this is a bit different. The partial data waiting is * converted and returned. diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index f69d30f..d578d19 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -23,7 +23,7 @@ static Tcl_ThreadDataKey dataKey; #undef gai_strerror static const char *gai_strerror(int code) { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - + if (tsdPtr->initialized) { Tcl_DStringFree(&tsdPtr->errorMsg); } else { @@ -187,11 +187,11 @@ TclCreateSocketAddress( TclFormatInt(portbuf, port); portstring = portbuf; } - + (void) memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; - /* + /* * Magic variable to enforce a certain address family - to be superseded * by a TIP that adds explicit switches to [socket] */ @@ -228,7 +228,7 @@ TclCreateSocketAddress( if (willBind) { hints.ai_flags |= AI_PASSIVE; - } + } result = getaddrinfo(native, portstring, &hints, addrlist); @@ -283,7 +283,7 @@ TclCreateSocketAddress( for (p = *addrlist; p != NULL; p = p->ai_next) { i++; } - + return 1; } diff --git a/generic/tclObj.c b/generic/tclObj.c index 15ea91f..c641152 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -3972,10 +3972,10 @@ TclCompareObjKeys( /* * If the object pointers are the same then they match. * OPT: this comparison was moved to the caller - + if (objPtr1 == objPtr2) return 1; */ - + /* * Don't use Tcl_GetStringFromObj as it would prevent l1 and l2 being * in a register. diff --git a/generic/tclParse.c b/generic/tclParse.c index effc201..95abc45 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ - + #include "tclInt.h" #include "tclParse.h" #include @@ -1915,7 +1915,7 @@ Tcl_ParseQuotedString( * flags argument to provide support for the -nobackslashes, -nocommands, * and -novariables options, as represented by the flag values * TCL_SUBST_BACKSLASHES, TCL_SUBST_COMMANDS, TCL_SUBST_VARIABLES. - * + * * Results: * None. * diff --git a/generic/tclProc.c b/generic/tclProc.c index 02bda51..ac65bde 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -1854,8 +1854,8 @@ InterpProcNR2( if (result != TCL_OK) { goto process; } - - done: + + done: if (TCL_DTRACE_PROC_RESULT_ENABLED()) { int l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0; Tcl_Obj *r = Tcl_GetObjResult(interp); diff --git a/generic/tclResult.c b/generic/tclResult.c index 2f2563a..9d0714c 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1293,7 +1293,7 @@ TclProcessReturn( if (Tcl_IsShared(iPtr->errorStack)) { Tcl_Obj *newObj; - + newObj = Tcl_DuplicateObj(iPtr->errorStack); Tcl_DecrRefCount(iPtr->errorStack); Tcl_IncrRefCount(newObj); @@ -1626,7 +1626,7 @@ TclNoErrorStack( Tcl_Obj *options) { Tcl_Obj **keys = GetKeys(); - + Tcl_DictObjRemove(interp, options, keys[KEY_ERRORSTACK]); return options; } -- cgit v0.12 From 742b7cee05467846b9ad80a57eacf888dffa845f Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 19 Oct 2015 14:07:48 +0000 Subject: [154f0982f2] Document that Tcl_NewObjectInstance() really needs to make a namespace. --- doc/Class.3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Class.3 b/doc/Class.3 index 7e421fe..1c3fe08 100644 --- a/doc/Class.3 +++ b/doc/Class.3 @@ -71,7 +71,8 @@ The name of the object to create, or NULL if a new unused name is to be automatically selected. .AP "const char" *nsName in The name of the namespace to create for the object's private use, or NULL if a -new unused name is to be automatically selected. +new unused name is to be automatically selected. The namespace must not +already exist. .AP int objc in The number of elements in the \fIobjv\fR array. .AP "Tcl_Obj *const" *objv in -- cgit v0.12 From b8c0c06fdf9f099f27f114fc9c92b7786dce13a5 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 19 Oct 2015 17:42:43 +0000 Subject: Adaptation of the patch re-fixconstraintloops.patch from http://www.postgresql.org/message-id/19394.1444865029@sss.pgh.pa.us --- generic/regc_nfa.c | 655 ++++++++++++++++++++++++++++++++++++++++++++++++----- generic/regcomp.c | 7 + tests/reg.test | 25 ++ 3 files changed, 633 insertions(+), 54 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 1d572c3..20eb3ba 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -34,6 +34,7 @@ #define NISERR() VISERR(nfa->v) #define NERR(e) VERR(nfa->v, (e)) +#define STACK_TOO_DEEP(x) (0) /* - newnfa - set up an NFA @@ -883,6 +884,20 @@ specialcolors( - optimize - optimize an NFA ^ static long optimize(struct nfa *, FILE *); */ + + /* + * The main goal of this function is not so much "optimization" (though it + * does try to get rid of useless NFA states) as reducing the NFA to a form + * the regex executor can handle. The executor, and indeed the cNFA format + * that is its input, can only handle PLAIN and LACON arcs. The output of + * the regex parser also includes EMPTY (do-nothing) arcs, as well as + * ^, $, AHEAD, and BEHIND constraint arcs, which we must get rid of here. + * We first get rid of EMPTY arcs and then deal with the constraint arcs. + * The hardest part of either job is to get rid of circular loops of the + * target arc type. We would have to do that in any case, though, as such a + * loop would otherwise allow the executor to cycle through the loop endlessly + * without making any progress in the input string. + */ static long /* re_info bits */ optimize( struct nfa *nfa, @@ -904,6 +919,7 @@ optimize( if (verbose) { fprintf(f, "\nconstraints:\n"); } + fixconstraintloops(nfa, f); /* get rid of constraint loops */ pullback(nfa, f); /* pull back constraints backward */ pushfwd(nfa, f); /* push fwd constraints forward */ if (verbose) { @@ -914,7 +930,7 @@ optimize( } /* - - pullback - pull back constraints backward to (with luck) eliminate them + - pullback - pull back constraints backward to eliminate them ^ static VOID pullback(struct nfa *, FILE *); */ static void @@ -954,6 +970,12 @@ pullback( return; } + /* + * Any ^ constraints we were able to pull to the start state can now be + * replaced by PLAIN arcs referencing the BOS or BOL colors. There should + * be no other ^ or BEHIND arcs left in the NFA, though we do not check + * that here (compact() will fail if so). + */ for (a=nfa->pre->outs ; a!=NULL ; a=nexta) { nexta = a->outchain; if (a->type == '^') { @@ -982,10 +1004,7 @@ pull( struct arc *nexta; struct state *s; - if (from == to) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } + assert(from != to); /* should have gotten rid of this earlier */ if (from->flag) { /* can't pull back beyond start */ return 0; } @@ -995,25 +1014,6 @@ pull( } /* - * DGP 2007-11-15: Cloning a state with a circular constraint on its list - * of outs can lead to trouble [Bug 1810038], so get rid of them first. - */ - - for (a = from->outs; a != NULL; a = nexta) { - nexta = a->outchain; - switch (a->type) { - case '^': - case '$': - case BEHIND: - case AHEAD: - if (from == a->to) { - freearc(nfa, a); - } - break; - } - } - - /* * First, clone from state if necessary to avoid other outarcs. */ @@ -1022,7 +1022,6 @@ pull( if (NISERR()) { return 0; } - assert(to != from); /* con is not an inarc */ copyins(nfa, from, s, 1); /* duplicate inarcs */ cparc(nfa, con, s, to); /* move constraint arc */ freearc(nfa, con); @@ -1071,7 +1070,7 @@ pull( } /* - - pushfwd - push forward constraints forward to (with luck) eliminate them + - pushfwd - push forward constraints forward to eliminate them ^ static VOID pushfwd(struct nfa *, FILE *); */ static void @@ -1111,6 +1110,12 @@ pushfwd( return; } + /* + * Any $ constraints we were able to push to the post state can now be + * replaced by PLAIN arcs referencing the EOS or EOL colors. There should + * be no other $ or AHEAD arcs left in the NFA, though we do not check + * that here (compact() will fail if so). + */ for (a = nfa->post->ins; a != NULL; a = nexta) { nexta = a->inchain; if (a->type == '$') { @@ -1139,10 +1144,7 @@ push( struct arc *nexta; struct state *s; - if (to == from) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } + assert(to != from); /* should have gotten rid of this earlier */ if (to->flag) { /* can't push forward beyond end */ return 0; } @@ -1152,28 +1154,6 @@ push( } /* - * DGP 2007-11-15: Here we duplicate the same protections as appear - * in pull() above to avoid troubles with cloning a state with a - * circular constraint on its list of ins. It is not clear whether - * this is necessary, or is protecting against a "can't happen". - * Any test case that actually leads to a freearc() call here would - * be a welcome addition to the test suite. - */ - - for (a = to->ins; a != NULL; a = nexta) { - nexta = a->inchain; - switch (a->type) { - case '^': - case '$': - case BEHIND: - case AHEAD: - if (a->from == to) { - freearc(nfa, a); - } - break; - } - } - /* * First, clone to state if necessary to avoid other inarcs. */ @@ -1503,6 +1483,573 @@ replaceempty( copyins(nfa, from, to, 0); } + +/* + * isconstraintarc - detect whether an arc is of a constraint type + */ +static inline int +isconstraintarc(struct arc * a) +{ + switch (a->type) + { + case '^': + case '$': + case BEHIND: + case AHEAD: + case LACON: + return 1; + } + return 0; +} + +/* + * hasconstraintout - does state have a constraint out arc? + */ +static int +hasconstraintout(struct state * s) +{ + struct arc *a; + + for (a = s->outs; a != NULL; a = a->outchain) { + if (isconstraintarc(a)) { + return 1; + } + } + return 0; +} + +/* + * fixconstraintloops - get rid of loops containing only constraint arcs + * + * A loop of states that contains only constraint arcs is useless, since + * passing around the loop represents no forward progress. Moreover, it + * would cause infinite looping in pullback/pushfwd, so we need to get rid + * of such loops before doing that. + */ +static void +fixconstraintloops( + struct nfa * nfa, + FILE *f) /* for debug output; NULL none */ +{ + struct state *s; + struct state *nexts; + struct arc *a; + struct arc *nexta; + int hasconstraints; + + /* + * In the trivial case of a state that loops to itself, we can just drop + * the constraint arc altogether. This is worth special-casing because + * such loops are far more common than loops containing multiple states. + * While we're at it, note whether any constraint arcs survive. + */ + hasconstraints = 0; + for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { + nexts = s->next; + /* while we're at it, ensure tmp fields are clear for next step */ + assert(s->tmp == NULL); + for (a = s->outs; a != NULL && !NISERR(); a = nexta) { + nexta = a->outchain; + if (isconstraintarc(a)) { + if (a->to == s) { + freearc(nfa, a); + } else { + hasconstraints = 1; + } + } + } + /* If we removed all the outarcs, the state is useless. */ + if (s->nouts == 0 && !s->flag) { + dropstate(nfa, s); + } + } + + /* Nothing to do if no remaining constraint arcs */ + if (NISERR() || !hasconstraints) { + return; + } + + /* + * Starting from each remaining NFA state, search outwards for a + * constraint loop. If we find a loop, break the loop, then start the + * search over. (We could possibly retain some state from the first scan, + * but it would complicate things greatly, and multi-state constraint + * loops are rare enough that it's not worth optimizing the case.) + */ + restart: + for (s = nfa->states; s != NULL && !NISERR(); s = s->next) { + if (findconstraintloop(nfa, s)) { + goto restart; + } + } + + if (NISERR()) { + return; + } + + /* + * Now remove any states that have become useless. (This cleanup is not + * very thorough, and would be even less so if we tried to combine it with + * the previous step; but cleanup() will take care of anything we miss.) + * + * Because findconstraintloop intentionally doesn't reset all tmp fields, + * we have to clear them after it's done. This is a convenient place to + * do that, too. + */ + for (s = nfa->states; s != NULL; s = nexts) { + nexts = s->next; + s->tmp = NULL; + if ((s->nins == 0 || s->nouts == 0) && !s->flag) { + dropstate(nfa, s); + } + } + + if (f != NULL) { + dumpnfa(nfa, f); + } +} + +/* + * findconstraintloop - recursively find a loop of constraint arcs + * + * If we find a loop, break it by calling breakconstraintloop(), then + * return 1; otherwise return 0. + * + * State tmp fields are guaranteed all NULL on a success return, because + * breakconstraintloop does that. After a failure return, any state that + * is known not to be part of a loop is marked with s->tmp == s; this allows + * us not to have to re-prove that fact on later calls. (This convention is + * workable because we already eliminated single-state loops.) + * + * Note that the found loop doesn't necessarily include the first state we + * are called on. Any loop reachable from that state will do. + * + * The maximum recursion depth here is one more than the length of the longest + * loop-free chain of constraint arcs, which is surely no more than the size + * of the NFA, and in practice will be a lot less than that. + */ +static int +findconstraintloop(struct nfa * nfa, struct state * s) +{ + struct arc *a; + + /* Since this is recursive, it could be driven to stack overflow */ + if (STACK_TOO_DEEP(nfa->v->re)) { + NERR(REG_ETOOBIG); + return 1; /* to exit as quickly as possible */ + } + + if (s->tmp != NULL) { + /* Already proven uninteresting? */ + if (s->tmp == s) { + return 0; + } + /* Found a loop involving s */ + breakconstraintloop(nfa, s); + /* The tmp fields have been cleaned up by breakconstraintloop */ + return 1; + } + for (a = s->outs; a != NULL; a = a->outchain) { + if (isconstraintarc(a)) { + struct state *sto = a->to; + + assert(sto != s); + s->tmp = sto; + if (findconstraintloop(nfa, sto)) { + return 1; + } + } + } + + /* + * If we get here, no constraint loop exists leading out from s. Mark it + * with s->tmp == s so we need not rediscover that fact again later. + */ + s->tmp = s; + return 0; +} + +/* + * breakconstraintloop - break a loop of constraint arcs + * + * sinitial is any one member state of the loop. Each loop member's tmp + * field links to its successor within the loop. (Note that this function + * will reset all the tmp fields to NULL.) + * + * We can break the loop by, for any one state S1 in the loop, cloning its + * loop successor state S2 (and possibly following states), and then moving + * all S1->S2 constraint arcs to point to the cloned S2. The cloned S2 should + * copy any non-constraint outarcs of S2. Constraint outarcs should be + * dropped if they point back to S1, else they need to be copied as arcs to + * similarly cloned states S3, S4, etc. In general, each cloned state copies + * non-constraint outarcs, drops constraint outarcs that would lead to itself + * or any earlier cloned state, and sends other constraint outarcs to newly + * cloned states. No cloned state will have any inarcs that aren't constraint + * arcs or do not lead from S1 or earlier-cloned states. It's okay to drop + * constraint back-arcs since they would not take us to any state we've not + * already been in; therefore, no new constraint loop is created. In this way + * we generate a modified NFA that can still represent every useful state + * sequence, but not sequences that represent state loops with no consumption + * of input data. Note that the set of cloned states will certainly include + * all of the loop member states other than S1, and it may also include + * non-loop states that are reachable from S2 via constraint arcs. This is + * important because there is no guarantee that findconstraintloop found a + * maximal loop (and searching for one would be NP-hard, so don't try). + * Frequently the "non-loop states" are actually part of a larger loop that + * we didn't notice, and indeed there may be several overlapping loops. + * This technique ensures convergence in such cases, while considering only + * the originally-found loop does not. + * + * If there is only one S1->S2 constraint arc, then that constraint is + * certainly satisfied when we enter any of the clone states. This means that + * in the common case where many of the constraint arcs are identically + * labeled, we can merge together clone states linked by a similarly-labeled + * constraint: if we can get to the first one we can certainly get to the + * second, so there's no need to distinguish. This greatly reduces the number + * of new states needed, so we preferentially break the given loop at a state + * pair where this is true. + * + * Furthermore, it's fairly common to find that a cloned successor state has + * no outarcs, especially if we're a bit aggressive about removing unnecessary + * outarcs. If that happens, then there is simply not any interesting state + * that can be reached through the predecessor's loop arcs, which means we can + * break the loop just by removing those loop arcs, with no new states added. + */ +static void +breakconstraintloop(struct nfa * nfa, struct state * sinitial) +{ + struct state *s; + struct state *shead; + struct state *stail; + struct state *sclone; + struct state *nexts; + struct arc *refarc; + struct arc *a; + struct arc *nexta; + + /* + * Start by identifying which loop step we want to break at. + * Preferentially this is one with only one constraint arc. (XXX are + * there any other secondary heuristics we want to use here?) Set refarc + * to point to the selected lone constraint arc, if there is one. + */ + refarc = NULL; + s = sinitial; + do { + nexts = s->tmp; + assert(nexts != s); /* should not see any one-element loops */ + if (refarc == NULL) { + int narcs = 0; + + for (a = s->outs; a != NULL; a = a->outchain) { + if (a->to == nexts && isconstraintarc(a)) { + refarc = a; + narcs++; + } + } + assert(narcs > 0); + if (narcs > 1) { + refarc = NULL; /* multiple constraint arcs here, no good */ + } + } + s = nexts; + } while (s != sinitial); + + if (refarc) { + /* break at the refarc */ + shead = refarc->from; + stail = refarc->to; + assert(stail == shead->tmp); + } else { + /* for lack of a better idea, break after sinitial */ + shead = sinitial; + stail = sinitial->tmp; + } + + /* + * Reset the tmp fields so that we can use them for local storage in + * clonesuccessorstates. (findconstraintloop won't mind, since it's just + * going to abandon its search anyway.) + */ + for (s = nfa->states; s != NULL; s = s->next) { + s->tmp = NULL; + } + + /* + * Recursively build clone state(s) as needed. + */ + sclone = newstate(nfa); + if (sclone == NULL) { + assert(NISERR()); + return; + } + + clonesuccessorstates(nfa, stail, sclone, shead, refarc, + NULL, NULL, nfa->nstates); + + if (NISERR()) { + return; + } + + /* + * It's possible that sclone has no outarcs at all, in which case it's + * useless. (We don't try extremely hard to get rid of useless states + * here, but this is an easy and fairly common case.) + */ + if (sclone->nouts == 0) { + freestate(nfa, sclone); + sclone = NULL; + } + + /* + * Move shead's constraint-loop arcs to point to sclone, or just drop them + * if we discovered we don't need sclone. + */ + for (a = shead->outs; a != NULL; a = nexta) { + nexta = a->outchain; + if (a->to == stail && isconstraintarc(a)) { + if (sclone) { + cparc(nfa, a, shead, sclone); + } + freearc(nfa, a); + if (NISERR()) { + break; + } + } + } +} + +/* + * clonesuccessorstates - create a tree of constraint-arc successor states + * + * ssource is the state to be cloned, and sclone is the state to copy its + * outarcs into. sclone's inarcs, if any, should already be set up. + * + * spredecessor is the original predecessor state that we are trying to build + * successors for (it may not be the immediate predecessor of ssource). + * refarc, if not NULL, is the original constraint arc that is known to have + * been traversed out of spredecessor to reach the successor(s). + * + * For each cloned successor state, we transiently create a "donemap" that is + * a boolean array showing which source states we've already visited for this + * clone state. This prevents infinite recursion as well as useless repeat + * visits to the same state subtree (which can add up fast, since typical NFAs + * have multiple redundant arc pathways). Each donemap is a char array + * indexed by state number. The donemaps are all of the same size "nstates", + * which is nfa->nstates as of the start of the recursion. This is enough to + * have entries for all pre-existing states, but *not* entries for clone + * states created during the recursion. That's okay since we have no need to + * mark those. + * + * curdonemap is NULL when recursing to a new sclone state, or sclone's + * donemap when we are recursing without having created a new state (which we + * do when we decide we can merge a successor state into the current clone + * state). outerdonemap is NULL at the top level and otherwise the parent + * clone state's donemap. + * + * The successor states we create and fill here form a strict tree structure, + * with each state having exactly one predecessor, except that the toplevel + * state has no inarcs as yet (breakconstraintloop will add its inarcs from + * spredecessor after we're done). Thus, we can examine sclone's inarcs back + * to the root, plus refarc if any, to identify the set of constraints already + * known valid at the current point. This allows us to avoid generating extra + * successor states. + */ +static void +clonesuccessorstates( + struct nfa * nfa, + struct state * ssource, + struct state * sclone, + struct state * spredecessor, + struct arc * refarc, + char *curdonemap, + char *outerdonemap, + int nstates) +{ + char *donemap; + struct arc *a; + + /* Since this is recursive, it could be driven to stack overflow */ + if (STACK_TOO_DEEP(nfa->v->re)) { + NERR(REG_ETOOBIG); + return; + } + + /* If this state hasn't already got a donemap, create one */ + donemap = curdonemap; + if (donemap == NULL) { + donemap = (char *) MALLOC(nstates * sizeof(char)); + if (donemap == NULL) { + NERR(REG_ESPACE); + return; + } + + if (outerdonemap != NULL) { + /* + * Not at outermost recursion level, so copy the outer level's + * donemap; this ensures that we see states in process of being + * visited at outer levels, or already merged into predecessor + * states, as ones we shouldn't traverse back to. + */ + memcpy(donemap, outerdonemap, nstates * sizeof(char)); + } else { + /* At outermost level, only spredecessor is off-limits */ + memset(donemap, 0, nstates * sizeof(char)); + assert(spredecessor->no < nstates); + donemap[spredecessor->no] = 1; + } + } + + /* Mark ssource as visited in the donemap */ + assert(ssource->no < nstates); + assert(donemap[ssource->no] == 0); + donemap[ssource->no] = 1; + + /* + * We proceed by first cloning all of ssource's outarcs, creating new + * clone states as needed but not doing more with them than that. Then in + * a second pass, recurse to process the child clone states. This allows + * us to have only one child clone state per reachable source state, even + * when there are multiple outarcs leading to the same state. Also, when + * we do visit a child state, its set of inarcs is known exactly, which + * makes it safe to apply the constraint-is-already-checked optimization. + * Also, this ensures that we've merged all the states we can into the + * current clone before we recurse to any children, thus possibly saving + * them from making extra images of those states. + * + * While this function runs, child clone states of the current state are + * marked by setting their tmp fields to point to the original state they + * were cloned from. This makes it possible to detect multiple outarcs + * leading to the same state, and also makes it easy to distinguish clone + * states from original states (which will have tmp == NULL). + */ + for (a = ssource->outs; a != NULL && !NISERR(); a = a->outchain) { + struct state *sto = a->to; + + /* + * We do not consider cloning successor states that have no constraint + * outarcs; just link to them as-is. They cannot be part of a + * constraint loop so there is no need to make copies. In particular, + * this rule keeps us from trying to clone the post state, which would + * be a bad idea. + */ + if (isconstraintarc(a) && hasconstraintout(sto)) { + struct state *prevclone; + int canmerge; + struct arc *a2; + + /* + * Back-link constraint arcs must not be followed. Nor is there a + * need to revisit states previously merged into this clone. + */ + assert(sto->no < nstates); + if (donemap[sto->no] != 0) { + continue; + } + + /* + * Check whether we already have a child clone state for this + * source state. + */ + prevclone = NULL; + for (a2 = sclone->outs; a2 != NULL; a2 = a2->outchain) { + if (a2->to->tmp == sto) { + prevclone = a2->to; + break; + } + } + + /* + * If this arc is labeled the same as refarc, or the same as any + * arc we must have traversed to get to sclone, then no additional + * constraints need to be met to get to sto, so we should just + * merge its outarcs into sclone. + */ + if (refarc && a->type == refarc->type && a->co == refarc->co) { + canmerge = 1; + } else { + struct state *s; + + canmerge = 0; + for (s = sclone; s->ins; s = s->ins->from) { + if (s->nins == 1 && + a->type == s->ins->type && a->co == s->ins->co) { + canmerge = 1; + break; + } + } + } + + if (canmerge) { + /* + * We can merge into sclone. If we previously made a child + * clone state, drop it; there's no need to visit it. (This + * can happen if ssource has multiple pathways to sto, and we + * only just now found one that is provably a no-op.) + */ + if (prevclone) { + dropstate(nfa, prevclone); /* kills our outarc, too */ + } + + /* Recurse to merge sto's outarcs into sclone */ + clonesuccessorstates(nfa, sto, sclone, spredecessor, refarc, + donemap, outerdonemap, nstates); + /* sto should now be marked as previously visited */ + assert(NISERR() || donemap[sto->no] == 1); + } else if (prevclone) { + /* + * We already have a clone state for this successor, so just + * make another arc to it. + */ + cparc(nfa, a, sclone, prevclone); + } else { + /* + * We need to create a new successor clone state. + */ + struct state *stoclone; + + stoclone = newstate(nfa); + if (stoclone == NULL) { + assert(NISERR()); + break; + } + /* Mark it as to what it's a clone of */ + stoclone->tmp = sto; + /* ... and add the outarc leading to it */ + cparc(nfa, a, sclone, stoclone); + } + } else { + /* + * Non-constraint outarcs just get copied to sclone, as do outarcs + * leading to states with no constraint outarc. + */ + cparc(nfa, a, sclone, sto); + } + } + + /* + * If we are at outer level for this clone state, recurse to all its child + * clone states, clearing their tmp fields as we go. (If we're not + * outermost for sclone, leave this to be done by the outer call level.) + * Note that if we have multiple outarcs leading to the same clone state, + * it will only be recursed-to once. + */ + if (curdonemap == NULL) { + for (a = sclone->outs; a != NULL && !NISERR(); a = a->outchain) { + struct state *stoclone = a->to; + struct state *sto = stoclone->tmp; + + if (sto != NULL) { + stoclone->tmp = NULL; + clonesuccessorstates(nfa, sto, stoclone, spredecessor, refarc, + NULL, donemap, nstates); + } + } + + /* Don't forget to free sclone's donemap when done with it */ + FREE(donemap); + } +} /* - cleanup - clean up NFA after optimizations @@ -1618,7 +2165,7 @@ analyze( } /* - - compact - compact an NFA + - compact - construct the compact representation of an NFA ^ static VOID compact(struct nfa *, struct cnfa *); */ static void @@ -1687,7 +2234,7 @@ compact( cnfa->flags |= HASLACONS; break; default: - assert(NOTREACHED); + NERR(REG_ASSERT); break; } } diff --git a/generic/regcomp.c b/generic/regcomp.c index b1c02d8..27bb736 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -149,6 +149,13 @@ static int combine(struct arc *, struct arc *); static void fixempties(struct nfa *, FILE *); static struct state *emptyreachable(struct state *, struct state *); static void replaceempty(struct nfa *, struct state *, struct state *); +static int isconstraintarc(struct arc *); +static int hasconstraintout(struct state *); +static void fixconstraintloops(struct nfa *, FILE *); +static int findconstraintloop(struct nfa *, struct state *); +static void breakconstraintloop(struct nfa *, struct state *); +static void clonesuccessorstates(struct nfa *, struct state *, struct state *, + struct state *, struct arc *, char *, char *, int); static void cleanup(struct nfa *); static void markreachable(struct nfa *, struct state *, struct state *, struct state *); static void markcanreach(struct nfa *, struct state *, struct state *, struct state *); diff --git a/tests/reg.test b/tests/reg.test index 0ebfa11..b259ce5 100644 --- a/tests/reg.test +++ b/tests/reg.test @@ -1068,6 +1068,31 @@ test reg-33.13 {Bug 1810264 - infinite loop} { test reg-33.14 {Bug 1810264 - super-expensive expression} nonPortable { regexp {(x{200}){200}$y} {x} } 0 + +test reg-33.15 {constraint fixes} { + regexp {(^)+^} x +} 1 +test reg-33.16 {constraint fixes} { + regexp {($^)+} x +} 0 +test reg-33.17 {constraint fixes} { + regexp {(^$)*} x +} 1 +test reg-33.18 {constraint fixes} { + regexp {(^(?!aa))+} {aa bb cc} +} 0 +test reg-33.19 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {aa x} +} 0 +test reg-33.20 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {bb x} +} 0 +test reg-33.21 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {cc x} +} 0 +test reg-33.22 {constraint fixes} { + regexp {(^(?!aa)(?!bb)(?!cc))+} {dd x} +} 1 # cleanup ::tcltest::cleanupTests -- cgit v0.12 From 8ed7672ab71b54afa94e164e73fdc274b0b39771 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 19 Oct 2015 19:32:04 +0000 Subject: Adaptation of re-oNsquared.patch from Tom Lane @ postgres. --- generic/regc_nfa.c | 805 ++++++++++++++++++++++++++++++++++++++++++++++------- generic/regcomp.c | 10 +- generic/regguts.h | 4 +- 3 files changed, 720 insertions(+), 99 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 20eb3ba..0f572b8 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -35,6 +35,8 @@ #define NISERR() VISERR(nfa->v) #define NERR(e) VERR(nfa->v, (e)) #define STACK_TOO_DEEP(x) (0) +#define CANCEL_REQUESTED(x) (0) +#define REG_CANCEL 777 /* - newnfa - set up an NFA @@ -322,6 +324,10 @@ destroystate( ^ static VOID newarc(struct nfa *, int, pcolor, struct state *, ^ struct state *); */ +/* + * This function checks to make sure that no duplicate arcs are created. + * In general we never want duplicates. + */ static void newarc( struct nfa *nfa, @@ -334,16 +340,42 @@ newarc( assert(from != NULL && to != NULL); - /* - * Check for duplicates. - */ - - for (a=from->outs ; a!=NULL ; a=a->outchain) { - if (a->to == to && a->co == co && a->type == t) { - return; + /* check for duplicate arc, using whichever chain is shorter */ + if (from->nouts <= to->nins) { + for (a = from->outs; a != NULL; a = a->outchain) { + if (a->to == to && a->co == co && a->type == t) { + return; + } + } + } else { + for (a = to->ins; a != NULL; a = a->inchain) { + if (a->from == from && a->co == co && a->type == t) { + return; + } } } + + /* no dup, so create the arc */ + createarc(nfa, t, co, from, to); +} +/* + * createarc - create a new arc within an NFA + * + * This function must *only* be used after verifying that there is no existing + * identical arc (same type/color/from/to). + */ +static void +createarc( + struct nfa * nfa, + int t, + pcolor co, + struct state * from, + struct state * to) +{ + struct arc *a; + + /* the arc is physically allocated within its from-state */ a = allocarc(nfa, from); if (NISERR()) { return; @@ -356,15 +388,21 @@ newarc( a->from = from; /* - * Put the new arc on the beginning, not the end, of the chains. Not only - * is this easier, it has the very useful side effect that deleting the - * most-recently-added arc is the cheapest case rather than the most - * expensive one. + * Put the new arc on the beginning, not the end, of the chains; it's + * simpler here, and freearc() is the same cost either way. See also the + * logic in moveins() and its cohorts, as well as fixempties(). */ - a->inchain = to->ins; + a->inchainRev = NULL; + if (to->ins) { + to->ins->inchainRev = a; + } to->ins = a; a->outchain = from->outs; + a->outchainRev = NULL; + if (from->outs) { + from->outs->outchainRev = a; + } from->outs = a; from->nouts++; @@ -437,7 +475,7 @@ freearc( { struct state *from = victim->from; struct state *to = victim->to; - struct arc *a; + struct arc *predecessor; assert(victim->type != 0); @@ -454,16 +492,17 @@ freearc( */ assert(from != NULL); - assert(from->outs != NULL); - a = from->outs; - if (a == victim) { /* simple case: first in chain */ + predecessor = victim->outchainRev; + if (predecessor == NULL) { + assert(from->outs == victim); from->outs = victim->outchain; } else { - for (; a!=NULL && a->outchain!=victim ; a=a->outchain) { - continue; - } - assert(a != NULL); - a->outchain = victim->outchain; + assert(predecessor->outchain == victim); + predecessor->outchain = victim->outchain; + } + if (victim->outchain != NULL) { + assert(victim->outchain->outchainRev == victim); + victim->outchain->outchainRev = predecessor; } from->nouts--; @@ -472,31 +511,78 @@ freearc( */ assert(to != NULL); - assert(to->ins != NULL); - a = to->ins; - if (a == victim) { /* simple case: first in chain */ + predecessor = victim->inchainRev; + if (predecessor == NULL) { + assert(to->ins == victim); to->ins = victim->inchain; } else { - for (; a->inchain!=victim ; a=a->inchain) { - assert(a->inchain != NULL); - continue; - } - a->inchain = victim->inchain; + assert(predecessor->inchain == victim); + predecessor->inchain = victim->inchain; + } + if (victim->inchain != NULL) { + assert(victim->inchain->inchainRev == victim); + victim->inchain->inchainRev = predecessor; } to->nins--; /* - * Clean up and place on free list. + * Clean up and place on from-state's free list. */ victim->type = 0; victim->from = NULL; /* precautions... */ victim->to = NULL; victim->inchain = NULL; + victim->inchainRev = NULL; victim->outchain = NULL; + victim->outchainRev = NULL; victim->freechain = from->free; from->free = victim; } + +/* + * changearctarget - flip an arc to have a different to state + * + * Caller must have verified that there is no pre-existing duplicate arc. + * + * Note that because we store arcs in their from state, we can't easily have + * a similar changearcsource function. + */ +static void +changearctarget(struct arc * a, struct state * newto) +{ + struct state *oldto = a->to; + struct arc *predecessor; + + assert(oldto != newto); + + /* take it off old target's in-chain */ + assert(oldto != NULL); + predecessor = a->inchainRev; + if (predecessor == NULL) { + assert(oldto->ins == a); + oldto->ins = a->inchain; + } else { + assert(predecessor->inchain == a); + predecessor->inchain = a->inchain; + } + if (a->inchain != NULL) { + assert(a->inchain->inchainRev == a); + a->inchain->inchainRev = predecessor; + } + oldto->nins--; + + a->to = newto; + + /* prepend it to new target's in-chain */ + a->inchain = newto->ins; + a->inchainRev = NULL; + if (newto->ins) { + newto->ins->inchainRev = a; + } + newto->ins = a; + newto->nins++; +} /* - hasnonemptyout - Does state have a non-EMPTY out arc? @@ -589,13 +675,181 @@ cparc( { newarc(nfa, oa->type, oa->co, from, to); } + +/* + * sortins - sort the in arcs of a state by from/color/type + */ +static void +sortins( + struct nfa * nfa, + struct state * s) +{ + struct arc **sortarray; + struct arc *a; + int n = s->nins; + int i; + + if (n <= 1) { + return; /* nothing to do */ + } + /* make an array of arc pointers ... */ + sortarray = (struct arc **) MALLOC(n * sizeof(struct arc *)); + if (sortarray == NULL) { + NERR(REG_ESPACE); + return; + } + i = 0; + for (a = s->ins; a != NULL; a = a->inchain) { + sortarray[i++] = a; + } + assert(i == n); + /* ... sort the array */ + qsort(sortarray, n, sizeof(struct arc *), sortins_cmp); + /* ... and rebuild arc list in order */ + /* it seems worth special-casing first and last items to simplify loop */ + a = sortarray[0]; + s->ins = a; + a->inchain = sortarray[1]; + a->inchainRev = NULL; + for (i = 1; i < n - 1; i++) { + a = sortarray[i]; + a->inchain = sortarray[i + 1]; + a->inchainRev = sortarray[i - 1]; + } + a = sortarray[i]; + a->inchain = NULL; + a->inchainRev = sortarray[i - 1]; + FREE(sortarray); +} + +static int +sortins_cmp( + const void *a, + const void *b) +{ + const struct arc *aa = *((const struct arc * const *) a); + const struct arc *bb = *((const struct arc * const *) b); + + /* we check the fields in the order they are most likely to be different */ + if (aa->from->no < bb->from->no) { + return -1; + } + if (aa->from->no > bb->from->no) { + return 1; + } + if (aa->co < bb->co) { + return -1; + } + if (aa->co > bb->co) { + return 1; + } + if (aa->type < bb->type) { + return -1; + } + if (aa->type > bb->type) { + return 1; + } + return 0; +} + +/* + * sortouts - sort the out arcs of a state by to/color/type + */ +static void +sortouts( + struct nfa * nfa, + struct state * s) +{ + struct arc **sortarray; + struct arc *a; + int n = s->nouts; + int i; + + if (n <= 1) { + return; /* nothing to do */ + } + /* make an array of arc pointers ... */ + sortarray = (struct arc **) MALLOC(n * sizeof(struct arc *)); + if (sortarray == NULL) { + NERR(REG_ESPACE); + return; + } + i = 0; + for (a = s->outs; a != NULL; a = a->outchain) { + sortarray[i++] = a; + } + assert(i == n); + /* ... sort the array */ + qsort(sortarray, n, sizeof(struct arc *), sortouts_cmp); + /* ... and rebuild arc list in order */ + /* it seems worth special-casing first and last items to simplify loop */ + a = sortarray[0]; + s->outs = a; + a->outchain = sortarray[1]; + a->outchainRev = NULL; + for (i = 1; i < n - 1; i++) { + a = sortarray[i]; + a->outchain = sortarray[i + 1]; + a->outchainRev = sortarray[i - 1]; + } + a = sortarray[i]; + a->outchain = NULL; + a->outchainRev = sortarray[i - 1]; + FREE(sortarray); +} + +static int +sortouts_cmp( + const void *a, + const void *b) +{ + const struct arc *aa = *((const struct arc * const *) a); + const struct arc *bb = *((const struct arc * const *) b); + + /* we check the fields in the order they are most likely to be different */ + if (aa->to->no < bb->to->no) { + return -1; + } + if (aa->to->no > bb->to->no) { + return 1; + } + if (aa->co < bb->co) { + return -1; + } + if (aa->co > bb->co) { + return 1; + } + if (aa->type < bb->type) { + return -1; + } + if (aa->type > bb->type) { + return 1; + } + return 0; +} + +/* + * Common decision logic about whether to use arc-by-arc operations or + * sort/merge. If there's just a few source arcs we cannot recoup the + * cost of sorting the destination arc list, no matter how large it is. + * Otherwise, limit the number of arc-by-arc comparisons to about 1000 + * (a somewhat arbitrary choice, but the breakeven point would probably + * be machine dependent anyway). + */ +#define BULK_ARC_OP_USE_SORT(nsrcarcs, ndestarcs) \ + ((nsrcarcs) < 4 ? 0 : ((nsrcarcs) > 32 || (ndestarcs) > 32)) /* - moveins - move all in arcs of a state to another state * You might think this could be done better by just updating the - * existing arcs, and you would be right if it weren't for the desire + * existing arcs, and you would be right if it weren't for the need * for duplicate suppression, which makes it easier to just make new * ones to exploit the suppression built into newarc. + * + * However, if we have a whole lot of arcs to deal with, retail duplicate + * checks become too slow. In that case we proceed by sorting and merging + * the arc lists, and then we can indeed just update the arcs in-place. + * ^ static VOID moveins(struct nfa *, struct state *, struct state *); */ static void @@ -604,14 +858,79 @@ moveins( struct state *oldState, struct state *newState) { - struct arc *a; - assert(oldState != newState); - while ((a = oldState->ins) != NULL) { - cparc(nfa, a, a->from, newState); - freearc(nfa, a); + if (!BULK_ARC_OP_USE_SORT(oldState->nins, newState->nins)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + while ((a = oldState->ins) != NULL) { + cparc(nfa, a, a->from, newState); + freearc(nfa, a); + } + } else { + /* + * With many arcs, use a sort-merge approach. Note changearctarget() + * will put the arc onto the front of newState's chain, so it does not + * break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + sortins(nfa, oldState); + sortins(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->ins; + na = newState->ins; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + switch (sortins_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->inchain; + + /* + * Rather than doing createarc+freearc, we can just unlink + * and relink the existing arc struct. + */ + changearctarget(a, newState); + break; + case 0: + /* match, advance in both lists */ + oa = oa->inchain; + na = na->inchain; + /* ... and drop duplicate arc from oldState */ + freearc(nfa, a); + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->inchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + oa = oa->inchain; + changearctarget(a, newState); + } } + assert(oldState->nins == 0); assert(oldState->ins == NULL); } @@ -628,14 +947,178 @@ copyins( struct state *newState, int all) { - struct arc *a; - assert(oldState != newState); - for (a=oldState->ins ; a!=NULL ; a=a->inchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, a->from, newState); + if (!BULK_ARC_OP_USE_SORT(oldState->nins, newState->nins)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + for (a = oldState->ins; a != NULL; a = a->inchain) { + if (all || a->type != EMPTY) { + cparc(nfa, a, a->from, newState); + } + } + } else { + /* + * With many arcs, use a sort-merge approach. Note that createarc() + * will put new arcs onto the front of newState's chain, so it does + * not break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; } + + sortins(nfa, oldState); + sortins(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->ins; + na = newState->ins; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + if (!all && a->type == EMPTY) { + oa = oa->inchain; + continue; + } + + switch (sortins_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->inchain; + createarc(nfa, a->type, a->co, a->from, newState); + break; + case 0: + /* match, advance in both lists */ + oa = oa->inchain; + na = na->inchain; + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->inchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + if (!all && a->type == EMPTY) { + oa = oa->inchain; + continue; + } + + oa = oa->inchain; + createarc(nfa, a->type, a->co, a->from, newState); + } + } +} + +/* + * mergeins - merge a list of inarcs into a state + * + * This is much like copyins, but the source arcs are listed in an array, + * and are not guaranteed unique. It's okay to clobber the array contents. + */ +static void +mergeins( + struct nfa * nfa, + struct state * s, + struct arc ** arcarray, + int arccount) +{ + struct arc *na; + int i; + int j; + + if (arccount <= 0) { + return; + } + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + /* Sort existing inarcs as well as proposed new ones */ + sortins(nfa, s); + if (NISERR()) { + return; /* might have failed to sort */ + } + + qsort(arcarray, arccount, sizeof(struct arc *), sortins_cmp); + + /* + * arcarray very likely includes dups, so we must eliminate them. (This + * could be folded into the next loop, but it's not worth the trouble.) + */ + j = 0; + for (i = 1; i < arccount; i++) { + switch (sortins_cmp(&arcarray[j], &arcarray[i])) { + case -1: + /* non-dup */ + arcarray[++j] = arcarray[i]; + break; + case 0: + /* dup */ + break; + default: + /* trouble */ + assert(NOTREACHED); + } + } + arccount = j + 1; + + /* + * Now merge into s' inchain. Note that createarc() will put new arcs + * onto the front of s's chain, so it does not break our walk through the + * sorted part of the chain. + */ + i = 0; + na = s->ins; + while (i < arccount && na != NULL) { + struct arc *a = arcarray[i]; + + switch (sortins_cmp(&a, &na)) { + case -1: + /* s does not have anything matching a */ + createarc(nfa, a->type, a->co, a->from, s); + i++; + break; + case 0: + /* match, advance in both lists */ + i++; + na = na->inchain; + break; + case +1: + /* advance only na; array might have a match later */ + na = na->inchain; + break; + default: + assert(NOTREACHED); + } + } + while (i < arccount) { + /* s does not have anything matching a */ + struct arc *a = arcarray[i]; + + createarc(nfa, a->type, a->co, a->from, s); + i++; } } @@ -649,14 +1132,78 @@ moveouts( struct state *oldState, struct state *newState) { - struct arc *a; - assert(oldState != newState); - while ((a = oldState->outs) != NULL) { - cparc(nfa, a, newState, a->to); - freearc(nfa, a); + if (!BULK_ARC_OP_USE_SORT(oldState->nouts, newState->nouts)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + while ((a = oldState->outs) != NULL) { + cparc(nfa, a, newState, a->to); + freearc(nfa, a); + } + } else { + /* + * With many arcs, use a sort-merge approach. Note that createarc() + * will put new arcs onto the front of newState's chain, so it does + * not break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + sortouts(nfa, oldState); + sortouts(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->outs; + na = newState->outs; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + switch (sortouts_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); + freearc(nfa, a); + break; + case 0: + /* match, advance in both lists */ + oa = oa->outchain; + na = na->outchain; + /* ... and drop duplicate arc from oldState */ + freearc(nfa, a); + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->outchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); + freearc(nfa, a); + } } + + assert(oldState->nouts == 0); + assert(oldState->outs == NULL); } /* @@ -671,13 +1218,80 @@ copyouts( struct state *newState, int all) { - struct arc *a; - assert(oldState != newState); - for (a=oldState->outs ; a!=NULL ; a=a->outchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, newState, a->to); + if (!BULK_ARC_OP_USE_SORT(oldState->nouts, newState->nouts)) { + /* With not too many arcs, just do them one at a time */ + struct arc *a; + + for (a = oldState->outs; a != NULL; a = a->outchain) { + if (all || a->type != EMPTY) { + cparc(nfa, a, newState, a->to); + } + } + } else { + /* + * With many arcs, use a sort-merge approach. Note that createarc() + * will put new arcs onto the front of newState's chain, so it does + * not break our walk through the sorted part of the chain. + */ + struct arc *oa; + struct arc *na; + + /* + * Because we bypass newarc() in this code path, we'd better include a + * cancel check. + */ + if (CANCEL_REQUESTED(nfa->v->re)) { + NERR(REG_CANCEL); + return; + } + + sortouts(nfa, oldState); + sortouts(nfa, newState); + if (NISERR()) { + return; /* might have failed to sort */ + } + oa = oldState->outs; + na = newState->outs; + while (oa != NULL && na != NULL) { + struct arc *a = oa; + + if (!all && a->type == EMPTY) { + oa = oa->outchain; + continue; + } + + switch (sortouts_cmp(&oa, &na)) { + case -1: + /* newState does not have anything matching oa */ + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); + break; + case 0: + /* match, advance in both lists */ + oa = oa->outchain; + na = na->outchain; + break; + case +1: + /* advance only na; oa might have a match later */ + na = na->outchain; + break; + default: + assert(NOTREACHED); + } + } + while (oa != NULL) { + /* newState does not have anything matching oa */ + struct arc *a = oa; + + if (!all && a->type == EMPTY){ + oa = oa->outchain; + continue; + } + + oa = oa->outchain; + createarc(nfa, a->type, a->co, newState, a->to); } } } @@ -2238,7 +2852,7 @@ compact( break; } } - carcsort(first, ca-1); + carcsort(first, ca - first); ca->co = COLORLESS; ca->to = 0; ca++; @@ -2258,33 +2872,39 @@ compact( /* - carcsort - sort compacted-NFA arcs by color - * Really dumb algorithm, but if the list is long enough for that to matter, - * you're in real trouble anyway. ^ static VOID carcsort(struct carc *, struct carc *); */ static void carcsort( struct carc *first, - struct carc *last) + size_t n) { - struct carc *p; - struct carc *q; - struct carc tmp; - - if (last - first <= 1) { - return; + if (n > 1) { + qsort(first, n, sizeof(struct carc), carc_cmp); } +} - for (p = first; p <= last; p++) { - for (q = p; q <= last; q++) { - if (p->co > q->co || (p->co == q->co && p->to > q->to)) { - assert(p != q); - tmp = *p; - *p = *q; - *q = tmp; - } - } +static int +carc_cmp( + const void *a, + const void *b) +{ + const struct carc *aa = (const struct carc *) a; + const struct carc *bb = (const struct carc *) b; + + if (aa->co < bb->co) { + return -1; + } + if (aa->co > bb->co) { + return +1; + } + if (aa->to < bb->to) { + return -1; } + if (aa->to > bb->to) { + return +1; + } + return 0; } /* @@ -2382,37 +3002,28 @@ dumparcs( FILE *f) { int pos; + struct arc *a; - assert(s->nouts > 0); - /* printing arcs in reverse order is usually clearer */ - pos = dumprarcs(s->outs, s, f, 1); - if (pos != 1) { - fprintf(f, "\n"); - } -} - -/* - - dumprarcs - dump remaining outarcs, recursively, in reverse order - ^ static int dumprarcs(struct arc *, struct state *, FILE *, int); - */ -static int /* resulting print position */ -dumprarcs( - struct arc *a, - struct state *s, - FILE *f, - int pos) /* initial print position */ -{ - if (a->outchain != NULL) { - pos = dumprarcs(a->outchain, s, f, pos); + /* printing oldest arcs first is usually clearer */ + a = s->outs; + assert(a != NULL); + while (a->outchain != NULL) { + a = a->outchain; } - dumparc(a, s, f); - if (pos == 5) { + pos = 1; + do { + dumparc(a, s, f); + if (pos == 5) { + fprintf(f, "\n"); + pos = 1; + } else { + pos++; + } + a = a->outchainRev; + } while (a != NULL); + if (pos != 1) { fprintf(f, "\n"); - pos = 1; - } else { - pos++; } - return pos; } /* diff --git a/generic/regcomp.c b/generic/regcomp.c index 27bb736..b01311b 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -119,15 +119,22 @@ static void dropstate(struct nfa *, struct state *); static void freestate(struct nfa *, struct state *); static void destroystate(struct nfa *, struct state *); static void newarc(struct nfa *, int, pcolor, struct state *, struct state *); +static void createarc(struct nfa *, int, pcolor, struct state *, struct state *); static struct arc *allocarc(struct nfa *, struct state *); static void freearc(struct nfa *, struct arc *); +static void changearctarget(struct arc *, struct state *); static int hasnonemptyout(struct state *); static int nonemptyouts(struct state *); static int nonemptyins(struct state *); static struct arc *findarc(struct state *, int, pcolor); static void cparc(struct nfa *, struct arc *, struct state *, struct state *); +static void sortins(struct nfa *, struct state *); +static int sortins_cmp(const void *, const void *); +static void sortouts(struct nfa *, struct state *); +static int sortouts_cmp(const void *, const void *); static void moveins(struct nfa *, struct state *, struct state *); static void copyins(struct nfa *, struct state *, struct state *, int); +static void mergeins(struct nfa *, struct state *, struct arc **, int); static void moveouts(struct nfa *, struct state *, struct state *); static void copyouts(struct nfa *, struct state *, struct state *, int); static void cloneouts(struct nfa *, struct state *, struct state *, struct state *, int); @@ -161,7 +168,8 @@ static void markreachable(struct nfa *, struct state *, struct state *, struct s static void markcanreach(struct nfa *, struct state *, struct state *, struct state *); static long analyze(struct nfa *); static void compact(struct nfa *, struct cnfa *); -static void carcsort(struct carc *, struct carc *); +static void carcsort(struct carc *, size_t); +static int carc_cmp(const void *, const void *); static void freecnfa(struct cnfa *); static void dumpnfa(struct nfa *, FILE *); #ifdef REG_DEBUG diff --git a/generic/regguts.h b/generic/regguts.h index ac625d5..7ed8ec1 100644 --- a/generic/regguts.h +++ b/generic/regguts.h @@ -265,8 +265,10 @@ struct arc { struct state *from; /* where it's from (and contained within) */ struct state *to; /* where it's to */ struct arc *outchain; /* *from's outs chain or free chain */ -#define freechain outchain + struct arc *outchainRev; /* back-link in *from's outs chain */ +#define freechain outchain /* we do not maintain "freechainRev" */ struct arc *inchain; /* *to's ins chain */ + struct arc *inchainRev; /* back-link in *to's ins chain */ struct arc *colorchain; /* color's arc chain */ struct arc *colorchainRev; /* back-link in color's arc chain */ }; -- cgit v0.12 From f12c713f8e323f0c7872d83c93b2371c7eb42365 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 18:32:25 +0000 Subject: Adaptation of re-better-fixempties.patch from Tom Lane @ postgres. --- generic/regc_nfa.c | 265 +++++++++++++++++++++++++++-------------------------- generic/regcomp.c | 6 +- 2 files changed, 136 insertions(+), 135 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 0f572b8..5582e4e 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -603,44 +603,6 @@ hasnonemptyout( } /* - - nonemptyouts - count non-EMPTY out arcs of a state - ^ static int nonemptyouts(struct state *); - */ -static int -nonemptyouts( - struct state *s) -{ - int n = 0; - struct arc *a; - - for (a = s->outs; a != NULL; a = a->outchain) { - if (a->type != EMPTY) { - n++; - } - } - return n; -} - -/* - - nonemptyins - count non-EMPTY in arcs of a state - ^ static int nonemptyins(struct state *); - */ -static int -nonemptyins( - struct state *s) -{ - int n = 0; - struct arc *a; - - for (a = s->ins; a != NULL; a = a->inchain) { - if (a->type != EMPTY) { - n++; - } - } - return n; -} - -/* - findarc - find arc, if any, from given source with given type and color * If there is more than one such arc, the result is random. ^ static struct arc *findarc(struct state *, int, pcolor); @@ -1897,6 +1859,12 @@ fixempties( struct state *nexts; struct arc *a; struct arc *nexta; + int totalinarcs; + struct arc **inarcsorig; + struct arc **arcarray; + int arccount; + int prevnins; + int nskip; /* * First, get rid of any states whose sole out-arc is an EMPTY, @@ -1942,42 +1910,129 @@ fixempties( dropstate(nfa, s); } + if (NISERR()) { + return; + } + /* - * For each remaining NFA state, find all other states that are - * reachable from it by a chain of one or more EMPTY arcs. Then - * generate new arcs that eliminate the need for each such chain. + * For each remaining NFA state, find all other states from which it is + * reachable by a chain of one or more EMPTY arcs. Then generate new arcs + * that eliminate the need for each such chain. + * + * We could replace a chain of EMPTY arcs that leads from a "from" state + * to a "to" state either by pushing non-EMPTY arcs forward (linking + * directly from "from"'s predecessors to "to") or by pulling them back + * (linking directly from "from" to "to"'s successors). We choose to + * always do the former; this choice is somewhat arbitrary, but the + * approach below requires that we uniformly do one or the other. + * + * Suppose we have a chain of N successive EMPTY arcs (where N can easily + * approach the size of the NFA). All of the intermediate states must + * have additional inarcs and outarcs, else they'd have been removed by + * the steps above. Assuming their inarcs are mostly not empties, we will + * add O(N^2) arcs to the NFA, since a non-EMPTY inarc leading to any one + * state in the chain must be duplicated to lead to all its successor + * states as well. So there is no hope of doing less than O(N^2) work; + * however, we should endeavor to keep the big-O cost from being even + * worse than that, which it can easily become without care. In + * particular, suppose we were to copy all S1's inarcs forward to S2, and + * then also to S3, and then later we consider pushing S2's inarcs forward + * to S3. If we include the arcs already copied from S1 in that, we'd be + * doing O(N^3) work. (The duplicate-arc elimination built into newarc() + * and its cohorts would get rid of the extra arcs, but not without cost.) + * + * We can avoid this cost by treating only arcs that existed at the start + * of this phase as candidates to be pushed forward. To identify those, + * we remember the first inarc each state had to start with. We rely on + * the fact that newarc() and friends put new arcs on the front of their + * to-states' inchains, and that this phase never deletes arcs, so that + * the original arcs must be the last arcs in their to-states' inchains. + * + * So the process here is that, for each state in the NFA, we gather up + * all non-EMPTY inarcs of states that can reach the target state via + * EMPTY arcs. We then sort, de-duplicate, and merge these arcs into the + * target state's inchain. (We can safely use sort-merge for this as long + * as we update each state's original-arcs pointer after we add arcs to + * it; the sort step of mergeins probably changed the order of the old + * arcs.) * - * If we just do this straightforwardly, the algorithm gets slow in - * complex graphs, because the same arcs get copied to all - * intermediate states of an EMPTY chain, and then uselessly pushed - * repeatedly to the chain's final state; we waste a lot of time in - * newarc's duplicate checking. To improve matters, we decree that - * any state with only EMPTY out-arcs is "doomed" and will not be - * part of the final NFA. That can be ensured by not adding any new - * out-arcs to such a state. Having ensured that, we need not update - * the state's in-arcs list either; all arcs that might have gotten - * pushed forward to it will just get pushed directly to successor - * states. This eliminates most of the useless duplicate arcs. + * Another refinement worth making is that, because we only add non-EMPTY + * arcs during this phase, and all added arcs have the same from-state as + * the non-EMPTY arc they were cloned from, we know ahead of time that any + * states having only EMPTY outarcs will be useless for lack of outarcs + * after we drop the EMPTY arcs. (They cannot gain non-EMPTY outarcs if + * they had none to start with.) So we need not bother to update the + * inchains of such states at all. */ + + /* Remember the states' first original inarcs */ + /* ... and while at it, count how many old inarcs there are altogether */ + inarcsorig = (struct arc **) MALLOC(nfa->nstates * sizeof(struct arc *)); + if (inarcsorig == NULL) { + NERR(REG_ESPACE); + return; + } + totalinarcs = 0; + for (s = nfa->states; s != NULL; s = s->next) { + inarcsorig[s->no] = s->ins; + totalinarcs += s->nins; + } + + /* + * Create a workspace for accumulating the inarcs to be added to the + * current target state. totalinarcs is probably a considerable + * overestimate of the space needed, but the NFA is unlikely to be large + * enough at this point to make it worth being smarter. + */ + arcarray = (struct arc **) MALLOC(totalinarcs * sizeof(struct arc *)); + if (arcarray == NULL) { + NERR(REG_ESPACE); + FREE(inarcsorig); + return; + } + + /* And iterate over the target states */ for (s = nfa->states; s != NULL && !NISERR(); s = s->next) { - for (s2 = emptyreachable(s, s); s2 != s && !NISERR(); - s2 = nexts) { - /* - * If s2 is doomed, we decide that (1) we will always push - * arcs forward to it, not pull them back to s; and (2) we - * can optimize away the push-forward, per comment above. - * So do nothing. - */ - if (s2->flag || hasnonemptyout(s2)) { - replaceempty(nfa, s, s2); + /* Ignore target states without non-EMPTY outarcs, per note above */ + if (!s->flag && !hasnonemptyout(s)) { + continue; + } + + /* Find predecessor states and accumulate their original inarcs */ + arccount = 0; + for (s2 = emptyreachable(nfa, s, s, inarcsorig); s2 != s; s2 = nexts) { + /* Add s2's original inarcs to arcarray[], but ignore empties */ + for (a = inarcsorig[s2->no]; a != NULL; a = a->inchain) { + if (a->type != EMPTY) { + arcarray[arccount++] = a; + } } + + /* Reset the tmp fields as we walk back */ + nexts = s2->tmp; + s2->tmp = NULL; + } + s->tmp = NULL; + assert(arccount <= totalinarcs); - /* Reset the tmp fields as we walk back */ - nexts = s2->tmp; - s2->tmp = NULL; + /* Remember how many original inarcs this state has */ + prevnins = s->nins; + + /* Add non-duplicate inarcs to target state */ + mergeins(nfa, s, arcarray, arccount); + + /* Now we must update the state's inarcsorig pointer */ + nskip = s->nins - prevnins; + a = s->ins; + while (nskip-- > 0) { + a = a->inchain; } - s->tmp = NULL; + inarcsorig[s->no] = a; } + + FREE(arcarray); + FREE(inarcsorig); + if (NISERR()) { return; } @@ -2013,90 +2068,38 @@ fixempties( } /* - - emptyreachable - recursively find all states reachable from s by EMPTY arcs + - emptyreachable - recursively find all states that can reach s by EMPTY arcs * The return value is the last such state found. Its tmp field links back * to the next-to-last such state, and so on back to s, so that all these * states can be located without searching the whole NFA. + * + * Since this is only used in fixempties(), we pass in the inarcsorig[] array + * maintained by that function. This lets us skip over all new inarcs, which + * are certainly not EMPTY arcs. + * * The maximum recursion depth here is equal to the length of the longest * loop-free chain of EMPTY arcs, which is surely no more than the size of - * the NFA, and in practice will be a lot less than that. + * the NFA, and in practice will be less than that. ^ static struct state *emptyreachable(struct state *, struct state *); */ static struct state * emptyreachable( + struct nfa *nfa, struct state *s, - struct state *lastfound) + struct state *lastfound, + struct arc **inarcsorig) { struct arc *a; s->tmp = lastfound; lastfound = s; - for (a = s->outs; a != NULL; a = a->outchain) { - if (a->type == EMPTY && a->to->tmp == NULL) { - lastfound = emptyreachable(a->to, lastfound); + for (a = inarcsorig[s->no]; a != NULL; a = a->inchain) { + if (a->type == EMPTY && a->from->tmp == NULL) { + lastfound = emptyreachable(nfa, a->from, lastfound, inarcsorig); } } return lastfound; } - -/* - - replaceempty - replace an EMPTY arc chain with some non-empty arcs - * The EMPTY arc(s) should be deleted later, but we can't do it here because - * they may still be needed to identify other arc chains during fixempties(). - ^ static void replaceempty(struct nfa *, struct state *, struct state *); - */ -static void -replaceempty( - struct nfa *nfa, - struct state *from, - struct state *to) -{ - int fromouts; - int toins; - - assert(from != to); - - /* - * Create replacement arcs that bypass the need for the EMPTY chain. We - * can do this either by pushing arcs forward (linking directly from - * "from"'s predecessors to "to") or by pulling them back (linking - * directly from "from" to "to"'s successors). In general, we choose - * whichever way creates greater fan-out or fan-in, so as to improve the - * odds of reducing the other state to zero in-arcs or out-arcs and - * thereby being able to delete it. However, if "from" is doomed (has no - * non-EMPTY out-arcs), we must keep it so, so always push forward in that - * case. - * - * The fan-out/fan-in comparison should count only non-EMPTY arcs. If - * "from" is doomed, we can skip counting "to"'s arcs, since we want to - * force taking the copynonemptyins path in that case. - */ - fromouts = nonemptyouts(from); - toins = (fromouts == 0) ? 1 : nonemptyins(to); - - if (fromouts > toins) { - copyouts(nfa, to, from, 0); - return; - } - if (fromouts < toins) { - copyins(nfa, from, to, 0); - return; - } - - /* - * fromouts == toins. Decide on secondary issue: copy fewest arcs. - * - * Doesn't seem to be worth the trouble to exclude empties from these - * comparisons; that takes extra time and doesn't seem to improve the - * resulting graph much. - */ - if (from->nins > to->nouts) { - copyouts(nfa, to, from, 0); - return; - } - - copyins(nfa, from, to, 0); -} /* * isconstraintarc - detect whether an arc is of a constraint type diff --git a/generic/regcomp.c b/generic/regcomp.c index b01311b..985cb93 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -124,8 +124,6 @@ static struct arc *allocarc(struct nfa *, struct state *); static void freearc(struct nfa *, struct arc *); static void changearctarget(struct arc *, struct state *); static int hasnonemptyout(struct state *); -static int nonemptyouts(struct state *); -static int nonemptyins(struct state *); static struct arc *findarc(struct state *, int, pcolor); static void cparc(struct nfa *, struct arc *, struct state *, struct state *); static void sortins(struct nfa *, struct state *); @@ -154,8 +152,8 @@ static int push(struct nfa *, struct arc *); #define COMPATIBLE 3 /* compatible but not satisfied yet */ static int combine(struct arc *, struct arc *); static void fixempties(struct nfa *, FILE *); -static struct state *emptyreachable(struct state *, struct state *); -static void replaceempty(struct nfa *, struct state *, struct state *); +static struct state *emptyreachable(struct nfa *, struct state *, + struct state *, struct arc **); static int isconstraintarc(struct arc *); static int hasconstraintout(struct state *); static void fixconstraintloops(struct nfa *, FILE *); -- cgit v0.12 From 5ec3b6491d71b85b55f8927e78f033e75c92170f Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 19:21:53 +0000 Subject: Adaptation of re-better-pushpull.patch from Tom Lane @postgres --- generic/regc_nfa.c | 155 ++++++++++++++++++++++++++++++++++++++++------------- generic/regcomp.c | 4 +- 2 files changed, 119 insertions(+), 40 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 5582e4e..bbc4dd6 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -1518,6 +1518,7 @@ pullback( struct state *nexts; struct arc *a; struct arc *nexta; + struct state *intermediates; int progress; /* @@ -1528,15 +1529,27 @@ pullback( progress = 0; for (s=nfa->states ; s!=NULL && !NISERR() ; s=nexts) { nexts = s->next; + intermediates = NULL; for (a=s->outs ; a!=NULL && !NISERR() ; a=nexta) { nexta = a->outchain; if (a->type == '^' || a->type == BEHIND) { - if (pull(nfa, a)) { + if (pull(nfa, a, &intermediates)) { progress = 1; } } assert(nexta == NULL || s->no != FREESTATE); } + /* clear tmp fields of intermediate states created here */ + while (intermediates != NULL) { + struct state *ns = intermediates->tmp; + + intermediates->tmp = NULL; + intermediates = ns; + } + /* if s is now useless, get rid of it */ + if ((s->nins == 0 || s->nouts == 0) && !s->flag) { + dropstate(nfa, s); + } } if (progress && f != NULL) { dumpnfa(nfa, f); @@ -1564,15 +1577,28 @@ pullback( /* - pull - pull a back constraint backward past its source state - * A significant property of this function is that it deletes at most - * one state -- the constraint's from state -- and only if the constraint - * was that state's last outarc. + * + * Returns 1 if successful (which it always is unless the source is the + * start state or we have an internal error), 0 if nothing happened. + * + * A significant property of this function is that it deletes no pre-existing + * states, and no outarcs of the constraint's from state other than the given + * constraint arc. This makes the loops in pullback() safe, at the cost that + * we may leave useless states behind. Therefore, we leave it to pullback() + * to delete such states. + * + * If the from state has multiple back-constraint outarcs, and/or multiple + * compatible constraint inarcs, we only need to create one new intermediate + * state per combination of predecessor and successor states. *intermediates + * points to a list of such intermediate states for this from state (chained + * through their tmp fields). ^ static int pull(struct nfa *, struct arc *); */ -static int /* 0 couldn't, 1 could */ +static int pull( struct nfa *nfa, - struct arc *con) + struct arc *con, + struct state **intermediates) { struct state *from = con->from; struct state *to = con->to; @@ -1590,7 +1616,9 @@ pull( } /* - * First, clone from state if necessary to avoid other outarcs. + * First, clone from state if necessary to avoid other outarcs. This may + * seem wasteful, but it simplifies the logic, and we'll get rid of the + * clone state again at the bottom. */ if (from->nouts > 1) { @@ -1601,6 +1629,9 @@ pull( copyins(nfa, from, s, 1); /* duplicate inarcs */ cparc(nfa, con, s, to); /* move constraint arc */ freearc(nfa, con); + if (NISERR()) { + return 0; + } from = s; con = from->outs; } @@ -1610,7 +1641,7 @@ pull( * Propagate the constraint into the from state's inarcs. */ - for (a=from->ins ; a!=NULL ; a=nexta) { + for (a=from->ins ; a!=NULL && !NISERR(); a=nexta) { nexta = a->inchain; switch (combine(con, a)) { case INCOMPATIBLE: /* destroy the arc */ @@ -1619,17 +1650,25 @@ pull( case SATISFIED: /* no action needed */ break; case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) { - return 0; + /* need an intermediate state, but might have one already */ + for (s = *intermediates; s != NULL; s = s->tmp) { + assert(s->nins > 0 && s->nouts > 0); + if (s->ins->from == a->from && s->outs->to == to) { + break; + } } - cparc(nfa, a, s, to); /* anticipate move */ - cparc(nfa, con, a->from, s); - if (NISERR()) { - return 0; + if (s == NULL) { + s = newstate(nfa); + if (NISERR()) { + return 0; + } + s->tmp = *intermediates; + *intermediates = s; } - freearc(nfa, a); - break; + cparc(nfa, con, a->from, s); + cparc(nfa, a, s, to); + freearc(nfa, a); + break; default: assert(NOTREACHED); break; @@ -1641,7 +1680,8 @@ pull( */ moveins(nfa, from, to); - dropstate(nfa, from); /* will free the constraint */ + freearc(nfa, con); + /* from state is now useless, but we leave it to pullback() to clean up */ return 1; } @@ -1658,6 +1698,7 @@ pushfwd( struct state *nexts; struct arc *a; struct arc *nexta; + struct state *intermediates; int progress; /* @@ -1668,14 +1709,25 @@ pushfwd( progress = 0; for (s=nfa->states ; s!=NULL && !NISERR() ; s=nexts) { nexts = s->next; + intermediates = NULL; for (a = s->ins; a != NULL && !NISERR(); a = nexta) { nexta = a->inchain; if (a->type == '$' || a->type == AHEAD) { - if (push(nfa, a)) { + if (push(nfa, a, &intermediates)) { progress = 1; } } - assert(nexta == NULL || s->no != FREESTATE); + } + /* clear tmp fields of intermediate states created here */ + while (intermediates != NULL) { + struct state *ns = intermediates->tmp; + + intermediates->tmp = NULL; + intermediates = ns; + } + /* if s is now useless, get rid of it */ + if ((s->nins == 0 || s->nouts == 0) && !s->flag) { + dropstate(nfa, s); } } if (progress && f != NULL) { @@ -1704,15 +1756,28 @@ pushfwd( /* - push - push a forward constraint forward past its destination state - * A significant property of this function is that it deletes at most - * one state -- the constraint's to state -- and only if the constraint - * was that state's last inarc. + * + * Returns 1 if successful (which it always is unless the destination is the + * post state or we have an internal error), 0 if nothing happened. + * + * A significant property of this function is that it deletes no pre-existing + * states, and no inarcs of the constraint's to state other than the given + * constraint arc. This makes the loops in pushfwd() safe, at the cost that + * we may leave useless states behind. Therefore, we leave it to pushfwd() + * to delete such states. + * + * If the to state has multiple forward-constraint inarcs, and/or multiple + * compatible constraint outarcs, we only need to create one new intermediate + * state per combination of predecessor and successor states. *intermediates + * points to a list of such intermediate states for this to state (chained + * through their tmp fields). ^ static int push(struct nfa *, struct arc *); */ -static int /* 0 couldn't, 1 could */ +static int push( struct nfa *nfa, - struct arc *con) + struct arc *con, + struct state **intermediates) { struct state *from = con->from; struct state *to = con->to; @@ -1730,7 +1795,9 @@ push( } /* - * First, clone to state if necessary to avoid other inarcs. + * First, clone to state if necessary to avoid other inarcs. This may + * seem wasteful, but it simplifies the logic, and we'll get rid of the + * clone state again at the bottom. */ if (to->nins > 1) { @@ -1739,8 +1806,11 @@ push( return 0; } copyouts(nfa, to, s, 1); /* duplicate outarcs */ - cparc(nfa, con, from, s); /* move constraint */ + cparc(nfa, con, from, s); /* move constraint arc */ freearc(nfa, con); + if (NISERR()) { + return 0; + } to = s; con = to->ins; } @@ -1750,7 +1820,7 @@ push( * Propagate the constraint into the to state's outarcs. */ - for (a = to->outs; a != NULL; a = nexta) { + for (a = to->outs; a != NULL && !NISERR(); a = nexta) { nexta = a->outchain; switch (combine(con, a)) { case INCOMPATIBLE: /* destroy the arc */ @@ -1759,17 +1829,25 @@ push( case SATISFIED: /* no action needed */ break; case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) { - return 0; + /* need an intermediate state, but might have one already */ + for (s = *intermediates; s != NULL; s = s->tmp) { + assert(s->nins > 0 && s->nouts > 0); + if (s->ins->from == from && s->outs->to == a->to) { + break; + } } - cparc(nfa, con, s, a->to); /* anticipate move */ - cparc(nfa, a, from, s); - if (NISERR()) { - return 0; + if (s == NULL) { + s = newstate(nfa); + if (NISERR()) { + return 0; + } + s->tmp = *intermediates; + *intermediates = s; } - freearc(nfa, a); - break; + cparc(nfa, con, s, a->to); + cparc(nfa, a, from, s); + freearc(nfa, a); + break; default: assert(NOTREACHED); break; @@ -1781,7 +1859,8 @@ push( */ moveouts(nfa, to, from); - dropstate(nfa, to); /* will free the constraint */ + freearc(nfa, con); + /* to state is now useless, but we leave it to pushfwd() to clean up */ return 1; } diff --git a/generic/regcomp.c b/generic/regcomp.c index 985cb93..6b40100 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -144,9 +144,9 @@ static void cleartraverse(struct nfa *, struct state *); static void specialcolors(struct nfa *); static long optimize(struct nfa *, FILE *); static void pullback(struct nfa *, FILE *); -static int pull(struct nfa *, struct arc *); +static int pull(struct nfa *, struct arc *, struct state **); static void pushfwd(struct nfa *, FILE *); -static int push(struct nfa *, struct arc *); +static int push(struct nfa *, struct arc *, struct state **); #define INCOMPATIBLE 1 /* destroys arc */ #define SATISFIED 2 /* constraint satisfied */ #define COMPATIBLE 3 /* compatible but not satisfied yet */ -- cgit v0.12 From 75ed02d88822dad90ad256551f2df875aa884975 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 19:53:03 +0000 Subject: Adaptation of re-memaccounting.patch from Tom Lane @postgres. --- generic/regc_nfa.c | 84 +++++++++--------------------------------------------- generic/regcomp.c | 2 ++ generic/regerrs.h | 2 +- generic/regex.h | 2 +- generic/regguts.h | 16 ++++++----- tests/regexp.test | 2 +- 6 files changed, 28 insertions(+), 80 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index bbc4dd6..5568bff 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -62,7 +62,6 @@ newnfa( nfa->nstates = 0; nfa->cm = cm; nfa->v = v; - nfa->size = 0; nfa->bos[0] = nfa->bos[1] = COLORLESS; nfa->eos[0] = nfa->eos[1] = COLORLESS; nfa->parent = parent; /* Precedes newfstate so parent is valid. */ @@ -90,61 +89,6 @@ newnfa( } /* - - TooManyStates - checks if the max states exceeds the compile-time value - ^ static int TooManyStates(struct nfa *); - */ -static int -TooManyStates( - struct nfa *nfa) -{ - struct nfa *parent = nfa->parent; - size_t sz = nfa->size; - - while (parent != NULL) { - sz = parent->size; - parent = parent->parent; - } - if (sz > REG_MAX_STATES) { - return 1; - } - return 0; -} - -/* - - IncrementSize - increases the tracked size of the NFA and its parents. - ^ static void IncrementSize(struct nfa *); - */ -static void -IncrementSize( - struct nfa *nfa) -{ - struct nfa *parent = nfa->parent; - - nfa->size++; - while (parent != NULL) { - parent->size++; - parent = parent->parent; - } -} - -/* - - DecrementSize - increases the tracked size of the NFA and its parents. - ^ static void DecrementSize(struct nfa *); - */ -static void -DecrementSize( - struct nfa *nfa) -{ - struct nfa *parent = nfa->parent; - - nfa->size--; - while (parent != NULL) { - parent->size--; - parent = parent->parent; - } -} - -/* - freenfa - free an entire NFA ^ static VOID freenfa(struct nfa *); */ @@ -180,20 +124,20 @@ newstate( { struct state *s; - if (TooManyStates(nfa)) { - /* XXX: add specific error for this */ - NERR(REG_ETOOBIG); - return NULL; - } if (nfa->free != NULL) { s = nfa->free; nfa->free = s->next; } else { + if (nfa->v->spaceused >= REG_MAX_COMPILE_SPACE) { + NERR(REG_ETOOBIG); + return NULL; + } s = (struct state *) MALLOC(sizeof(struct state)); if (s == NULL) { NERR(REG_ESPACE); return NULL; } + nfa->v->spaceused += sizeof(struct state); s->oas.next = NULL; s->free = NULL; s->noas = 0; @@ -217,12 +161,6 @@ newstate( } s->prev = nfa->slast; nfa->slast = s; - - /* - * Track the current size and the parent size. - */ - - IncrementSize(nfa); return s; } @@ -293,7 +231,6 @@ freestate( s->prev = NULL; s->next = nfa->free; /* don't delete it, put it on the free list */ nfa->free = s; - DecrementSize(nfa); } /* @@ -312,11 +249,13 @@ destroystate( for (ab=s->oas.next ; ab!=NULL ; ab=abnext) { abnext = ab->next; FREE(ab); + nfa->v->spaceused -= sizeof(struct arcbatch); } s->ins = NULL; s->outs = NULL; s->next = NULL; FREE(s); + nfa->v->spaceused -= sizeof(struct state); } /* @@ -439,14 +378,19 @@ allocarc( */ if (s->free == NULL) { - struct arcbatch *newAb = (struct arcbatch *) - MALLOC(sizeof(struct arcbatch)); + struct arcbatch *newAb; int i; + if (nfa->v->spaceused >= REG_MAX_COMPILE_SPACE) { + NERR(REG_ETOOBIG); + return NULL; + } + newAb = (struct arcbatch *) MALLOC(sizeof(struct arcbatch)); if (newAb == NULL) { NERR(REG_ESPACE); return NULL; } + nfa->v->spaceused += sizeof(struct arcbatch); newAb->next = s->oas.next; s->oas.next = newAb; diff --git a/generic/regcomp.c b/generic/regcomp.c index 6b40100..3c91962 100644 --- a/generic/regcomp.c +++ b/generic/regcomp.c @@ -228,6 +228,7 @@ struct vars { struct cvec *cv2; /* utility cvec */ struct subre *lacons; /* lookahead-constraint vector */ int nlacons; /* size of lacons */ + size_t spaceused; /* approx. space used for compilation */ }; /* parsing macros; most know that `v' is the struct vars pointer */ @@ -337,6 +338,7 @@ compile( v->cv2 = NULL; v->lacons = NULL; v->nlacons = 0; + v->spaceused = 0; re->re_magic = REMAGIC; re->re_info = 0; /* bits get set during parse */ re->re_csize = sizeof(chr); diff --git a/generic/regerrs.h b/generic/regerrs.h index 72548ff..ee203d5 100644 --- a/generic/regerrs.h +++ b/generic/regerrs.h @@ -16,5 +16,5 @@ { REG_INVARG, "REG_INVARG", "invalid argument to regex function" }, { REG_MIXED, "REG_MIXED", "character widths of regex and string differ" }, { REG_BADOPT, "REG_BADOPT", "invalid embedded option" }, -{ REG_ETOOBIG, "REG_ETOOBIG", "nfa has too many states" }, +{ REG_ETOOBIG, "REG_ETOOBIG", "regular expression is too complex" }, { REG_ECOLORS, "REG_ECOLORS", "too many colors" }, diff --git a/generic/regex.h b/generic/regex.h index b5dce50..b5b11bd 100644 --- a/generic/regex.h +++ b/generic/regex.h @@ -277,7 +277,7 @@ typedef struct { #define REG_INVARG 16 /* invalid argument to regex function */ #define REG_MIXED 17 /* character widths of regex and string differ */ #define REG_BADOPT 18 /* invalid embedded option */ -#define REG_ETOOBIG 19 /* nfa has too many states */ +#define REG_ETOOBIG 19 /* regular expression is too complex */ #define REG_ECOLORS 20 /* too many colors */ /* two specials for debugging and testing */ #define REG_ATOI 101 /* convert error-code name to number */ diff --git a/generic/regguts.h b/generic/regguts.h index 7ed8ec1..72bdcb3 100644 --- a/generic/regguts.h +++ b/generic/regguts.h @@ -307,9 +307,6 @@ struct nfa { struct colormap *cm; /* the color map */ color bos[2]; /* colors, if any, assigned to BOS and BOL */ color eos[2]; /* colors, if any, assigned to EOS and EOL */ - size_t size; /* Current NFA size; differs from nstates as - * it also counts the number of states created - * by children of this state. */ struct vars *v; /* simplifies compile error reporting */ struct nfa *parent; /* parent NFA, if any */ }; @@ -339,11 +336,16 @@ struct cnfa { #define NULLCNFA(cnfa) ((cnfa).nstates == 0) /* - * Used to limit the maximum NFA size to something sane. [Bug 1810264] + * This symbol limits the transient heap space used by the regex compiler, + * and thereby also the maximum complexity of NFAs that we'll deal with. + * Currently we only count NFA states and arcs against this; the other + * transient data is generally not large enough to notice compared to those. + * Note that we do not charge anything for the final output data structures + * (the compacted NFA and the colormap). */ - -#ifndef REG_MAX_STATES -# define REG_MAX_STATES 100000 +#ifndef REG_MAX_COMPILE_SPACE +#define REG_MAX_COMPILE_SPACE \ + (100000 * sizeof(struct state) + 100000 * sizeof(struct arcbatch)) #endif /* diff --git a/tests/regexp.test b/tests/regexp.test index 362f425..7878d41 100644 --- a/tests/regexp.test +++ b/tests/regexp.test @@ -716,7 +716,7 @@ test regexp-22.4 {Bug 3606139} -setup { [a 668]([a 55])[a 668]([a 55])[a 668]([a 55])[a 511]] {}] a } -cleanup { rename a {} -} -returnCodes 1 -result {couldn't compile regular expression pattern: nfa has too many states} +} -returnCodes 1 -match glob -result {couldn't compile regular expression pattern: *} test regexp-22.5 {Bug 3610026} -setup { set e {} set cp 99 -- cgit v0.12 From bc85f89c10afaf5368f4c41a235e11955886a1a3 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 20 Oct 2015 20:21:44 +0000 Subject: Adaptation of most of the re-mopup.patch from Tom Lane @ postgress. Still should add the new tests. --- generic/regc_nfa.c | 50 ++++++++++++++++---------------------------------- generic/regcomp.c | 12 ++++++------ 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c index 5568bff..6280e5e 100644 --- a/generic/regc_nfa.c +++ b/generic/regc_nfa.c @@ -843,15 +843,13 @@ moveins( /* - copyins - copy in arcs of a state to another state - * Either all arcs, or only non-empty ones as determined by all value. ^ static VOID copyins(struct nfa *, struct state *, struct state *, int); */ static void copyins( struct nfa *nfa, struct state *oldState, - struct state *newState, - int all) + struct state *newState) { assert(oldState != newState); @@ -860,9 +858,7 @@ copyins( struct arc *a; for (a = oldState->ins; a != NULL; a = a->inchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, a->from, newState); - } + cparc(nfa, a, a->from, newState); } } else { /* @@ -892,11 +888,6 @@ copyins( while (oa != NULL && na != NULL) { struct arc *a = oa; - if (!all && a->type == EMPTY) { - oa = oa->inchain; - continue; - } - switch (sortins_cmp(&oa, &na)) { case -1: /* newState does not have anything matching oa */ @@ -920,11 +911,6 @@ copyins( /* newState does not have anything matching oa */ struct arc *a = oa; - if (!all && a->type == EMPTY) { - oa = oa->inchain; - continue; - } - oa = oa->inchain; createarc(nfa, a->type, a->co, a->from, newState); } @@ -1114,15 +1100,13 @@ moveouts( /* - copyouts - copy out arcs of a state to another state - * Either all arcs, or only non-empty ones as determined by all value. ^ static VOID copyouts(struct nfa *, struct state *, struct state *, int); */ static void copyouts( struct nfa *nfa, struct state *oldState, - struct state *newState, - int all) + struct state *newState) { assert(oldState != newState); @@ -1131,9 +1115,7 @@ copyouts( struct arc *a; for (a = oldState->outs; a != NULL; a = a->outchain) { - if (all || a->type != EMPTY) { - cparc(nfa, a, newState, a->to); - } + cparc(nfa, a, newState, a->to); } } else { /* @@ -1163,11 +1145,6 @@ copyouts( while (oa != NULL && na != NULL) { struct arc *a = oa; - if (!all && a->type == EMPTY) { - oa = oa->outchain; - continue; - } - switch (sortouts_cmp(&oa, &na)) { case -1: /* newState does not have anything matching oa */ @@ -1191,11 +1168,6 @@ copyouts( /* newState does not have anything matching oa */ struct arc *a = oa; - if (!all && a->type == EMPTY){ - oa = oa->outchain; - continue; - } - oa = oa->outchain; createarc(nfa, a->type, a->co, newState, a->to); } @@ -1446,6 +1418,11 @@ optimize( fprintf(f, "\nfinal cleanup:\n"); } cleanup(nfa); /* final tidying */ +#ifdef REG_DEBUG + if (verbose) { + dumpnfa(nfa, f); + } +#endif return analyze(nfa); /* and analysis */ } @@ -1570,7 +1547,7 @@ pull( if (NISERR()) { return 0; } - copyins(nfa, from, s, 1); /* duplicate inarcs */ + copyins(nfa, from, s); /* duplicate inarcs */ cparc(nfa, con, s, to); /* move constraint arc */ freearc(nfa, con); if (NISERR()) { @@ -1749,7 +1726,7 @@ push( if (NISERR()) { return 0; } - copyouts(nfa, to, s, 1); /* duplicate outarcs */ + copyouts(nfa, to, s); /* duplicate outarcs */ cparc(nfa, con, from, s); /* move constraint arc */ freearc(nfa, con); if (NISERR()) { @@ -2958,6 +2935,8 @@ dumpnfa( { #ifdef REG_DEBUG struct state *s; + int nstates = 0; + int narcs = 0; fprintf(f, "pre %d, post %d", nfa->pre->no, nfa->post->no); if (nfa->bos[0] != COLORLESS) { @@ -2975,7 +2954,10 @@ dumpnfa( fprintf(f, "\n"); for (s = nfa->states; s != NULL; s = s->next) { dumpstate(s, f); + nstates++; + narcs += s->nouts; } + fprintf(f, "total of %d states, %d ar