From 4e3f1344a5e3069b2e8674d4a8cc54a92014d1b0 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 12 Nov 2015 01:49:07 +0100 Subject: [PATCH] provide tommath_private.h tommath.h contains declarations for the public part of the library. tommath_private.h contains the functions which are private to ltm and should not be exposed to the public. --- bn_error.c | 2 +- bn_fast_mp_invmod.c | 2 +- bn_fast_mp_montgomery_reduce.c | 2 +- bn_fast_s_mp_mul_digs.c | 2 +- bn_fast_s_mp_mul_high_digs.c | 2 +- bn_fast_s_mp_sqr.c | 2 +- bn_mp_2expt.c | 2 +- bn_mp_abs.c | 2 +- bn_mp_add.c | 2 +- bn_mp_add_d.c | 2 +- bn_mp_addmod.c | 2 +- bn_mp_and.c | 2 +- bn_mp_clamp.c | 2 +- bn_mp_clear.c | 2 +- bn_mp_clear_multi.c | 2 +- bn_mp_cmp.c | 2 +- bn_mp_cmp_d.c | 2 +- bn_mp_cmp_mag.c | 2 +- bn_mp_cnt_lsb.c | 2 +- bn_mp_copy.c | 2 +- bn_mp_count_bits.c | 2 +- bn_mp_div.c | 2 +- bn_mp_div_2.c | 2 +- bn_mp_div_2d.c | 2 +- bn_mp_div_3.c | 2 +- bn_mp_div_d.c | 2 +- bn_mp_dr_is_modulus.c | 2 +- bn_mp_dr_reduce.c | 2 +- bn_mp_dr_setup.c | 2 +- bn_mp_exch.c | 2 +- bn_mp_export.c | 2 +- bn_mp_expt_d.c | 2 +- bn_mp_expt_d_ex.c | 2 +- bn_mp_exptmod.c | 2 +- bn_mp_exptmod_fast.c | 2 +- bn_mp_exteuclid.c | 2 +- bn_mp_fread.c | 2 +- bn_mp_fwrite.c | 2 +- bn_mp_gcd.c | 2 +- bn_mp_get_int.c | 2 +- bn_mp_get_long.c | 2 +- bn_mp_get_long_long.c | 2 +- bn_mp_grow.c | 2 +- bn_mp_import.c | 2 +- bn_mp_init.c | 2 +- bn_mp_init_copy.c | 2 +- bn_mp_init_multi.c | 2 +- bn_mp_init_set.c | 2 +- bn_mp_init_set_int.c | 2 +- bn_mp_init_size.c | 2 +- bn_mp_invmod.c | 2 +- bn_mp_invmod_slow.c | 2 +- bn_mp_is_square.c | 2 +- bn_mp_jacobi.c | 2 +- bn_mp_karatsuba_mul.c | 2 +- bn_mp_karatsuba_sqr.c | 2 +- bn_mp_lcm.c | 2 +- bn_mp_lshd.c | 2 +- bn_mp_mod.c | 2 +- bn_mp_mod_2d.c | 2 +- bn_mp_mod_d.c | 2 +- bn_mp_montgomery_calc_normalization.c | 2 +- bn_mp_montgomery_reduce.c | 2 +- bn_mp_montgomery_setup.c | 2 +- bn_mp_mul.c | 2 +- bn_mp_mul_2.c | 2 +- bn_mp_mul_2d.c | 2 +- bn_mp_mul_d.c | 2 +- bn_mp_mulmod.c | 2 +- bn_mp_n_root.c | 2 +- bn_mp_n_root_ex.c | 2 +- bn_mp_neg.c | 2 +- bn_mp_or.c | 2 +- bn_mp_prime_fermat.c | 2 +- bn_mp_prime_is_divisible.c | 2 +- bn_mp_prime_is_prime.c | 2 +- bn_mp_prime_miller_rabin.c | 2 +- bn_mp_prime_next_prime.c | 2 +- bn_mp_prime_rabin_miller_trials.c | 2 +- bn_mp_prime_random_ex.c | 2 +- bn_mp_radix_size.c | 2 +- bn_mp_radix_smap.c | 2 +- bn_mp_rand.c | 2 +- bn_mp_read_radix.c | 2 +- bn_mp_read_signed_bin.c | 2 +- bn_mp_read_unsigned_bin.c | 2 +- bn_mp_reduce.c | 2 +- bn_mp_reduce_2k.c | 2 +- bn_mp_reduce_2k_l.c | 2 +- bn_mp_reduce_2k_setup.c | 2 +- bn_mp_reduce_2k_setup_l.c | 2 +- bn_mp_reduce_is_2k.c | 2 +- bn_mp_reduce_is_2k_l.c | 2 +- bn_mp_reduce_setup.c | 2 +- bn_mp_rshd.c | 2 +- bn_mp_set.c | 2 +- bn_mp_set_int.c | 2 +- bn_mp_set_long.c | 2 +- bn_mp_set_long_long.c | 2 +- bn_mp_shrink.c | 2 +- bn_mp_signed_bin_size.c | 2 +- bn_mp_sqr.c | 2 +- bn_mp_sqrmod.c | 2 +- bn_mp_sqrt.c | 2 +- bn_mp_sqrtmod_prime.c | 2 +- bn_mp_sub.c | 2 +- bn_mp_sub_d.c | 2 +- bn_mp_submod.c | 2 +- bn_mp_to_signed_bin.c | 2 +- bn_mp_to_signed_bin_n.c | 2 +- bn_mp_to_unsigned_bin.c | 2 +- bn_mp_to_unsigned_bin_n.c | 2 +- bn_mp_toom_mul.c | 2 +- bn_mp_toom_sqr.c | 2 +- bn_mp_toradix.c | 2 +- bn_mp_toradix_n.c | 2 +- bn_mp_unsigned_bin_size.c | 2 +- bn_mp_xor.c | 2 +- bn_mp_zero.c | 2 +- bn_prime_tab.c | 2 +- bn_reverse.c | 2 +- bn_s_mp_add.c | 2 +- bn_s_mp_exptmod.c | 2 +- bn_s_mp_mul_digs.c | 2 +- bn_s_mp_mul_high_digs.c | 2 +- bn_s_mp_sqr.c | 2 +- bn_s_mp_sub.c | 2 +- bncore.c | 2 +- tommath.h | 57 ----------------- tommath_private.h | 90 +++++++++++++++++++++++++++ 130 files changed, 218 insertions(+), 185 deletions(-) create mode 100644 tommath_private.h diff --git a/bn_error.c b/bn_error.c index b1f514e..3abf1a7 100644 --- a/bn_error.c +++ b/bn_error.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_ERROR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_fast_mp_invmod.c b/bn_fast_mp_invmod.c index 25e145b..aa41098 100644 --- a/bn_fast_mp_invmod.c +++ b/bn_fast_mp_invmod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_FAST_MP_INVMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_fast_mp_montgomery_reduce.c b/bn_fast_mp_montgomery_reduce.c index 36fb296..1f2acfc 100644 --- a/bn_fast_mp_montgomery_reduce.c +++ b/bn_fast_mp_montgomery_reduce.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_fast_s_mp_mul_digs.c b/bn_fast_s_mp_mul_digs.c index 4d4000c..a32e9a2 100644 --- a/bn_fast_s_mp_mul_digs.c +++ b/bn_fast_s_mp_mul_digs.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_FAST_S_MP_MUL_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_fast_s_mp_mul_high_digs.c b/bn_fast_s_mp_mul_high_digs.c index 4928d25..6c22b13 100644 --- a/bn_fast_s_mp_mul_high_digs.c +++ b/bn_fast_s_mp_mul_high_digs.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_fast_s_mp_sqr.c b/bn_fast_s_mp_sqr.c index c766455..0960b49 100644 --- a/bn_fast_s_mp_sqr.c +++ b/bn_fast_s_mp_sqr.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_FAST_S_MP_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_2expt.c b/bn_mp_2expt.c index f4c0b70..1b72ab7 100644 --- a/bn_mp_2expt.c +++ b/bn_mp_2expt.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_2EXPT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_abs.c b/bn_mp_abs.c index 6d5f66b..cc9c3db 100644 --- a/bn_mp_abs.c +++ b/bn_mp_abs.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_ABS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_add.c b/bn_mp_add.c index c4feee9..236fc75 100644 --- a/bn_mp_add.c +++ b/bn_mp_add.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_ADD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_add_d.c b/bn_mp_add_d.c index bb6df06..81b0c28 100644 --- a/bn_mp_add_d.c +++ b/bn_mp_add_d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_ADD_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_addmod.c b/bn_mp_addmod.c index 9657a2e..825c928 100644 --- a/bn_mp_addmod.c +++ b/bn_mp_addmod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_ADDMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_and.c b/bn_mp_and.c index 8ec2b2b..3b6b03e 100644 --- a/bn_mp_and.c +++ b/bn_mp_and.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_AND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_clamp.c b/bn_mp_clamp.c index 65c56f2..c75d553 100644 --- a/bn_mp_clamp.c +++ b/bn_mp_clamp.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_CLAMP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_clear.c b/bn_mp_clear.c index 0cca549..17ef9d5 100644 --- a/bn_mp_clear.c +++ b/bn_mp_clear.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_CLEAR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_clear_multi.c b/bn_mp_clear_multi.c index 19c5dfa..441a200 100644 --- a/bn_mp_clear_multi.c +++ b/bn_mp_clear_multi.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_CLEAR_MULTI_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_cmp.c b/bn_mp_cmp.c index 7c1ca02..74a98fe 100644 --- a/bn_mp_cmp.c +++ b/bn_mp_cmp.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_CMP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_cmp_d.c b/bn_mp_cmp_d.c index f625376..28a53ce 100644 --- a/bn_mp_cmp_d.c +++ b/bn_mp_cmp_d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_CMP_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_cmp_mag.c b/bn_mp_cmp_mag.c index 07be6f0..f72830f 100644 --- a/bn_mp_cmp_mag.c +++ b/bn_mp_cmp_mag.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_CMP_MAG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_cnt_lsb.c b/bn_mp_cnt_lsb.c index 92cc4e8..b5a7a05 100644 --- a/bn_mp_cnt_lsb.c +++ b/bn_mp_cnt_lsb.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_CNT_LSB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_copy.c b/bn_mp_copy.c index 7685838..dc853b3 100644 --- a/bn_mp_copy.c +++ b/bn_mp_copy.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_COPY_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_count_bits.c b/bn_mp_count_bits.c index f5e870b..74b59b6 100644 --- a/bn_mp_count_bits.c +++ b/bn_mp_count_bits.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_COUNT_BITS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_div.c b/bn_mp_div.c index 2b87399..da79523 100644 --- a/bn_mp_div.c +++ b/bn_mp_div.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DIV_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_div_2.c b/bn_mp_div_2.c index e8c4aca..7df0457 100644 --- a/bn_mp_div_2.c +++ b/bn_mp_div_2.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DIV_2_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_div_2d.c b/bn_mp_div_2d.c index c162db3..d809447 100644 --- a/bn_mp_div_2d.c +++ b/bn_mp_div_2d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DIV_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_div_3.c b/bn_mp_div_3.c index f1ccacf..c2b76fb 100644 --- a/bn_mp_div_3.c +++ b/bn_mp_div_3.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DIV_3_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_div_d.c b/bn_mp_div_d.c index dbaeb10..205a9b1 100644 --- a/bn_mp_div_d.c +++ b/bn_mp_div_d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DIV_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_dr_is_modulus.c b/bn_mp_dr_is_modulus.c index 7b821b8..599d929 100644 --- a/bn_mp_dr_is_modulus.c +++ b/bn_mp_dr_is_modulus.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DR_IS_MODULUS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_dr_reduce.c b/bn_mp_dr_reduce.c index 7cfe462..caabf16 100644 --- a/bn_mp_dr_reduce.c +++ b/bn_mp_dr_reduce.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DR_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_dr_setup.c b/bn_mp_dr_setup.c index 3878daf..1bccb2b 100644 --- a/bn_mp_dr_setup.c +++ b/bn_mp_dr_setup.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_DR_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_exch.c b/bn_mp_exch.c index 4a9968e..634193b 100644 --- a/bn_mp_exch.c +++ b/bn_mp_exch.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_EXCH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_export.c b/bn_mp_export.c index 7829315..cb96bff 100644 --- a/bn_mp_export.c +++ b/bn_mp_export.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_EXPORT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_expt_d.c b/bn_mp_expt_d.c index 1ccf352..61c5a1d 100644 --- a/bn_mp_expt_d.c +++ b/bn_mp_expt_d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_EXPT_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_expt_d_ex.c b/bn_mp_expt_d_ex.c index 8b12d24..649d224 100644 --- a/bn_mp_expt_d_ex.c +++ b/bn_mp_expt_d_ex.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_EXPT_D_EX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_exptmod.c b/bn_mp_exptmod.c index 1d9059e..eeb0aa1 100644 --- a/bn_mp_exptmod.c +++ b/bn_mp_exptmod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_EXPTMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_exptmod_fast.c b/bn_mp_exptmod_fast.c index 0f66942..e5671e1 100644 --- a/bn_mp_exptmod_fast.c +++ b/bn_mp_exptmod_fast.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_EXPTMOD_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_exteuclid.c b/bn_mp_exteuclid.c index f04fca0..fbbd92c 100644 --- a/bn_mp_exteuclid.c +++ b/bn_mp_exteuclid.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_EXTEUCLID_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_fread.c b/bn_mp_fread.c index 933b50e..a4fa8c9 100644 --- a/bn_mp_fread.c +++ b/bn_mp_fread.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_FREAD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_fwrite.c b/bn_mp_fwrite.c index 3e4d2b3..90f1fc5 100644 --- a/bn_mp_fwrite.c +++ b/bn_mp_fwrite.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_FWRITE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_gcd.c b/bn_mp_gcd.c index 8cf6e00..16acfd9 100644 --- a/bn_mp_gcd.c +++ b/bn_mp_gcd.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_GCD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_get_int.c b/bn_mp_get_int.c index c916d60..d1addab 100644 --- a/bn_mp_get_int.c +++ b/bn_mp_get_int.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_GET_INT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_get_long.c b/bn_mp_get_long.c index 7f2a54b..ec64b2e 100644 --- a/bn_mp_get_long.c +++ b/bn_mp_get_long.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_GET_LONG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_get_long_long.c b/bn_mp_get_long_long.c index 1c3773f..49faf5e 100644 --- a/bn_mp_get_long_long.c +++ b/bn_mp_get_long_long.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_GET_LONG_LONG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_grow.c b/bn_mp_grow.c index e748c4f..cbdcfed 100644 --- a/bn_mp_grow.c +++ b/bn_mp_grow.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_GROW_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_import.c b/bn_mp_import.c index c106e02..13b587c 100644 --- a/bn_mp_import.c +++ b/bn_mp_import.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_IMPORT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_init.c b/bn_mp_init.c index 452eac3..7a57730 100644 --- a/bn_mp_init.c +++ b/bn_mp_init.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INIT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_init_copy.c b/bn_mp_init_copy.c index 59a3e16..9e15f36 100644 --- a/bn_mp_init_copy.c +++ b/bn_mp_init_copy.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INIT_COPY_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_init_multi.c b/bn_mp_init_multi.c index 388b813..52220a3 100644 --- a/bn_mp_init_multi.c +++ b/bn_mp_init_multi.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INIT_MULTI_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_init_set.c b/bn_mp_init_set.c index bff25cd..c337e50 100644 --- a/bn_mp_init_set.c +++ b/bn_mp_init_set.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INIT_SET_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_init_set_int.c b/bn_mp_init_set_int.c index 626a4da..c88f14e 100644 --- a/bn_mp_init_set_int.c +++ b/bn_mp_init_set_int.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INIT_SET_INT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_init_size.c b/bn_mp_init_size.c index 05950f9..e1d1b51 100644 --- a/bn_mp_init_size.c +++ b/bn_mp_init_size.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INIT_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_invmod.c b/bn_mp_invmod.c index c0eb2c0..c8e65d1 100644 --- a/bn_mp_invmod.c +++ b/bn_mp_invmod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INVMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_invmod_slow.c b/bn_mp_invmod_slow.c index 50ce2c1..0f73820 100644 --- a/bn_mp_invmod_slow.c +++ b/bn_mp_invmod_slow.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_INVMOD_SLOW_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_is_square.c b/bn_mp_is_square.c index 8c2f221..9f065ef 100644 --- a/bn_mp_is_square.c +++ b/bn_mp_is_square.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_IS_SQUARE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_jacobi.c b/bn_mp_jacobi.c index b8427a5..160ac8f 100644 --- a/bn_mp_jacobi.c +++ b/bn_mp_jacobi.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_JACOBI_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_karatsuba_mul.c b/bn_mp_karatsuba_mul.c index ca0baba..09ee401 100644 --- a/bn_mp_karatsuba_mul.c +++ b/bn_mp_karatsuba_mul.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_KARATSUBA_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_karatsuba_sqr.c b/bn_mp_karatsuba_sqr.c index b6f4690..1d9f883 100644 --- a/bn_mp_karatsuba_sqr.c +++ b/bn_mp_karatsuba_sqr.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_KARATSUBA_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_lcm.c b/bn_mp_lcm.c index 59421e3..3bff571 100644 --- a/bn_mp_lcm.c +++ b/bn_mp_lcm.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_LCM_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_lshd.c b/bn_mp_lshd.c index 27274dd..5952651 100644 --- a/bn_mp_lshd.c +++ b/bn_mp_lshd.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_LSHD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mod.c b/bn_mp_mod.c index f7eb1c4..c66ecb0 100644 --- a/bn_mp_mod.c +++ b/bn_mp_mod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mod_2d.c b/bn_mp_mod_2d.c index 9fa95a4..b515341 100644 --- a/bn_mp_mod_2d.c +++ b/bn_mp_mod_2d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MOD_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mod_d.c b/bn_mp_mod_d.c index c996a09..d8722f0 100644 --- a/bn_mp_mod_d.c +++ b/bn_mp_mod_d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MOD_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_montgomery_calc_normalization.c b/bn_mp_montgomery_calc_normalization.c index 089849d..4617492 100644 --- a/bn_mp_montgomery_calc_normalization.c +++ b/bn_mp_montgomery_calc_normalization.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_montgomery_reduce.c b/bn_mp_montgomery_reduce.c index e92a988..663fbe5 100644 --- a/bn_mp_montgomery_reduce.c +++ b/bn_mp_montgomery_reduce.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MONTGOMERY_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_montgomery_setup.c b/bn_mp_montgomery_setup.c index 3a9f45b..e27f739 100644 --- a/bn_mp_montgomery_setup.c +++ b/bn_mp_montgomery_setup.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MONTGOMERY_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mul.c b/bn_mp_mul.c index d7f0074..a22f6ed 100644 --- a/bn_mp_mul.c +++ b/bn_mp_mul.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mul_2.c b/bn_mp_mul_2.c index 88d8ab8..f6c4c69 100644 --- a/bn_mp_mul_2.c +++ b/bn_mp_mul_2.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MUL_2_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mul_2d.c b/bn_mp_mul_2d.c index c7fa060..50d4563 100644 --- a/bn_mp_mul_2d.c +++ b/bn_mp_mul_2d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MUL_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mul_d.c b/bn_mp_mul_d.c index 7832519..37253ad 100644 --- a/bn_mp_mul_d.c +++ b/bn_mp_mul_d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MUL_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_mulmod.c b/bn_mp_mulmod.c index f0592de..5ea88ef 100644 --- a/bn_mp_mulmod.c +++ b/bn_mp_mulmod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_MULMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_n_root.c b/bn_mp_n_root.c index 2ac25e0..a14ee67 100644 --- a/bn_mp_n_root.c +++ b/bn_mp_n_root.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_N_ROOT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_n_root_ex.c b/bn_mp_n_root_ex.c index b9b4a44..ace6647 100644 --- a/bn_mp_n_root_ex.c +++ b/bn_mp_n_root_ex.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_N_ROOT_EX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_neg.c b/bn_mp_neg.c index b31155b..ea32e46 100644 --- a/bn_mp_neg.c +++ b/bn_mp_neg.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_NEG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_or.c b/bn_mp_or.c index 676eaac..b7f2e4f 100644 --- a/bn_mp_or.c +++ b/bn_mp_or.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_OR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_prime_fermat.c b/bn_mp_prime_fermat.c index 97b9d27..9dc9e85 100644 --- a/bn_mp_prime_fermat.c +++ b/bn_mp_prime_fermat.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_PRIME_FERMAT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_prime_is_divisible.c b/bn_mp_prime_is_divisible.c index c7ed529..5854f08 100644 --- a/bn_mp_prime_is_divisible.c +++ b/bn_mp_prime_is_divisible.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_PRIME_IS_DIVISIBLE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_prime_is_prime.c b/bn_mp_prime_is_prime.c index d5677d5..7687365 100644 --- a/bn_mp_prime_is_prime.c +++ b/bn_mp_prime_is_prime.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_PRIME_IS_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_prime_miller_rabin.c b/bn_mp_prime_miller_rabin.c index beb3c6d..f610ea5 100644 --- a/bn_mp_prime_miller_rabin.c +++ b/bn_mp_prime_miller_rabin.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_PRIME_MILLER_RABIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_prime_next_prime.c b/bn_mp_prime_next_prime.c index a977a44..3e08918 100644 --- a/bn_mp_prime_next_prime.c +++ b/bn_mp_prime_next_prime.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_PRIME_NEXT_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_prime_rabin_miller_trials.c b/bn_mp_prime_rabin_miller_trials.c index 485e254..bca4229 100644 --- a/bn_mp_prime_rabin_miller_trials.c +++ b/bn_mp_prime_rabin_miller_trials.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_PRIME_RABIN_MILLER_TRIALS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_prime_random_ex.c b/bn_mp_prime_random_ex.c index 3dfc425..9d96b67 100644 --- a/bn_mp_prime_random_ex.c +++ b/bn_mp_prime_random_ex.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_PRIME_RANDOM_EX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_radix_size.c b/bn_mp_radix_size.c index 285c8af..f35aa21 100644 --- a/bn_mp_radix_size.c +++ b/bn_mp_radix_size.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_RADIX_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_radix_smap.c b/bn_mp_radix_smap.c index 257f035..d1c75ad 100644 --- a/bn_mp_radix_smap.c +++ b/bn_mp_radix_smap.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_RADIX_SMAP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_rand.c b/bn_mp_rand.c index 5a74131..4c9610d 100644 --- a/bn_mp_rand.c +++ b/bn_mp_rand.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_RAND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_read_radix.c b/bn_mp_read_radix.c index d407e9d..390540e 100644 --- a/bn_mp_read_radix.c +++ b/bn_mp_read_radix.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_READ_RADIX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_read_signed_bin.c b/bn_mp_read_signed_bin.c index 3eba481..a4d4760 100644 --- a/bn_mp_read_signed_bin.c +++ b/bn_mp_read_signed_bin.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_READ_SIGNED_BIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_read_unsigned_bin.c b/bn_mp_read_unsigned_bin.c index 4d0472c..e8e5df8 100644 --- a/bn_mp_read_unsigned_bin.c +++ b/bn_mp_read_unsigned_bin.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_READ_UNSIGNED_BIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce.c b/bn_mp_reduce.c index 23372d1..e2c3a58 100644 --- a/bn_mp_reduce.c +++ b/bn_mp_reduce.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce_2k.c b/bn_mp_reduce_2k.c index d19b847..2876a75 100644 --- a/bn_mp_reduce_2k.c +++ b/bn_mp_reduce_2k.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_2K_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce_2k_l.c b/bn_mp_reduce_2k_l.c index 675065f..3225214 100644 --- a/bn_mp_reduce_2k_l.c +++ b/bn_mp_reduce_2k_l.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_2K_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce_2k_setup.c b/bn_mp_reduce_2k_setup.c index 2c64bc3..545051e 100644 --- a/bn_mp_reduce_2k_setup.c +++ b/bn_mp_reduce_2k_setup.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_2K_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce_2k_setup_l.c b/bn_mp_reduce_2k_setup_l.c index 9b2cdcc..59132dd 100644 --- a/bn_mp_reduce_2k_setup_l.c +++ b/bn_mp_reduce_2k_setup_l.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_2K_SETUP_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce_is_2k.c b/bn_mp_reduce_is_2k.c index 7ac90db..784947b 100644 --- a/bn_mp_reduce_is_2k.c +++ b/bn_mp_reduce_is_2k.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_IS_2K_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce_is_2k_l.c b/bn_mp_reduce_is_2k_l.c index e4790a3..c193f39 100644 --- a/bn_mp_reduce_is_2k_l.c +++ b/bn_mp_reduce_is_2k_l.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_IS_2K_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_reduce_setup.c b/bn_mp_reduce_setup.c index d67e5d2..f97eed5 100644 --- a/bn_mp_reduce_setup.c +++ b/bn_mp_reduce_setup.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_REDUCE_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_rshd.c b/bn_mp_rshd.c index 0f414ba..8ed6933 100644 --- a/bn_mp_rshd.c +++ b/bn_mp_rshd.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_RSHD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_set.c b/bn_mp_set.c index d8e20f1..cac48ea 100644 --- a/bn_mp_set.c +++ b/bn_mp_set.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SET_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_set_int.c b/bn_mp_set_int.c index 2051cfb..5aa59d5 100644 --- a/bn_mp_set_int.c +++ b/bn_mp_set_int.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SET_INT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_set_long.c b/bn_mp_set_long.c index fb444e4..281fce7 100644 --- a/bn_mp_set_long.c +++ b/bn_mp_set_long.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SET_LONG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_set_long_long.c b/bn_mp_set_long_long.c index 34ca89c..3c4b01a 100644 --- a/bn_mp_set_long_long.c +++ b/bn_mp_set_long_long.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SET_LONG_LONG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_shrink.c b/bn_mp_shrink.c index bbc1208..1ad2ede 100644 --- a/bn_mp_shrink.c +++ b/bn_mp_shrink.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SHRINK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_signed_bin_size.c b/bn_mp_signed_bin_size.c index 1d52f61..0e760a6 100644 --- a/bn_mp_signed_bin_size.c +++ b/bn_mp_signed_bin_size.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SIGNED_BIN_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_sqr.c b/bn_mp_sqr.c index 5167ce0..e39c518 100644 --- a/bn_mp_sqr.c +++ b/bn_mp_sqr.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_sqrmod.c b/bn_mp_sqrmod.c index 6c22150..2f9463d 100644 --- a/bn_mp_sqrmod.c +++ b/bn_mp_sqrmod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SQRMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_sqrt.c b/bn_mp_sqrt.c index 3577110..4a52f5e 100644 --- a/bn_mp_sqrt.c +++ b/bn_mp_sqrt.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SQRT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_sqrtmod_prime.c b/bn_mp_sqrtmod_prime.c index 2f1b7a7..7906f09 100644 --- a/bn_mp_sqrtmod_prime.c +++ b/bn_mp_sqrtmod_prime.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SQRTMOD_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_sub.c b/bn_mp_sub.c index 05c0409..0d616c2 100644 --- a/bn_mp_sub.c +++ b/bn_mp_sub.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SUB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_sub_d.c b/bn_mp_sub_d.c index 8777a78..e1c613e 100644 --- a/bn_mp_sub_d.c +++ b/bn_mp_sub_d.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SUB_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_submod.c b/bn_mp_submod.c index c1b4001..87e0889 100644 --- a/bn_mp_submod.c +++ b/bn_mp_submod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_SUBMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_to_signed_bin.c b/bn_mp_to_signed_bin.c index 2898908..e9289ea 100644 --- a/bn_mp_to_signed_bin.c +++ b/bn_mp_to_signed_bin.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TO_SIGNED_BIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_to_signed_bin_n.c b/bn_mp_to_signed_bin_n.c index 7db4a06..d4fe6e6 100644 --- a/bn_mp_to_signed_bin_n.c +++ b/bn_mp_to_signed_bin_n.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TO_SIGNED_BIN_N_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_to_unsigned_bin.c b/bn_mp_to_unsigned_bin.c index 132a6ca..d3ef46f 100644 --- a/bn_mp_to_unsigned_bin.c +++ b/bn_mp_to_unsigned_bin.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TO_UNSIGNED_BIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_to_unsigned_bin_n.c b/bn_mp_to_unsigned_bin_n.c index d1da9c1..2da13cc 100644 --- a/bn_mp_to_unsigned_bin_n.c +++ b/bn_mp_to_unsigned_bin_n.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TO_UNSIGNED_BIN_N_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_toom_mul.c b/bn_mp_toom_mul.c index 942680d..4731f8f 100644 --- a/bn_mp_toom_mul.c +++ b/bn_mp_toom_mul.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TOOM_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_toom_sqr.c b/bn_mp_toom_sqr.c index 0fe967b..69b69d4 100644 --- a/bn_mp_toom_sqr.c +++ b/bn_mp_toom_sqr.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TOOM_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_toradix.c b/bn_mp_toradix.c index 94efc7a..0734353 100644 --- a/bn_mp_toradix.c +++ b/bn_mp_toradix.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TORADIX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_toradix_n.c b/bn_mp_toradix_n.c index eb8195f..9710e5d 100644 --- a/bn_mp_toradix_n.c +++ b/bn_mp_toradix_n.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_TORADIX_N_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_unsigned_bin_size.c b/bn_mp_unsigned_bin_size.c index 36a9586..637b041 100644 --- a/bn_mp_unsigned_bin_size.c +++ b/bn_mp_unsigned_bin_size.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_UNSIGNED_BIN_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_xor.c b/bn_mp_xor.c index aea4d6a..3c2ba9e 100644 --- a/bn_mp_xor.c +++ b/bn_mp_xor.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_XOR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_mp_zero.c b/bn_mp_zero.c index 3c4aca5..21365ed 100644 --- a/bn_mp_zero.c +++ b/bn_mp_zero.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_MP_ZERO_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_prime_tab.c b/bn_prime_tab.c index 4ef8ffa..ae727a4 100644 --- a/bn_prime_tab.c +++ b/bn_prime_tab.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_PRIME_TAB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_reverse.c b/bn_reverse.c index e5e97b0..fc6eb2d 100644 --- a/bn_reverse.c +++ b/bn_reverse.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_REVERSE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_s_mp_add.c b/bn_s_mp_add.c index 1fb6797..4790cd9 100644 --- a/bn_s_mp_add.c +++ b/bn_s_mp_add.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_S_MP_ADD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_s_mp_exptmod.c b/bn_s_mp_exptmod.c index 78387a6..269a7ba 100644 --- a/bn_s_mp_exptmod.c +++ b/bn_s_mp_exptmod.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_S_MP_EXPTMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_s_mp_mul_digs.c b/bn_s_mp_mul_digs.c index cf17dd5..69e11d6 100644 --- a/bn_s_mp_mul_digs.c +++ b/bn_s_mp_mul_digs.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_S_MP_MUL_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_s_mp_mul_high_digs.c b/bn_s_mp_mul_high_digs.c index 6f19b8f..3e3b48e 100644 --- a/bn_s_mp_mul_high_digs.c +++ b/bn_s_mp_mul_high_digs.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_S_MP_MUL_HIGH_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_s_mp_sqr.c b/bn_s_mp_sqr.c index 4170942..dd06b77 100644 --- a/bn_s_mp_sqr.c +++ b/bn_s_mp_sqr.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_S_MP_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bn_s_mp_sub.c b/bn_s_mp_sub.c index bb53a28..4cf92d5 100644 --- a/bn_s_mp_sub.c +++ b/bn_s_mp_sub.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BN_S_MP_SUB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/bncore.c b/bncore.c index b3d3d34..9552714 100644 --- a/bncore.c +++ b/bncore.c @@ -1,4 +1,4 @@ -#include +#include #ifdef BNCORE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * diff --git a/tommath.h b/tommath.h index 16cd023..556b924 100644 --- a/tommath.h +++ b/tommath.h @@ -601,63 +601,6 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream); #define mp_todecimal(M, S) mp_toradix((M), (S), 10) #define mp_tohex(M, S) mp_toradix((M), (S), 16) -/* lowlevel functions, do not call! */ -int s_mp_add(mp_int *a, mp_int *b, mp_int *c); -int s_mp_sub(mp_int *a, mp_int *b, mp_int *c); -#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1) -int fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); -int s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); -int fast_s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs); -int s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs); -int fast_s_mp_sqr(mp_int *a, mp_int *b); -int s_mp_sqr(mp_int *a, mp_int *b); -int mp_karatsuba_mul(mp_int *a, mp_int *b, mp_int *c); -int mp_toom_mul(mp_int *a, mp_int *b, mp_int *c); -int mp_karatsuba_sqr(mp_int *a, mp_int *b); -int mp_toom_sqr(mp_int *a, mp_int *b); -int fast_mp_invmod(mp_int *a, mp_int *b, mp_int *c); -int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c); -int fast_mp_montgomery_reduce(mp_int *a, mp_int *m, mp_digit mp); -int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int mode); -int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode); -void bn_reverse(unsigned char *s, int len); - -extern const char *mp_s_rmap; - -/* Fancy macro to set an MPI from another type. - * There are several things assumed: - * x is the counter and unsigned - * a is the pointer to the MPI - * b is the original value that should be set in the MPI. - */ -#define MP_SET_XLONG(func_name, type) \ -int func_name (mp_int * a, type b) \ -{ \ - unsigned int x; \ - int res; \ - \ - mp_zero (a); \ - \ - /* set four bits at a time */ \ - for (x = 0; x < (sizeof(type) * 2); x++) { \ - /* shift the number up four bits */ \ - if ((res = mp_mul_2d (a, 4, a)) != MP_OKAY) { \ - return res; \ - } \ - \ - /* OR in the top four bits of the source */ \ - a->dp[0] |= (b >> ((sizeof(type) * 8) - 4)) & 15; \ - \ - /* shift the source up to the next four bits */ \ - b <<= 4; \ - \ - /* ensure that digits are not clamped off */ \ - a->used += 1; \ - } \ - mp_clamp (a); \ - return MP_OKAY; \ -} - #ifdef __cplusplus } #endif diff --git a/tommath_private.h b/tommath_private.h new file mode 100644 index 0000000..d154739 --- /dev/null +++ b/tommath_private.h @@ -0,0 +1,90 @@ +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tstdenis82@gmail.com, http://math.libtomcrypt.com + */ +#ifndef TOMMATH_PRIV_H_ +#define TOMMATH_PRIV_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* lowlevel functions, do not call! */ +int s_mp_add(mp_int *a, mp_int *b, mp_int *c); +int s_mp_sub(mp_int *a, mp_int *b, mp_int *c); +#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1) +int fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int fast_s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int fast_s_mp_sqr(mp_int *a, mp_int *b); +int s_mp_sqr(mp_int *a, mp_int *b); +int mp_karatsuba_mul(mp_int *a, mp_int *b, mp_int *c); +int mp_toom_mul(mp_int *a, mp_int *b, mp_int *c); +int mp_karatsuba_sqr(mp_int *a, mp_int *b); +int mp_toom_sqr(mp_int *a, mp_int *b); +int fast_mp_invmod(mp_int *a, mp_int *b, mp_int *c); +int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c); +int fast_mp_montgomery_reduce(mp_int *a, mp_int *m, mp_digit mp); +int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int mode); +int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode); +void bn_reverse(unsigned char *s, int len); + +extern const char *mp_s_rmap; + +/* Fancy macro to set an MPI from another type. + * There are several things assumed: + * x is the counter and unsigned + * a is the pointer to the MPI + * b is the original value that should be set in the MPI. + */ +#define MP_SET_XLONG(func_name, type) \ +int func_name (mp_int * a, type b) \ +{ \ + unsigned int x; \ + int res; \ + \ + mp_zero (a); \ + \ + /* set four bits at a time */ \ + for (x = 0; x < (sizeof(type) * 2); x++) { \ + /* shift the number up four bits */ \ + if ((res = mp_mul_2d (a, 4, a)) != MP_OKAY) { \ + return res; \ + } \ + \ + /* OR in the top four bits of the source */ \ + a->dp[0] |= (b >> ((sizeof(type) * 8) - 4)) & 15; \ + \ + /* shift the source up to the next four bits */ \ + b <<= 4; \ + \ + /* ensure that digits are not clamped off */ \ + a->used += 1; \ + } \ + mp_clamp (a); \ + return MP_OKAY; \ +} + +#ifdef __cplusplus + } +#endif + +#endif + + +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */