summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/doc_src_qtsql.qdoc
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2010-02-24 11:13:51 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2010-02-24 11:13:51 (GMT)
commitff92c1cd2bf5171637b51d5eb646b165d6f11ec3 (patch)
tree177a30d3e2dc5b41e01c9cb27e92126b73079484 /doc/src/snippets/code/doc_src_qtsql.qdoc
parent9872dce1dcb74216cad30301502d1c77de2356ad (diff)
downloadQt-ff92c1cd2bf5171637b51d5eb646b165d6f11ec3.zip
Qt-ff92c1cd2bf5171637b51d5eb646b165d6f11ec3.tar.gz
Qt-ff92c1cd2bf5171637b51d5eb646b165d6f11ec3.tar.bz2
Build fix when using <QtDeclarative> include.
Diffstat (limited to 'doc/src/snippets/code/doc_src_qtsql.qdoc')
0 files changed, 0 insertions, 0 deletions
ion> Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat
-rw-r--r--libtommath/bn_fast_mp_invmod.c2
-rw-r--r--libtommath/bn_fast_mp_montgomery_reduce.c2
-rw-r--r--libtommath/bn_fast_s_mp_mul_digs.c2
-rw-r--r--libtommath/bn_fast_s_mp_mul_high_digs.c2
-rw-r--r--libtommath/bn_fast_s_mp_sqr.c2
-rw-r--r--libtommath/bn_mp_abs.c2
-rw-r--r--libtommath/bn_mp_add.c2
-rw-r--r--libtommath/bn_mp_add_d.c9
-rw-r--r--libtommath/bn_mp_addmod.c2
-rw-r--r--libtommath/bn_mp_and.c5
-rw-r--r--libtommath/bn_mp_cmp.c2
-rw-r--r--libtommath/bn_mp_cmp_d.c2
-rw-r--r--libtommath/bn_mp_cmp_mag.c2
-rw-r--r--libtommath/bn_mp_cnt_lsb.c2
-rw-r--r--libtommath/bn_mp_copy.c2
-rw-r--r--libtommath/bn_mp_count_bits.c2
-rw-r--r--libtommath/bn_mp_div.c4
-rw-r--r--libtommath/bn_mp_div_2.c2
-rw-r--r--libtommath/bn_mp_div_2d.c2
-rw-r--r--libtommath/bn_mp_div_3.c2
-rw-r--r--libtommath/bn_mp_div_d.c2
-rw-r--r--libtommath/bn_mp_dr_is_modulus.c2
-rw-r--r--libtommath/bn_mp_dr_reduce.c2
-rw-r--r--libtommath/bn_mp_dr_setup.c2
-rw-r--r--libtommath/bn_mp_export.c2
-rw-r--r--libtommath/bn_mp_expt_d.c2
-rw-r--r--libtommath/bn_mp_expt_d_ex.c2
-rw-r--r--libtommath/bn_mp_exptmod.c2
-rw-r--r--libtommath/bn_mp_exptmod_fast.c4
-rw-r--r--libtommath/bn_mp_exteuclid.c2
-rw-r--r--libtommath/bn_mp_fwrite.c2
-rw-r--r--libtommath/bn_mp_gcd.c2
-rw-r--r--libtommath/bn_mp_get_int.c2
-rw-r--r--libtommath/bn_mp_get_long.c2
-rw-r--r--libtommath/bn_mp_get_long_long.c2
-rw-r--r--libtommath/bn_mp_init_copy.c2
-rw-r--r--libtommath/bn_mp_invmod.c2
-rw-r--r--libtommath/bn_mp_invmod_slow.c2
-rw-r--r--libtommath/bn_mp_is_square.c2
-rw-r--r--libtommath/bn_mp_jacobi.c2
-rw-r--r--libtommath/bn_mp_karatsuba_mul.c2
-rw-r--r--libtommath/bn_mp_karatsuba_sqr.c2
-rw-r--r--libtommath/bn_mp_lcm.c2
-rw-r--r--libtommath/bn_mp_mod.c2
-rw-r--r--libtommath/bn_mp_mod_2d.c2
-rw-r--r--libtommath/bn_mp_mod_d.c2
-rw-r--r--libtommath/bn_mp_montgomery_calc_normalization.c2
-rw-r--r--libtommath/bn_mp_montgomery_reduce.c2
-rw-r--r--libtommath/bn_mp_montgomery_setup.c2
-rw-r--r--libtommath/bn_mp_mul.c2
-rw-r--r--libtommath/bn_mp_mul_2.c2
-rw-r--r--libtommath/bn_mp_mul_2d.c2
-rw-r--r--libtommath/bn_mp_mul_d.c2
-rw-r--r--libtommath/bn_mp_mulmod.c2
-rw-r--r--libtommath/bn_mp_n_root.c2
-rw-r--r--libtommath/bn_mp_n_root_ex.c19
-rw-r--r--libtommath/bn_mp_neg.c2
-rw-r--r--libtommath/bn_mp_or.c5
-rw-r--r--libtommath/bn_mp_prime_fermat.c2
-rw-r--r--libtommath/bn_mp_prime_is_divisible.c2
-rw-r--r--libtommath/bn_mp_prime_is_prime.c2
-rw-r--r--libtommath/bn_mp_prime_miller_rabin.c2
-rw-r--r--libtommath/bn_mp_radix_size.c2
-rw-r--r--libtommath/bn_mp_reduce.c2
-rw-r--r--libtommath/bn_mp_reduce_2k.c2
-rw-r--r--libtommath/bn_mp_reduce_2k_l.c2
-rw-r--r--libtommath/bn_mp_reduce_2k_setup.c2
-rw-r--r--libtommath/bn_mp_reduce_2k_setup_l.c2
-rw-r--r--libtommath/bn_mp_reduce_is_2k.c2
-rw-r--r--libtommath/bn_mp_reduce_is_2k_l.c2
-rw-r--r--libtommath/bn_mp_reduce_setup.c2
-rw-r--r--libtommath/bn_mp_signed_bin_size.c2
-rw-r--r--libtommath/bn_mp_sqr.c2
-rw-r--r--libtommath/bn_mp_sqrmod.c2
-rw-r--r--libtommath/bn_mp_sqrt.c2
-rw-r--r--libtommath/bn_mp_sqrtmod_prime.c2
-rw-r--r--libtommath/bn_mp_sub.c2
-rw-r--r--libtommath/bn_mp_sub_d.c9
-rw-r--r--libtommath/bn_mp_submod.c2
-rw-r--r--libtommath/bn_mp_to_signed_bin.c2
-rw-r--r--libtommath/bn_mp_to_signed_bin_n.c2
-rw-r--r--libtommath/bn_mp_to_unsigned_bin.c2
-rw-r--r--libtommath/bn_mp_to_unsigned_bin_n.c2
-rw-r--r--libtommath/bn_mp_toom_mul.c2
-rw-r--r--libtommath/bn_mp_toom_sqr.c2
-rw-r--r--libtommath/bn_mp_toradix.c2
-rw-r--r--libtommath/bn_mp_toradix_n.c2
-rw-r--r--libtommath/bn_mp_unsigned_bin_size.c2
-rw-r--r--libtommath/bn_mp_xor.c5
-rw-r--r--libtommath/bn_s_mp_add.c4
-rw-r--r--libtommath/bn_s_mp_exptmod.c4
-rw-r--r--libtommath/bn_s_mp_mul_digs.c2
-rw-r--r--libtommath/bn_s_mp_mul_high_digs.c2
-rw-r--r--libtommath/bn_s_mp_sqr.c2
-rw-r--r--libtommath/bn_s_mp_sub.c2
-rw-r--r--libtommath/tommath.h156
-rw-r--r--libtommath/tommath_private.h34
97 files changed, 215 insertions, 213 deletions
diff --git a/libtommath/bn_fast_mp_invmod.c b/libtommath/bn_fast_mp_invmod.c
index 7771136..08389dd 100644
--- a/libtommath/bn_fast_mp_invmod.c
+++ b/libtommath/bn_fast_mp_invmod.c
@@ -21,7 +21,7 @@
* Based on slow invmod except this is optimized for the case where b is
* odd as per HAC Note 14.64 on pp. 610
*/
-int fast_mp_invmod(mp_int *a, mp_int *b, mp_int *c)
+int fast_mp_invmod(const mp_int *a, const mp_int *b, mp_int *c)
{
mp_int x, y, u, v, B, D;
int res, neg;
diff --git a/libtommath/bn_fast_mp_montgomery_reduce.c b/libtommath/bn_fast_mp_montgomery_reduce.c
index f2c38bf..54d9b0a 100644
--- a/libtommath/bn_fast_mp_montgomery_reduce.c
+++ b/libtommath/bn_fast_mp_montgomery_reduce.c
@@ -23,7 +23,7 @@
*
* Based on Algorithm 14.32 on pp.601 of HAC.
*/
-int fast_mp_montgomery_reduce(mp_int *x, mp_int *n, mp_digit rho)
+int fast_mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho)
{
int ix, res, olduse;
mp_word W[MP_WARRAY];
diff --git a/libtommath/bn_fast_s_mp_mul_digs.c b/libtommath/bn_fast_s_mp_mul_digs.c
index 763dbb1..558d151 100644
--- a/libtommath/bn_fast_s_mp_mul_digs.c
+++ b/libtommath/bn_fast_s_mp_mul_digs.c
@@ -31,7 +31,7 @@
* Based on Algorithm 14.12 on pp.595 of HAC.
*
*/
-int fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs)
+int fast_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
{
int olduse, res, pa, ix, iz;
mp_digit W[MP_WARRAY];
diff --git a/libtommath/bn_fast_s_mp_mul_high_digs.c b/libtommath/bn_fast_s_mp_mul_high_digs.c
index 588d80b..8b662ed 100644
--- a/libtommath/bn_fast_s_mp_mul_high_digs.c
+++ b/libtommath/bn_fast_s_mp_mul_high_digs.c
@@ -24,7 +24,7 @@
*
* Based on Algorithm 14.12 on pp.595 of HAC.
*/
-int fast_s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs)
+int fast_s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
{
int olduse, res, pa, ix, iz;
mp_digit W[MP_WARRAY];
diff --git a/libtommath/bn_fast_s_mp_sqr.c b/libtommath/bn_fast_s_mp_sqr.c
index ceed82b..161f785 100644
--- a/libtommath/bn_fast_s_mp_sqr.c
+++ b/libtommath/bn_fast_s_mp_sqr.c
@@ -25,7 +25,7 @@
After that loop you do the squares and add them in.
*/
-int fast_s_mp_sqr(mp_int *a, mp_int *b)
+int fast_s_mp_sqr(const mp_int *a, mp_int *b)
{
int olduse, res, pa, ix, iz;
mp_digit W[MP_WARRAY], *tmpx;
diff --git a/libtommath/bn_mp_abs.c b/libtommath/bn_mp_abs.c
index d5fc012..9b6bcec 100644
--- a/libtommath/bn_mp_abs.c
+++ b/libtommath/bn_mp_abs.c
@@ -19,7 +19,7 @@
*
* Simple function copies the input and fixes the sign to positive
*/
-int mp_abs(mp_int *a, mp_int *b)
+int mp_abs(const mp_int *a, mp_int *b)
{
int res;
diff --git a/libtommath/bn_mp_add.c b/libtommath/bn_mp_add.c
index 4df4c81..d31d5a0 100644
--- a/libtommath/bn_mp_add.c
+++ b/libtommath/bn_mp_add.c
@@ -16,7 +16,7 @@
*/
/* high level addition (handles signs) */
-int mp_add(mp_int *a, mp_int *b, mp_int *c)
+int mp_add(const mp_int *a, const mp_int *b, mp_int *c)
{
int sa, sb, res;
diff --git a/libtommath/bn_mp_add_d.c b/libtommath/bn_mp_add_d.c
index 1e6ff63..e5ede1f 100644
--- a/libtommath/bn_mp_add_d.c
+++ b/libtommath/bn_mp_add_d.c
@@ -16,7 +16,7 @@
*/
/* single digit addition */
-int mp_add_d(mp_int *a, mp_digit b, mp_int *c)
+int mp_add_d(const mp_int *a, mp_digit b, mp_int *c)
{
int res, ix, oldused;
mp_digit *tmpa, *tmpc, mu;
@@ -30,14 +30,15 @@ int mp_add_d(mp_int *a, mp_digit b, mp_int *c)
/* if a is negative and |a| >= b, call c = |a| - b */
if ((a->sign == MP_NEG) && ((a->used > 1) || (a->dp[0] >= b))) {
+ mp_int a_ = *a;
/* temporarily fix sign of a */
- a->sign = MP_ZPOS;
+ a_.sign = MP_ZPOS;
/* c = |a| - b */
- res = mp_sub_d(a, b, c);
+ res = mp_sub_d(&a_, b, c);
/* fix sign */
- a->sign = c->sign = MP_NEG;
+ c->sign = MP_NEG;
/* clamp */
mp_clamp(c);
diff --git a/libtommath/bn_mp_addmod.c b/libtommath/bn_mp_addmod.c
index 229a716..0d612c3 100644
--- a/libtommath/bn_mp_addmod.c
+++ b/libtommath/bn_mp_addmod.c
@@ -16,7 +16,7 @@
*/
/* d = a + b (mod c) */
-int mp_addmod(mp_int *a, mp_int *b, mp_int *c, mp_int *d)
+int mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
{
int res;
mp_int t;
diff --git a/libtommath/bn_mp_and.c b/libtommath/bn_mp_and.c
index 2f1472a..09ff772 100644
--- a/libtommath/bn_mp_and.c
+++ b/libtommath/bn_mp_and.c
@@ -16,10 +16,11 @@
*/
/* AND two ints together */
-int mp_and(mp_int *a, mp_int *b, mp_int *c)
+int mp_and(const mp_int *a, const mp_int *b, mp_int *c)
{
int res, ix, px;
- mp_int t, *x;
+ mp_int t;
+ const mp_int *x;
if (a->used > b->used) {
if ((res = mp_init_copy(&t, a)) != MP_OKAY) {
diff --git a/libtommath/bn_mp_cmp.c b/libtommath/bn_mp_cmp.c
index 9047060..a33d483 100644
--- a/libtommath/bn_mp_cmp.c
+++ b/libtommath/bn_mp_cmp.c
@@ -16,7 +16,7 @@
*/
/* compare two ints (signed)*/
-int mp_cmp(mp_int *a, mp_int *b)
+int mp_cmp(const mp_int *a, const mp_int *b)
{
/* compare based on sign */
if (a->sign != b->sign) {
diff --git a/libtommath/bn_mp_cmp_d.c b/libtommath/bn_mp_cmp_d.c
index 27a546d..576a073 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) {
diff --git a/libtommath/bn_mp_cmp_mag.c b/libtommath/bn_mp_cmp_mag.c
index ca2bc88..e2c723f 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;
diff --git a/libtommath/bn_mp_cnt_lsb.c b/libtommath/bn_mp_cnt_lsb.c
index 7273655..9a94d3d 100644
--- a/libtommath/bn_mp_cnt_lsb.c
+++ b/libtommath/bn_mp_cnt_lsb.c
@@ -20,7 +20,7 @@ static const int lnz[16] = {
};
/* Counts the number of lsbs which are zero before the first zero bit */
-int mp_cnt_lsb(mp_int *a)
+int mp_cnt_lsb(const mp_int *a)
{
int x;
mp_digit q, qq;
diff --git a/libtommath/bn_mp_copy.c b/libtommath/bn_mp_copy.c
index bed03b2..17816e8 100644
--- a/libtommath/bn_mp_copy.c
+++ b/libtommath/bn_mp_copy.c
@@ -16,7 +16,7 @@
*/
/* copy, b = a */
-int mp_copy(mp_int *a, mp_int *b)
+int mp_copy(const mp_int *a, mp_int *b)
{
int res, n;
diff --git a/libtommath/bn_mp_count_bits.c b/libtommath/bn_mp_count_bits.c
index dea364f..7424581 100644
--- a/libtommath/bn_mp_count_bits.c
+++ b/libtommath/bn_mp_count_bits.c
@@ -16,7 +16,7 @@
*/
/* returns the number of bits in an int */
-int mp_count_bits(mp_int *a)
+int mp_count_bits(const mp_int *a)
{
int r;
mp_digit q;
diff --git a/libtommath/bn_mp_div.c b/libtommath/bn_mp_div.c
index fdb3453..dbfdc03 100644
--- a/libtommath/bn_mp_div.c
+++ b/libtommath/bn_mp_div.c
@@ -18,7 +18,7 @@
#ifdef BN_MP_DIV_SMALL
/* slower bit-bang division... also smaller */
-int mp_div(mp_int *a, mp_int *b, mp_int *c, mp_int *d)
+int mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
{
mp_int ta, tb, tq, q;
int res, n, n2;
@@ -100,7 +100,7 @@ LBL_ERR:
* The overall algorithm is as described as
* 14.20 from HAC but fixed to treat these cases.
*/
-int mp_div(mp_int *a, mp_int *b, mp_int *c, mp_int *d)
+int mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
{
mp_int q, x, y, t1, t2;
int res, n, t, i, norm, neg;
diff --git a/libtommath/bn_mp_div_2.c b/libtommath/bn_mp_div_2.c
index b9d5339..edc8982 100644
--- a/libtommath/bn_mp_div_2.c
+++ b/libtommath/bn_mp_div_2.c
@@ -16,7 +16,7 @@
*/
/* b = a/2 */
-int mp_div_2(mp_int *a, mp_int *b)
+int mp_div_2(const mp_int *a, mp_int *b)
{
int x, res, oldused;
diff --git a/libtommath/bn_mp_div_2d.c b/libtommath/bn_mp_div_2d.c
index d6723ee..eae3498 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;
diff --git a/libtommath/bn_mp_div_3.c b/libtommath/bn_mp_div_3.c
index c3a023a..9cc8caa 100644
--- a/libtommath/bn_mp_div_3.c
+++ b/libtommath/bn_mp_div_3.c
@@ -16,7 +16,7 @@
*/
/* divide by three (based on routine from MPI and the GMP manual) */
-int mp_div_3(mp_int *a, mp_int *c, mp_digit *d)
+int mp_div_3(const mp_int *a, mp_int *c, mp_digit *d)
{
mp_int q;
mp_word w, t;
diff --git a/libtommath/bn_mp_div_d.c b/libtommath/bn_mp_div_d.c
index 141db1d..db4a0a2 100644
--- a/libtommath/bn_mp_div_d.c
+++ b/libtommath/bn_mp_div_d.c
@@ -34,7 +34,7 @@ static int s_is_power_of_two(mp_digit b, int *p)
}
/* single digit division (based on routine from MPI) */
-int mp_div_d(mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
+int mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
{
mp_int q;
mp_word w;
diff --git a/libtommath/bn_mp_dr_is_modulus.c b/libtommath/bn_mp_dr_is_modulus.c
index 4631daa..bf4ed8b 100644
--- a/libtommath/bn_mp_dr_is_modulus.c
+++ b/libtommath/bn_mp_dr_is_modulus.c
@@ -16,7 +16,7 @@
*/
/* determines if a number is a valid DR modulus */
-int mp_dr_is_modulus(mp_int *a)
+int mp_dr_is_modulus(const mp_int *a)
{
int ix;
diff --git a/libtommath/bn_mp_dr_reduce.c b/libtommath/bn_mp_dr_reduce.c
index 25079be..1ccb669 100644
--- a/libtommath/bn_mp_dr_reduce.c
+++ b/libtommath/bn_mp_dr_reduce.c
@@ -29,7 +29,7 @@
*
* Input x must be in the range 0 <= x <= (n-1)**2
*/
-int mp_dr_reduce(mp_int *x, mp_int *n, mp_digit k)
+int mp_dr_reduce(mp_int *x, const mp_int *n, mp_digit k)
{
int err, i, m;
mp_word r;
diff --git a/libtommath/bn_mp_dr_setup.c b/libtommath/bn_mp_dr_setup.c
index 97f31ba..af0e213 100644
--- a/libtommath/bn_mp_dr_setup.c
+++ b/libtommath/bn_mp_dr_setup.c
@@ -16,7 +16,7 @@
*/
/* determines the setup value */
-void mp_dr_setup(mp_int *a, mp_digit *d)
+void mp_dr_setup(const mp_int *a, mp_digit *d)
{
/* the casts are required if DIGIT_BIT is one less than
* the number of bits in a mp_digit [e.g. DIGIT_BIT==31]
diff --git a/libtommath/bn_mp_export.c b/libtommath/bn_mp_export.c
index b69a4fb..4276f4f 100644
--- a/libtommath/bn_mp_export.c
+++ b/libtommath/bn_mp_export.c
@@ -19,7 +19,7 @@
* see http://gmplib.org/manual/Integer-Import-and-Export.html
*/
int mp_export(void *rop, size_t *countp, int order, size_t size,
- int endian, size_t nails, mp_int *op)
+ int endian, size_t nails, const mp_int *op)
{
int result;
size_t odd_nails, nail_bytes, i, j, bits, count;
diff --git a/libtommath/bn_mp_expt_d.c b/libtommath/bn_mp_expt_d.c
index 38bf679..f5ce3c1 100644
--- a/libtommath/bn_mp_expt_d.c
+++ b/libtommath/bn_mp_expt_d.c
@@ -16,7 +16,7 @@
*/
/* wrapper function for mp_expt_d_ex() */
-int mp_expt_d(mp_int *a, mp_digit b, mp_int *c)
+int mp_expt_d(const mp_int *a, mp_digit b, mp_int *c)
{
return mp_expt_d_ex(a, b, c, 0);
}
diff --git a/libtommath/bn_mp_expt_d_ex.c b/libtommath/bn_mp_expt_d_ex.c
index bece77b..99319a5 100644
--- a/libtommath/bn_mp_expt_d_ex.c
+++ b/libtommath/bn_mp_expt_d_ex.c
@@ -16,7 +16,7 @@
*/
/* calculate c = a**b using a square-multiply algorithm */
-int mp_expt_d_ex(mp_int *a, mp_digit b, mp_int *c, int fast)
+int mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast)
{
int res;
unsigned int x;
diff --git a/libtommath/bn_mp_exptmod.c b/libtommath/bn_mp_exptmod.c
index c4f392b..934fd25 100644
--- a/libtommath/bn_mp_exptmod.c
+++ b/libtommath/bn_mp_exptmod.c
@@ -21,7 +21,7 @@
* embedded in the normal function but that wasted alot of stack space
* for nothing (since 99% of the time the Montgomery code would be called)
*/
-int mp_exptmod(mp_int *G, mp_int *X, mp_int *P, mp_int *Y)
+int mp_exptmod(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y)
{
int dr;
diff --git a/libtommath/bn_mp_exptmod_fast.c b/libtommath/bn_mp_exptmod_fast.c
index 38e0265..4a188d0 100644
--- a/libtommath/bn_mp_exptmod_fast.c
+++ b/libtommath/bn_mp_exptmod_fast.c
@@ -29,7 +29,7 @@
# define TAB_SIZE 256
#endif
-int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int redmode)
+int mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_int *Y, int redmode)
{
mp_int M[TAB_SIZE], res;
mp_digit buf, mp;
@@ -39,7 +39,7 @@ int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int redmode)
* one of many reduction algorithms without modding the guts of
* the code with if statements everywhere.
*/
- int (*redux)(mp_int *,mp_int *,mp_digit);
+ int (*redux)(mp_int *,const mp_int *,mp_digit);
/* find window size */
x = mp_count_bits(X);
diff --git a/libtommath/bn_mp_exteuclid.c b/libtommath/bn_mp_exteuclid.c