diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-01-28 19:09:51 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-01-28 19:09:51 -0800 |
commit | 6c59b2b58e939716cb31e9b7373a9a94435f8b83 (patch) | |
tree | 4e26af966c727606804be049a1a5b5bd29badf1c | |
parent | 09010c1509a30cdd042f1b31a1ecd84922adbba2 (diff) | |
download | txr-6c59b2b58e939716cb31e9b7373a9a94435f8b83.tar.gz txr-6c59b2b58e939716cb31e9b7373a9a94435f8b83.tar.bz2 txr-6c59b2b58e939716cb31e9b7373a9a94435f8b83.zip |
mpi: compile out more unused functions.
* mpi.c (mp_mul_2, mp_2expt, mp_addmod, mp_submod,
mp_mulmod, mp_sqrmod): Excluded from compilation.
-rw-r--r-- | mpi/mpi.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -718,6 +718,7 @@ mp_err mp_mul_d(mp_int *a, mp_digit d, mp_int *b) return res; } +#if !MP_FOR_TXR mp_err mp_mul_2(mp_int *a, mp_int *c) { mp_err res; @@ -729,6 +730,7 @@ mp_err mp_mul_2(mp_int *a, mp_int *c) return s_mp_mul_2(c); } +#endif /* Compute the quotient q = a / d and remainder r = a mod d, for a * single digit d. Respects the sign of its divisor (single digits are @@ -1297,12 +1299,14 @@ X: /* Compute a = 2^k */ +#if !MP_FOR_TXR mp_err mp_2expt(mp_int *a, mp_digit k) { ARGCHK(a != NULL, MP_BADARG); return s_mp_2expt(a, k); } +#endif /* Compute c = a (mod m). Result will always be 0 <= c < m. */ mp_err mp_mod(mp_int *a, mp_int *m, mp_int *c) @@ -1433,6 +1437,7 @@ out: #if MP_MODARITH +#if !MP_FOR_TXR /* Compute c = (a + b) mod m */ mp_err mp_addmod(mp_int *a, mp_int *b, mp_int *m, mp_int *c) { @@ -1493,6 +1498,7 @@ mp_err mp_sqrmod(mp_int *a, mp_int *m, mp_int *c) return MP_OKAY; } #endif +#endif /* Compute c = (a ** b) mod m. Uses a standard square-and-multiply * method with modular reductions at each step. (This is basically the |