summaryrefslogtreecommitdiffstats
path: root/libtommath
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-05-03 14:36:40 (GMT)
committernijtmans <nijtmans>2010-05-03 14:36:40 (GMT)
commit603632160ce039289adcabac2684febc649c535b (patch)
treee5adab677558dc22434d9ee6b375a48333aea345 /libtommath
parent091c9fee62375b69529473b975e37dc279f0bc83 (diff)
downloadtcl-603632160ce039289adcabac2684febc649c535b.zip
tcl-603632160ce039289adcabac2684febc649c535b.tar.gz
tcl-603632160ce039289adcabac2684febc649c535b.tar.bz2
CONSTify various useful internal functions
(TclBignumToDouble, TclCeil, TclFloor), and related tommath functions.
Diffstat (limited to 'libtommath')
-rw-r--r--libtommath/bn_mp_cmp.c6
-rw-r--r--libtommath/bn_mp_cmp_d.c6
-rw-r--r--libtommath/bn_mp_cmp_mag.c6
-rw-r--r--libtommath/bn_mp_copy.c6
-rw-r--r--libtommath/bn_mp_count_bits.c6
-rw-r--r--libtommath/bn_mp_div_2d.c6
-rw-r--r--libtommath/bn_mp_mod_2d.c6
-rw-r--r--libtommath/bn_mp_mul_2d.c6
-rw-r--r--libtommath/bn_mp_neg.c6
-rw-r--r--libtommath/tommath.h22
10 files changed, 38 insertions, 38 deletions
diff --git a/libtommath/bn_mp_cmp.c b/libtommath/bn_mp_cmp.c
index 6361730..8029633 100644
--- a/libtommath/bn_mp_cmp.c
+++ b/libtommath/bn_mp_cmp.c
@@ -17,7 +17,7 @@
/* compare two ints (signed)*/
int
-mp_cmp (mp_int * a, mp_int * b)
+mp_cmp (const mp_int * a, const mp_int * b)
{
/* compare based on sign */
if (a->sign != b->sign) {
@@ -39,5 +39,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_cmp_d.c b/libtommath/bn_mp_cmp_d.c
index 92c3567..2dded75 100644
--- a/libtommath/bn_mp_cmp_d.c
+++ b/libtommath/bn_mp_cmp_d.c
@@ -16,7 +16,7 @@
*/
/* compare a digit */
-int mp_cmp_d(mp_int * a, mp_digit b)
+int mp_cmp_d(const mp_int * a, mp_digit b)
{
/* compare based on sign */
if (a->sign == MP_NEG) {
@@ -40,5 +40,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_cmp_mag.c b/libtommath/bn_mp_cmp_mag.c
index 31c8221..8c6c169 100644
--- a/libtommath/bn_mp_cmp_mag.c
+++ b/libtommath/bn_mp_cmp_mag.c
@@ -16,7 +16,7 @@
*/
/* compare maginitude of two ints (unsigned) */
-int mp_cmp_mag (mp_int * a, mp_int * b)
+int mp_cmp_mag (const mp_int * a, const mp_int * b)
{
int n;
mp_digit *tmpa, *tmpb;
@@ -51,5 +51,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_copy.c b/libtommath/bn_mp_copy.c
index a5d5e6f..1d6c5cb 100644
--- a/libtommath/bn_mp_copy.c
+++ b/libtommath/bn_mp_copy.c
@@ -17,7 +17,7 @@
/* copy, b = a */
int
-mp_copy (mp_int * a, mp_int * b)
+mp_copy (const mp_int * a, mp_int * b)
{
int res, n;
@@ -64,5 +64,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_count_bits.c b/libtommath/bn_mp_count_bits.c
index 44c0cff..909c153 100644
--- a/libtommath/bn_mp_count_bits.c
+++ b/libtommath/bn_mp_count_bits.c
@@ -17,7 +17,7 @@
/* returns the number of bits in an int */
int
-mp_count_bits (mp_int * a)
+mp_count_bits (const mp_int * a)
{
int r;
mp_digit q;
@@ -41,5 +41,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_div_2d.c b/libtommath/bn_mp_div_2d.c
index 12a7c99..2bdbdb5 100644
--- a/libtommath/bn_mp_div_2d.c
+++ b/libtommath/bn_mp_div_2d.c
@@ -16,7 +16,7 @@
*/
/* shift right by a certain bit count (store quotient in c, optional remainder in d) */
-int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
+int mp_div_2d (const mp_int * a, int b, mp_int * c, mp_int * d)
{
mp_digit D, r, rr;
int x, res;
@@ -93,5 +93,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_mod_2d.c b/libtommath/bn_mp_mod_2d.c
index 2ab7e33..e94a819 100644
--- a/libtommath/bn_mp_mod_2d.c
+++ b/libtommath/bn_mp_mod_2d.c
@@ -17,7 +17,7 @@
/* calc a value mod 2**b */
int
-mp_mod_2d (mp_int * a, int b, mp_int * c)
+mp_mod_2d (const mp_int * a, int b, mp_int * c)
{
int x, res;
@@ -51,5 +51,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_mul_2d.c b/libtommath/bn_mp_mul_2d.c
index 88fa080..8672ee3 100644
--- a/libtommath/bn_mp_mul_2d.c
+++ b/libtommath/bn_mp_mul_2d.c
@@ -16,7 +16,7 @@
*/
/* shift left by a certain bit count */
-int mp_mul_2d (mp_int * a, int b, mp_int * c)
+int mp_mul_2d (const mp_int * a, int b, mp_int * c)
{
mp_digit d;
int res;
@@ -81,5 +81,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/bn_mp_neg.c b/libtommath/bn_mp_neg.c
index 17e851a..886db3f 100644
--- a/libtommath/bn_mp_neg.c
+++ b/libtommath/bn_mp_neg.c
@@ -16,7 +16,7 @@
*/
/* b = -a */
-int mp_neg (mp_int * a, mp_int * b)
+int mp_neg (const mp_int * a, mp_int * b)
{
int res;
if (a != b) {
@@ -36,5 +36,5 @@ 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 $ */
+/* $Revision: 1.2 $ */
+/* $Date: 2010/05/03 14:36:40 $ */
diff --git a/libtommath/tommath.h b/libtommath/tommath.h
index f869262..7cc7d4e 100644
--- a/libtommath/tommath.h
+++ b/libtommath/tommath.h
@@ -241,7 +241,7 @@ int mp_init_set (mp_int * a, mp_digit b);
int mp_init_set_int (mp_int * a, unsigned long b);
/* copy, b = a */
-int mp_copy(mp_int *a, mp_int *b);
+int mp_copy(const mp_int *a, mp_int *b);
/* inits and copies, a = b */
int mp_init_copy(mp_int *a, mp_int *b);
@@ -258,19 +258,19 @@ void mp_rshd(mp_int *a, int b);
int mp_lshd(mp_int *a, int b);
/* c = a / 2**b */
-int mp_div_2d(mp_int *a, int b, mp_int *c, mp_int *d);
+int mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d);
/* b = a/2 */
int mp_div_2(mp_int *a, mp_int *b);
/* c = a * 2**b */
-int mp_mul_2d(mp_int *a, int b, mp_int *c);
+int mp_mul_2d(const mp_int *a, int b, mp_int *c);
/* b = a*2 */
int mp_mul_2(mp_int *a, mp_int *b);
/* c = a mod 2**d */
-int mp_mod_2d(mp_int *a, int b, mp_int *c);
+int mp_mod_2d(const mp_int *a, int b, mp_int *c);
/* computes a = 2**b */
int mp_2expt(mp_int *a, int b);
@@ -296,16 +296,16 @@ int mp_and(mp_int *a, mp_int *b, mp_int *c);
/* ---> Basic arithmetic <--- */
/* b = -a */
-int mp_neg(mp_int *a, mp_int *b);
+int mp_neg(const mp_int *a, mp_int *b);
/* b = |a| */
int mp_abs(mp_int *a, mp_int *b);
/* compare a to b */
-int mp_cmp(mp_int *a, mp_int *b);
+int mp_cmp(const mp_int *a, const mp_int *b);
/* compare |a| to |b| */
-int mp_cmp_mag(mp_int *a, mp_int *b);
+int mp_cmp_mag(const mp_int *a, const mp_int *b);
/* c = a + b */
int mp_add(mp_int *a, mp_int *b, mp_int *c);
@@ -328,7 +328,7 @@ int mp_mod(mp_int *a, mp_int *b, mp_int *c);
/* ---> single digit functions <--- */
/* compare against a single digit */
-int mp_cmp_d(mp_int *a, mp_digit b);
+int mp_cmp_d(const mp_int *a, mp_digit b);
/* c = a + b */
int mp_add_d(mp_int *a, mp_digit b, mp_int *c);
@@ -517,7 +517,7 @@ int mp_prime_next_prime(mp_int *a, int t, int bbs_style);
int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_callback cb, void *dat);
/* ---> radix conversion <--- */
-int mp_count_bits(mp_int *a);
+int mp_count_bits(const mp_int *a);
int mp_unsigned_bin_size(mp_int *a);
int mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c);
@@ -581,5 +581,5 @@ extern const char *mp_s_rmap;
/* $Source: /root/tcl/repos-to-convert/tcl/libtommath/tommath.h,v $ */
/* Based on Tom's version 1.8 */
-/* $Revision: 1.5 $ */
-/* $Date: 2010/05/03 11:40:12 $ */
+/* $Revision: 1.6 $ */
+/* $Date: 2010/05/03 14:36:40 $ */