From 7a68f12873b1c58ea254e7c5e70e79846692a484 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sat, 19 Oct 2019 16:24:39 +0200 Subject: [PATCH] Execute move.sh - Rename files from bn_* to match the function names. * git blame is not affected * git log --follow can be used to show log across renames --- demo/test.c | 232 +- doc/bn.tex | 54 +- etc/tune.c | 26 +- gen.pl | 2 +- helper.pl | 8 +- libtommath_VS2008.vcproj | 312 +-- makefile | 52 +- makefile.mingw | 52 +- makefile.msvc | 52 +- makefile.shared | 52 +- makefile.unix | 52 +- move.sh | 38 - bn_mp_2expt.c => mp_2expt.c | 2 +- bn_mp_abs.c => mp_abs.c | 2 +- bn_mp_add.c => mp_add.c | 2 +- bn_mp_add_d.c => mp_add_d.c | 2 +- bn_mp_addmod.c => mp_addmod.c | 2 +- bn_mp_and.c => mp_and.c | 2 +- bn_mp_clamp.c => mp_clamp.c | 2 +- bn_mp_clear.c => mp_clear.c | 2 +- bn_mp_clear_multi.c => mp_clear_multi.c | 2 +- bn_mp_cmp.c => mp_cmp.c | 2 +- bn_mp_cmp_d.c => mp_cmp_d.c | 2 +- bn_mp_cmp_mag.c => mp_cmp_mag.c | 2 +- bn_mp_cnt_lsb.c => mp_cnt_lsb.c | 2 +- bn_mp_complement.c => mp_complement.c | 2 +- bn_mp_copy.c => mp_copy.c | 2 +- bn_mp_count_bits.c => mp_count_bits.c | 2 +- bn_cutoffs.c => mp_cutoffs.c | 2 +- bn_mp_decr.c => mp_decr.c | 2 +- bn_mp_div.c => mp_div.c | 4 +- bn_mp_div_2.c => mp_div_2.c | 2 +- bn_mp_div_2d.c => mp_div_2d.c | 2 +- bn_mp_div_3.c => mp_div_3.c | 2 +- bn_mp_div_d.c => mp_div_d.c | 2 +- bn_mp_dr_is_modulus.c => mp_dr_is_modulus.c | 2 +- bn_mp_dr_reduce.c => mp_dr_reduce.c | 2 +- bn_mp_dr_setup.c => mp_dr_setup.c | 2 +- ..._error_to_string.c => mp_error_to_string.c | 2 +- bn_mp_exch.c => mp_exch.c | 2 +- bn_mp_expt_u32.c => mp_expt_u32.c | 2 +- bn_mp_exptmod.c => mp_exptmod.c | 2 +- bn_mp_exteuclid.c => mp_exteuclid.c | 2 +- bn_mp_fread.c => mp_fread.c | 2 +- bn_mp_from_sbin.c => mp_from_sbin.c | 2 +- bn_mp_from_ubin.c => mp_from_ubin.c | 2 +- bn_mp_fwrite.c => mp_fwrite.c | 2 +- bn_mp_gcd.c => mp_gcd.c | 2 +- bn_mp_get_double.c => mp_get_double.c | 2 +- bn_mp_get_i32.c => mp_get_i32.c | 2 +- bn_mp_get_i64.c => mp_get_i64.c | 2 +- bn_mp_get_l.c => mp_get_l.c | 2 +- bn_mp_get_ll.c => mp_get_ll.c | 2 +- bn_mp_get_mag_u32.c => mp_get_mag_u32.c | 2 +- bn_mp_get_mag_u64.c => mp_get_mag_u64.c | 2 +- bn_mp_get_mag_ul.c => mp_get_mag_ul.c | 2 +- bn_mp_get_mag_ull.c => mp_get_mag_ull.c | 2 +- bn_mp_grow.c => mp_grow.c | 2 +- bn_mp_incr.c => mp_incr.c | 2 +- bn_mp_init.c => mp_init.c | 2 +- bn_mp_init_copy.c => mp_init_copy.c | 2 +- bn_mp_init_i32.c => mp_init_i32.c | 2 +- bn_mp_init_i64.c => mp_init_i64.c | 2 +- bn_mp_init_l.c => mp_init_l.c | 2 +- bn_mp_init_ll.c => mp_init_ll.c | 2 +- bn_mp_init_multi.c => mp_init_multi.c | 2 +- bn_mp_init_set.c => mp_init_set.c | 2 +- bn_mp_init_size.c => mp_init_size.c | 2 +- bn_mp_init_u32.c => mp_init_u32.c | 2 +- bn_mp_init_u64.c => mp_init_u64.c | 2 +- bn_mp_init_ul.c => mp_init_ul.c | 2 +- bn_mp_init_ull.c => mp_init_ull.c | 2 +- bn_mp_invmod.c => mp_invmod.c | 2 +- bn_mp_is_square.c => mp_is_square.c | 2 +- bn_mp_iseven.c => mp_iseven.c | 2 +- bn_mp_isodd.c => mp_isodd.c | 2 +- bn_mp_kronecker.c => mp_kronecker.c | 2 +- bn_mp_lcm.c => mp_lcm.c | 2 +- bn_mp_log_u32.c => mp_log_u32.c | 2 +- bn_mp_lshd.c => mp_lshd.c | 4 +- bn_mp_mod.c => mp_mod.c | 2 +- bn_mp_mod_2d.c => mp_mod_2d.c | 2 +- bn_mp_mod_d.c => mp_mod_d.c | 2 +- ...on.c => mp_montgomery_calc_normalization.c | 2 +- ...tgomery_reduce.c => mp_montgomery_reduce.c | 2 +- ...ontgomery_setup.c => mp_montgomery_setup.c | 2 +- bn_mp_mul.c => mp_mul.c | 2 +- bn_mp_mul_2.c => mp_mul_2.c | 2 +- bn_mp_mul_2d.c => mp_mul_2d.c | 2 +- bn_mp_mul_d.c => mp_mul_d.c | 2 +- bn_mp_mulmod.c => mp_mulmod.c | 2 +- bn_mp_neg.c => mp_neg.c | 2 +- bn_mp_or.c => mp_or.c | 2 +- bn_mp_pack.c => mp_pack.c | 2 +- bn_mp_pack_count.c => mp_pack_count.c | 2 +- bn_mp_prime_fermat.c => mp_prime_fermat.c | 2 +- ...erwood.c => mp_prime_frobenius_underwood.c | 4 +- bn_mp_prime_is_prime.c => mp_prime_is_prime.c | 2 +- ..._miller_rabin.c => mp_prime_miller_rabin.c | 2 +- ...rime_next_prime.c => mp_prime_next_prime.c | 2 +- ...trials.c => mp_prime_rabin_miller_trials.c | 2 +- bn_mp_prime_rand.c => mp_prime_rand.c | 2 +- ...dge.c => mp_prime_strong_lucas_selfridge.c | 4 +- bn_prime_tab.c => mp_prime_tab.c | 2 +- bn_mp_radix_size.c => mp_radix_size.c | 2 +- bn_mp_radix_smap.c => mp_radix_smap.c | 2 +- bn_mp_rand.c => mp_rand.c | 2 +- bn_mp_read_radix.c => mp_read_radix.c | 2 +- bn_mp_reduce.c => mp_reduce.c | 2 +- bn_mp_reduce_2k.c => mp_reduce_2k.c | 2 +- bn_mp_reduce_2k_l.c => mp_reduce_2k_l.c | 2 +- ..._reduce_2k_setup.c => mp_reduce_2k_setup.c | 2 +- ...uce_2k_setup_l.c => mp_reduce_2k_setup_l.c | 2 +- bn_mp_reduce_is_2k.c => mp_reduce_is_2k.c | 2 +- bn_mp_reduce_is_2k_l.c => mp_reduce_is_2k_l.c | 2 +- bn_mp_reduce_setup.c => mp_reduce_setup.c | 2 +- bn_mp_root_u32.c => mp_root_u32.c | 2 +- bn_mp_rshd.c => mp_rshd.c | 2 +- bn_mp_sbin_size.c => mp_sbin_size.c | 2 +- bn_mp_set.c => mp_set.c | 2 +- bn_mp_set_double.c => mp_set_double.c | 2 +- bn_mp_set_i32.c => mp_set_i32.c | 2 +- bn_mp_set_i64.c => mp_set_i64.c | 2 +- bn_mp_set_l.c => mp_set_l.c | 2 +- bn_mp_set_ll.c => mp_set_ll.c | 2 +- bn_mp_set_u32.c => mp_set_u32.c | 2 +- bn_mp_set_u64.c => mp_set_u64.c | 2 +- bn_mp_set_ul.c => mp_set_ul.c | 2 +- bn_mp_set_ull.c => mp_set_ull.c | 2 +- bn_mp_shrink.c => mp_shrink.c | 2 +- bn_mp_signed_rsh.c => mp_signed_rsh.c | 2 +- bn_mp_sqr.c => mp_sqr.c | 2 +- bn_mp_sqrmod.c => mp_sqrmod.c | 2 +- bn_mp_sqrt.c => mp_sqrt.c | 2 +- bn_mp_sqrtmod_prime.c => mp_sqrtmod_prime.c | 2 +- bn_mp_sub.c => mp_sub.c | 2 +- bn_mp_sub_d.c => mp_sub_d.c | 2 +- bn_mp_submod.c => mp_submod.c | 2 +- bn_mp_to_radix.c => mp_to_radix.c | 2 +- bn_mp_to_sbin.c => mp_to_sbin.c | 2 +- bn_mp_to_ubin.c => mp_to_ubin.c | 2 +- bn_mp_ubin_size.c => mp_ubin_size.c | 2 +- bn_mp_unpack.c => mp_unpack.c | 2 +- bn_mp_xor.c => mp_xor.c | 2 +- bn_mp_zero.c => mp_zero.c | 2 +- bn_s_mp_add.c => s_mp_add.c | 2 +- bn_s_mp_balance_mul.c => s_mp_balance_mul.c | 2 +- bn_s_mp_exptmod.c => s_mp_exptmod.c | 2 +- bn_s_mp_exptmod_fast.c => s_mp_exptmod_fast.c | 2 +- bn_s_mp_get_bit.c => s_mp_get_bit.c | 2 +- bn_s_mp_invmod_fast.c => s_mp_invmod_fast.c | 2 +- bn_s_mp_invmod_slow.c => s_mp_invmod_slow.c | 2 +- ...mp_karatsuba_mul.c => s_mp_karatsuba_mul.c | 2 +- ...mp_karatsuba_sqr.c => s_mp_karatsuba_sqr.c | 2 +- ...ce_fast.c => s_mp_montgomery_reduce_fast.c | 2 +- bn_s_mp_mul_digs.c => s_mp_mul_digs.c | 2 +- ...mp_mul_digs_fast.c => s_mp_mul_digs_fast.c | 2 +- ...mp_mul_high_digs.c => s_mp_mul_high_digs.c | 2 +- ...h_digs_fast.c => s_mp_mul_high_digs_fast.c | 2 +- ...s_divisible.c => s_mp_prime_is_divisible.c | 2 +- bn_s_mp_rand_jenkins.c => s_mp_rand_jenkins.c | 2 +- ...mp_rand_platform.c => s_mp_rand_platform.c | 14 +- bn_s_mp_reverse.c => s_mp_reverse.c | 2 +- bn_s_mp_sqr.c => s_mp_sqr.c | 2 +- bn_s_mp_sqr_fast.c => s_mp_sqr_fast.c | 2 +- bn_s_mp_sub.c => s_mp_sub.c | 2 +- bn_s_mp_toom_mul.c => s_mp_toom_mul.c | 2 +- bn_s_mp_toom_sqr.c => s_mp_toom_sqr.c | 2 +- tommath.def | 2 + tommath.h | 4 +- tommath_class.h | 1930 ++++++++--------- tommath_private.h | 6 +- tommath_superclass.h | 130 +- 173 files changed, 1635 insertions(+), 1701 deletions(-) delete mode 100755 move.sh rename bn_mp_2expt.c => mp_2expt.c (97%) rename bn_mp_abs.c => mp_abs.c (96%) rename bn_mp_add.c => mp_add.c (98%) rename bn_mp_add_d.c => mp_add_d.c (98%) rename bn_mp_addmod.c => mp_addmod.c (95%) rename bn_mp_and.c => mp_and.c (98%) rename bn_mp_clamp.c => mp_clamp.c (96%) rename bn_mp_clear.c => mp_clear.c (95%) rename bn_mp_clear_multi.c => mp_clear_multi.c (93%) rename bn_mp_cmp.c => mp_cmp.c (96%) rename bn_mp_cmp_d.c => mp_cmp_d.c (96%) rename bn_mp_cmp_mag.c => mp_cmp_mag.c (97%) rename bn_mp_cnt_lsb.c => mp_cnt_lsb.c (97%) rename bn_mp_complement.c => mp_complement.c (92%) rename bn_mp_copy.c => mp_copy.c (97%) rename bn_mp_count_bits.c => mp_count_bits.c (95%) rename bn_cutoffs.c => mp_cutoffs.c (95%) rename bn_mp_decr.c => mp_decr.c (97%) rename bn_mp_div.c => mp_div.c (99%) rename bn_mp_div_2.c => mp_div_2.c (97%) rename bn_mp_div_2d.c => mp_div_2d.c (98%) rename bn_mp_div_3.c => mp_div_3.c (98%) rename bn_mp_div_d.c => mp_div_d.c (98%) rename bn_mp_dr_is_modulus.c => mp_dr_is_modulus.c (95%) rename bn_mp_dr_reduce.c => mp_dr_reduce.c (98%) rename bn_mp_dr_setup.c => mp_dr_setup.c (94%) rename bn_mp_error_to_string.c => mp_error_to_string.c (94%) rename bn_mp_exch.c => mp_exch.c (94%) rename bn_mp_expt_u32.c => mp_expt_u32.c (97%) rename bn_mp_exptmod.c => mp_exptmod.c (98%) rename bn_mp_exteuclid.c => mp_exteuclid.c (99%) rename bn_mp_fread.c => mp_fread.c (98%) rename bn_mp_from_sbin.c => mp_from_sbin.c (96%) rename bn_mp_from_ubin.c => mp_from_ubin.c (96%) rename bn_mp_fwrite.c => mp_fwrite.c (97%) rename bn_mp_gcd.c => mp_gcd.c (99%) rename bn_mp_get_double.c => mp_get_double.c (94%) rename bn_mp_get_i32.c => mp_get_i32.c (90%) rename bn_mp_get_i64.c => mp_get_i64.c (90%) rename bn_mp_get_l.c => mp_get_l.c (90%) rename bn_mp_get_ll.c => mp_get_ll.c (90%) rename bn_mp_get_mag_u32.c => mp_get_mag_u32.c (87%) rename bn_mp_get_mag_u64.c => mp_get_mag_u64.c (87%) rename bn_mp_get_mag_ul.c => mp_get_mag_ul.c (87%) rename bn_mp_get_mag_ull.c => mp_get_mag_ull.c (87%) rename bn_mp_grow.c => mp_grow.c (98%) rename bn_mp_incr.c => mp_incr.c (97%) rename bn_mp_init.c => mp_init.c (96%) rename bn_mp_init_copy.c => mp_init_copy.c (94%) rename bn_mp_init_i32.c => mp_init_i32.c (88%) rename bn_mp_init_i64.c => mp_init_i64.c (88%) rename bn_mp_init_l.c => mp_init_l.c (89%) rename bn_mp_init_ll.c => mp_init_ll.c (89%) rename bn_mp_init_multi.c => mp_init_multi.c (97%) rename bn_mp_init_set.c => mp_init_set.c (93%) rename bn_mp_init_size.c => mp_init_size.c (95%) rename bn_mp_init_u32.c => mp_init_u32.c (88%) rename bn_mp_init_u64.c => mp_init_u64.c (88%) rename bn_mp_init_ul.c => mp_init_ul.c (89%) rename bn_mp_init_ull.c => mp_init_ull.c (89%) rename bn_mp_invmod.c => mp_invmod.c (96%) rename bn_mp_is_square.c => mp_is_square.c (99%) rename bn_mp_iseven.c => mp_iseven.c (91%) rename bn_mp_isodd.c => mp_isodd.c (91%) rename bn_mp_kronecker.c => mp_kronecker.c (99%) rename bn_mp_lcm.c => mp_lcm.c (98%) rename bn_mp_log_u32.c => mp_log_u32.c (99%) rename bn_mp_lshd.c => mp_lshd.c (92%) rename bn_mp_mod.c => mp_mod.c (97%) rename bn_mp_mod_2d.c => mp_mod_2d.c (97%) rename bn_mp_mod_d.c => mp_mod_d.c (92%) rename bn_mp_montgomery_calc_normalization.c => mp_montgomery_calc_normalization.c (96%) rename bn_mp_montgomery_reduce.c => mp_montgomery_reduce.c (98%) rename bn_mp_montgomery_setup.c => mp_montgomery_setup.c (97%) rename bn_mp_mul.c => mp_mul.c (99%) rename bn_mp_mul_2.c => mp_mul_2.c (98%) rename bn_mp_mul_2d.c => mp_mul_2d.c (98%) rename bn_mp_mul_d.c => mp_mul_d.c (98%) rename bn_mp_mulmod.c => mp_mulmod.c (95%) rename bn_mp_neg.c => mp_neg.c (96%) rename bn_mp_or.c => mp_or.c (98%) rename bn_mp_pack.c => mp_pack.c (98%) rename bn_mp_pack_count.c => mp_pack_count.c (93%) rename bn_mp_prime_fermat.c => mp_prime_fermat.c (97%) rename bn_mp_prime_frobenius_underwood.c => mp_prime_frobenius_underwood.c (97%) rename bn_mp_prime_is_prime.c => mp_prime_is_prime.c (99%) rename bn_mp_prime_miller_rabin.c => mp_prime_miller_rabin.c (98%) rename bn_mp_prime_next_prime.c => mp_prime_next_prime.c (99%) rename bn_mp_prime_rabin_miller_trials.c => mp_prime_rabin_miller_trials.c (97%) rename bn_mp_prime_rand.c => mp_prime_rand.c (99%) rename bn_mp_prime_strong_lucas_selfridge.c => mp_prime_strong_lucas_selfridge.c (98%) rename bn_prime_tab.c => mp_prime_tab.c (99%) rename bn_mp_radix_size.c => mp_radix_size.c (96%) rename bn_mp_radix_smap.c => mp_radix_smap.c (97%) rename bn_mp_rand.c => mp_rand.c (98%) rename bn_mp_read_radix.c => mp_read_radix.c (98%) rename bn_mp_reduce.c => mp_reduce.c (98%) rename bn_mp_reduce_2k.c => mp_reduce_2k.c (97%) rename bn_mp_reduce_2k_l.c => mp_reduce_2k_l.c (97%) rename bn_mp_reduce_2k_setup.c => mp_reduce_2k_setup.c (95%) rename bn_mp_reduce_2k_setup_l.c => mp_reduce_2k_setup_l.c (94%) rename bn_mp_reduce_is_2k.c => mp_reduce_is_2k.c (96%) rename bn_mp_reduce_is_2k_l.c => mp_reduce_is_2k_l.c (95%) rename bn_mp_reduce_setup.c => mp_reduce_setup.c (94%) rename bn_mp_root_u32.c => mp_root_u32.c (99%) rename bn_mp_rshd.c => mp_rshd.c (98%) rename bn_mp_sbin_size.c => mp_sbin_size.c (91%) rename bn_mp_set.c => mp_set.c (94%) rename bn_mp_set_double.c => mp_set_double.c (97%) rename bn_mp_set_i32.c => mp_set_i32.c (89%) rename bn_mp_set_i64.c => mp_set_i64.c (89%) rename bn_mp_set_l.c => mp_set_l.c (90%) rename bn_mp_set_ll.c => mp_set_ll.c (90%) rename bn_mp_set_u32.c => mp_set_u32.c (88%) rename bn_mp_set_u64.c => mp_set_u64.c (88%) rename bn_mp_set_ul.c => mp_set_ul.c (89%) rename bn_mp_set_ull.c => mp_set_ull.c (89%) rename bn_mp_shrink.c => mp_shrink.c (96%) rename bn_mp_signed_rsh.c => mp_signed_rsh.c (95%) rename bn_mp_sqr.c => mp_sqr.c (97%) rename bn_mp_sqrmod.c => mp_sqrmod.c (95%) rename bn_mp_sqrt.c => mp_sqrt.c (98%) rename bn_mp_sqrtmod_prime.c => mp_sqrtmod_prime.c (99%) rename bn_mp_sub.c => mp_sub.c (98%) rename bn_mp_sub_d.c => mp_sub_d.c (98%) rename bn_mp_submod.c => mp_submod.c (95%) rename bn_mp_to_radix.c => mp_to_radix.c (98%) rename bn_mp_to_sbin.c => mp_to_sbin.c (96%) rename bn_mp_to_ubin.c => mp_to_ubin.c (97%) rename bn_mp_ubin_size.c => mp_ubin_size.c (93%) rename bn_mp_unpack.c => mp_unpack.c (98%) rename bn_mp_xor.c => mp_xor.c (98%) rename bn_mp_zero.c => mp_zero.c (93%) rename bn_s_mp_add.c => s_mp_add.c (98%) rename bn_s_mp_balance_mul.c => s_mp_balance_mul.c (98%) rename bn_s_mp_exptmod.c => s_mp_exptmod.c (99%) rename bn_s_mp_exptmod_fast.c => s_mp_exptmod_fast.c (99%) rename bn_s_mp_get_bit.c => s_mp_get_bit.c (95%) rename bn_s_mp_invmod_fast.c => s_mp_invmod_fast.c (99%) rename bn_s_mp_invmod_slow.c => s_mp_invmod_slow.c (99%) rename bn_s_mp_karatsuba_mul.c => s_mp_karatsuba_mul.c (99%) rename bn_s_mp_karatsuba_sqr.c => s_mp_karatsuba_sqr.c (98%) rename bn_s_mp_montgomery_reduce_fast.c => s_mp_montgomery_reduce_fast.c (99%) rename bn_s_mp_mul_digs.c => s_mp_mul_digs.c (98%) rename bn_s_mp_mul_digs_fast.c => s_mp_mul_digs_fast.c (98%) rename bn_s_mp_mul_high_digs.c => s_mp_mul_high_digs.c (98%) rename bn_s_mp_mul_high_digs_fast.c => s_mp_mul_high_digs_fast.c (98%) rename bn_s_mp_prime_is_divisible.c => s_mp_prime_is_divisible.c (95%) rename bn_s_mp_rand_jenkins.c => s_mp_rand_jenkins.c (97%) rename bn_s_mp_rand_platform.c => s_mp_rand_platform.c (92%) rename bn_s_mp_reverse.c => s_mp_reverse.c (94%) rename bn_s_mp_sqr.c => s_mp_sqr.c (98%) rename bn_s_mp_sqr_fast.c => s_mp_sqr_fast.c (98%) rename bn_s_mp_sub.c => s_mp_sub.c (98%) rename bn_s_mp_toom_mul.c => s_mp_toom_mul.c (99%) rename bn_s_mp_toom_sqr.c => s_mp_toom_sqr.c (99%) diff --git a/demo/test.c b/demo/test.c index 9002e96..acb81c5 100644 --- a/demo/test.c +++ b/demo/test.c @@ -62,25 +62,25 @@ void does_not_exist(void); static int test_feature_detection(void) { -#define BN_TEST_FEATURE1_C +#define TEST_FEATURE1_C if (!MP_HAS(TEST_FEATURE1)) { does_not_exist(); return EXIT_FAILURE; } -#define BN_TEST_FEATURE2_C 1 +#define TEST_FEATURE2_C 1 if (MP_HAS(TEST_FEATURE2)) { does_not_exist(); return EXIT_FAILURE; } -#define BN_TEST_FEATURE3_C 0 +#define TEST_FEATURE3_C 0 if (MP_HAS(TEST_FEATURE3)) { does_not_exist(); return EXIT_FAILURE; } -#define BN_TEST_FEATURE4_C something +#define TEST_FEATURE4_C something if (MP_HAS(TEST_FEATURE4)) { does_not_exist(); return EXIT_FAILURE; @@ -1254,30 +1254,30 @@ static int test_mp_read_radix(void) mp_err err; mp_int a; - if (mp_init_multi(&a, NULL)!= MP_OKAY) goto LTM_ERR; + if (mp_init_multi(&a, NULL)!= MP_OKAY) goto LBL_ERR; - if ((err = mp_read_radix(&a, "123456", 10)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_read_radix(&a, "123456", 10)) != MP_OKAY) goto LBL_ERR; - if ((err = mp_to_radix(&a, buf, SIZE_MAX, &written, 10)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_to_radix(&a, buf, SIZE_MAX, &written, 10)) != MP_OKAY) goto LBL_ERR; printf(" '123456' a == %s, length = %zu\n", buf, written); - /* See comment in bn_mp_to_radix.c */ + /* See comment in mp_to_radix.c */ /* - if( (err = mp_to_radix(&a, buf, 3u, &written, 10) ) != MP_OKAY) goto LTM_ERR; + if( (err = mp_to_radix(&a, buf, 3u, &written, 10) ) != MP_OKAY) goto LBL_ERR; printf(" '56' a == %s, length = %zu\n", buf, written); - if( (err = mp_to_radix(&a, buf, 4u, &written, 10) ) != MP_OKAY) goto LTM_ERR; + if( (err = mp_to_radix(&a, buf, 4u, &written, 10) ) != MP_OKAY) goto LBL_ERR; printf(" '456' a == %s, length = %zu\n", buf, written); - if( (err = mp_to_radix(&a, buf, 30u, &written, 10) ) != MP_OKAY) goto LTM_ERR; + if( (err = mp_to_radix(&a, buf, 30u, &written, 10) ) != MP_OKAY) goto LBL_ERR; printf(" '123456' a == %s, length = %zu, error = %s\n", buf, written, mp_error_to_string(err)); */ - if ((err = mp_read_radix(&a, "-123456", 10)) != MP_OKAY) goto LTM_ERR; - if ((err = mp_to_radix(&a, buf, SIZE_MAX, &written, 10)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_read_radix(&a, "-123456", 10)) != MP_OKAY) goto LBL_ERR; + if ((err = mp_to_radix(&a, buf, SIZE_MAX, &written, 10)) != MP_OKAY) goto LBL_ERR; printf(" '-123456' a == %s, length = %zu\n", buf, written); - if ((err = mp_read_radix(&a, "0", 10)) != MP_OKAY) goto LTM_ERR; - if ((err = mp_to_radix(&a, buf, SIZE_MAX, &written, 10)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_read_radix(&a, "0", 10)) != MP_OKAY) goto LBL_ERR; + if ((err = mp_to_radix(&a, buf, SIZE_MAX, &written, 10)) != MP_OKAY) goto LBL_ERR; printf(" '0' a == %s, length = %zu\n", buf, written); while (0) { @@ -1291,7 +1291,7 @@ static int test_mp_read_radix(void) mp_clear(&a); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear(&a); return EXIT_FAILURE; } @@ -1696,61 +1696,61 @@ static int test_mp_incr(void) mp_err e = MP_OKAY; if ((e = mp_init_multi(&a, &b, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } /* Does it increment inside the limits of a MP_xBIT limb? */ mp_set(&a, MP_MASK/2); if ((e = mp_incr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp_d(&a, (MP_MASK/2uL) + 1uL) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } /* Does it increment outside of the limits of a MP_xBIT limb? */ mp_set(&a, MP_MASK); mp_set(&b, MP_MASK); if ((e = mp_incr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_add_d(&b, 1uL, &b)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&a, &b) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } /* Does it increment from -1 to 0? */ mp_set(&a, 1uL); a.sign = MP_NEG; if ((e = mp_incr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp_d(&a, 0uL) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } /* Does it increment from -(MP_MASK + 1) to -MP_MASK? */ mp_set(&a, MP_MASK); if ((e = mp_add_d(&a, 1uL, &a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } a.sign = MP_NEG; if ((e = mp_incr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (a.sign != MP_NEG) { - goto LTM_ERR; + goto LBL_ERR; } a.sign = MP_ZPOS; if (mp_cmp_d(&a, MP_MASK) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } mp_clear_multi(&a, &b, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, NULL); return EXIT_FAILURE; } @@ -1761,42 +1761,42 @@ static int test_mp_decr(void) mp_err e = MP_OKAY; if ((e = mp_init_multi(&a, &b, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } /* Does it decrement inside the limits of a MP_xBIT limb? */ mp_set(&a, MP_MASK/2); if ((e = mp_decr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp_d(&a, (MP_MASK/2uL) - 1uL) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } /* Does it decrement outside of the limits of a MP_xBIT limb? */ mp_set(&a, MP_MASK); if ((e = mp_add_d(&a, 1uL, &a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_decr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp_d(&a, MP_MASK) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } /* Does it decrement from 0 to -1? */ mp_zero(&a); if ((e = mp_decr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (a.sign == MP_NEG) { a.sign = MP_ZPOS; if (mp_cmp_d(&a, 1uL) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } } else { - goto LTM_ERR; + goto LBL_ERR; } @@ -1806,18 +1806,18 @@ static int test_mp_decr(void) mp_set(&b, MP_MASK); b.sign = MP_NEG; if ((e = mp_sub_d(&b, 1uL, &b)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_decr(&a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&a, &b) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } mp_clear_multi(&a, &b, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, NULL); return EXIT_FAILURE; } @@ -2044,13 +2044,13 @@ static int test_mp_root_u32(void) mp_read_radix(&r, root[i][j-3], 10); if (mp_cmp(&r, &c) != MP_EQ) { fprintf(stderr, "mp_root_u32 failed at input #%d, root #%d\n", i, j); - goto LTM_ERR; + goto LBL_ERR; } } } mp_clear_multi(&a, &c, &r, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &c, &r, NULL); return EXIT_FAILURE; } @@ -2067,31 +2067,31 @@ static int test_s_mp_balance_mul(void) "HzrSq9WVt1jDTVlwUxSKqxctu2GVD+N8+SVGaPFRqdxyld6IxDBbj27BPJzYUdR96k3sWpkO8XnDBvupGPnehpQe4KlO/KmN1PjFov/UTZYM+LYzkFcBPyV6hkkL8ePC1rlFLAHzgJMBCXVp4mRqtkQrDsZXXlcqlbTFu69wF6zDEysiX2cAtn/kP9ldblJiwYPCD8hG"; if ((e = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_read_radix(&a, na, 64)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_read_radix(&b, nb, 64)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((e = s_mp_balance_mul(&a, &b, &c)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_read_radix(&b, nc, 64)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&b, &c) != MP_EQ) { - goto LTM_ERR; + goto LBL_ERR; } mp_clear_multi(&a, &b, &c, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, &c, NULL); return EXIT_FAILURE; } @@ -2103,30 +2103,30 @@ static int test_s_mp_karatsuba_mul(void) int size, err; if ((err = mp_init_multi(&a, &b, &c, &d, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } for (size = MP_KARATSUBA_MUL_CUTOFF; size < MP_KARATSUBA_MUL_CUTOFF + 20; size++) { if ((err = mp_rand(&a, size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_rand(&b, size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_karatsuba_mul(&a, &b, &c)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_mul(&a,&b,&d)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&c, &d) != MP_EQ) { fprintf(stderr, "Karatsuba multiplication failed at size %d\n", size); - goto LTM_ERR; + goto LBL_ERR; } } mp_clear_multi(&a, &b, &c, &d, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, &c, &d, NULL); return EXIT_FAILURE; } @@ -2137,27 +2137,27 @@ static int test_s_mp_karatsuba_sqr(void) int size, err; if ((err = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } for (size = MP_KARATSUBA_SQR_CUTOFF; size < MP_KARATSUBA_SQR_CUTOFF + 20; size++) { if ((err = mp_rand(&a, size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_karatsuba_sqr(&a, &b)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_sqr(&a, &c)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&b, &c) != MP_EQ) { fprintf(stderr, "Karatsuba squaring failed at size %d\n", size); - goto LTM_ERR; + goto LBL_ERR; } } mp_clear_multi(&a, &b, &c, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, &c, NULL); return EXIT_FAILURE; } @@ -2172,70 +2172,70 @@ static int test_s_mp_toom_mul(void) #endif if ((err = mp_init_multi(&a, &b, &c, &d, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } /* This number construction is limb-size specific */ #if (MP_DIGIT_BIT == 60) if ((err = mp_rand(&a, 1196)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_mul_2d(&a,71787 - mp_count_bits(&a), &a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_rand(&b, 1338)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_mul_2d(&b, 80318 - mp_count_bits(&b), &b)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_mul_2d(&b, 6310, &b)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_2expt(&c, 99000 - 1000)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_add(&b, &c, &b)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } tc_cutoff = TOOM_MUL_CUTOFF; TOOM_MUL_CUTOFF = INT_MAX; if ((err = mp_mul(&a, &b, &c)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } TOOM_MUL_CUTOFF = tc_cutoff; if ((err = mp_mul(&a, &b, &d)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&c, &d) != MP_EQ) { fprintf(stderr, "Toom-Cook 3-way multiplication failed for edgecase f1 * f2\n"); - goto LTM_ERR; + goto LBL_ERR; } #endif for (size = MP_TOOM_MUL_CUTOFF; size < MP_TOOM_MUL_CUTOFF + 20; size++) { if ((err = mp_rand(&a, size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_rand(&b, size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_toom_mul(&a, &b, &c)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_mul(&a,&b,&d)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&c, &d) != MP_EQ) { fprintf(stderr, "Toom-Cook 3-way multiplication failed at size %d\n", size); - goto LTM_ERR; + goto LBL_ERR; } } mp_clear_multi(&a, &b, &c, &d, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, &c, &d, NULL); return EXIT_FAILURE; } @@ -2246,27 +2246,27 @@ static int test_s_mp_toom_sqr(void) int size, err; if ((err = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } for (size = MP_TOOM_SQR_CUTOFF; size < MP_TOOM_SQR_CUTOFF + 20; size++) { if ((err = mp_rand(&a, size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_toom_sqr(&a, &b)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if ((err = s_mp_sqr(&a, &c)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&b, &c) != MP_EQ) { fprintf(stderr, "Toom-Cook 3-way squaring failed at size %d\n", size); - goto LTM_ERR; + goto LBL_ERR; } } mp_clear_multi(&a, &b, &c, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, &c, NULL); return EXIT_FAILURE; } @@ -2294,33 +2294,33 @@ static int test_mp_radix_size(void) /* number to result in a different size for every base: 67^(4 * 67) */ mp_set(&a, 67); if ((err = mp_expt_u32(&a, 268u, &a)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } for (radix = 2; radix < 65; radix++) { if ((err = mp_radix_size(&a, radix, &size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (size != results[radix]) { fprintf(stderr, "mp_radix_size: result for base %d was %d instead of %d\n", radix, size, results[radix]); - goto LTM_ERR; + goto LBL_ERR; } a.sign = MP_NEG; if ((err = mp_radix_size(&a, radix, &size)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } if (size != (results[radix] + 1)) { fprintf(stderr, "mp_radix_size: result for base %d was %d instead of %d\n", radix, size, results[radix]); - goto LTM_ERR; + goto LBL_ERR; } a.sign = MP_ZPOS; } mp_clear(&a); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: mp_clear(&a); return EXIT_FAILURE; } @@ -2335,11 +2335,11 @@ static int test_mp_read_write_ubin(void) unsigned char *buf = NULL; if ((err = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } - if ((err = mp_rand(&a, 15)) != MP_OKAY) goto LTM_ERR; - if ((err = mp_neg(&a, &b)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_rand(&a, 15)) != MP_OKAY) goto LBL_ERR; + if ((err = mp_neg(&a, &b)) != MP_OKAY) goto LBL_ERR; size = mp_ubin_size(&a); printf("mp_to_ubin_size %zu\n", size); @@ -2347,22 +2347,22 @@ static int test_mp_read_write_ubin(void) if (buf == NULL) { fprintf(stderr, "test_read_write_binaries (u) failed to allocate %zu bytes\n", sizeof(*buf) * size); - goto LTM_ERR; + goto LBL_ERR; } - if ((err = mp_to_ubin(&a, buf, size, &len)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_to_ubin(&a, buf, size, &len)) != MP_OKAY) goto LBL_ERR; printf("mp_to_ubin len = %zu\n", len); - if ((err = mp_from_ubin(&c, buf, len)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_from_ubin(&c, buf, len)) != MP_OKAY) goto LBL_ERR; if (mp_cmp(&a, &c) != MP_EQ) { fprintf(stderr, "to/from ubin cycle failed\n"); - goto LTM_ERR; + goto LBL_ERR; } free(buf); mp_clear_multi(&a, &b, &c, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: free(buf); mp_clear_multi(&a, &b, &c, NULL); return EXIT_FAILURE; @@ -2376,11 +2376,11 @@ static int test_mp_read_write_sbin(void) unsigned char *buf = NULL; if ((err = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) { - goto LTM_ERR; + goto LBL_ERR; } - if ((err = mp_rand(&a, 15)) != MP_OKAY) goto LTM_ERR; - if ((err = mp_neg(&a, &b)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_rand(&a, 15)) != MP_OKAY) goto LBL_ERR; + if ((err = mp_neg(&a, &b)) != MP_OKAY) goto LBL_ERR; size = mp_sbin_size(&a); printf("mp_to_sbin_size %zu\n", size); @@ -2388,23 +2388,23 @@ static int test_mp_read_write_sbin(void) if (buf == NULL) { fprintf(stderr, "test_read_write_binaries (s) failed to allocate %zu bytes\n", sizeof(*buf) * size); - goto LTM_ERR; + goto LBL_ERR; } - if ((err = mp_to_sbin(&b, buf, size, &len)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_to_sbin(&b, buf, size, &len)) != MP_OKAY) goto LBL_ERR; printf("mp_to_sbin len = %zu\n", len); - if ((err = mp_from_sbin(&c, buf, len)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_from_sbin(&c, buf, len)) != MP_OKAY) goto LBL_ERR; if (mp_cmp(&b, &c) != MP_EQ) { fprintf(stderr, "to/from ubin cycle failed\n"); - goto LTM_ERR; + goto LBL_ERR; } free(buf); mp_clear_multi(&a, &b, &c, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: free(buf); mp_clear_multi(&a, &b, &c, NULL); return EXIT_FAILURE; @@ -2420,31 +2420,31 @@ static int test_mp_pack_unpack(void) mp_order order = MP_LSB_FIRST; mp_endian endianess = MP_NATIVE_ENDIAN; - if ((err = mp_init_multi(&a, &b, NULL)) != MP_OKAY) goto LTM_ERR; - if ((err = mp_rand(&a, 15)) != MP_OKAY) goto LTM_ERR; + if ((err = mp_init_multi(&a, &b, NULL)) != MP_OKAY) goto LBL_ERR; + if ((err = mp_rand(&a, 15)) != MP_OKAY) goto LBL_ERR; count = mp_pack_count(&a, 0, 1); buf = malloc(count); if (buf == NULL) { fprintf(stderr, "test_pack_unpack failed to allocate\n"); - goto LTM_ERR; + goto LBL_ERR; } if ((err = mp_pack((void *)buf, count, &written, order, 1, - endianess, 0, &a)) != MP_OKAY) goto LTM_ERR; + endianess, 0, &a)) != MP_OKAY) goto LBL_ERR; if ((err = mp_unpack(&b, count, order, 1, - endianess, 0, (const void *)buf)) != MP_OKAY) goto LTM_ERR; + endianess, 0, (const void *)buf)) != MP_OKAY) goto LBL_ERR; if (mp_cmp(&a, &b) != MP_EQ) { fprintf(stderr, "pack/unpack cycle failed\n"); - goto LTM_ERR; + goto LBL_ERR; } free(buf); mp_clear_multi(&a, &b, NULL); return EXIT_SUCCESS; -LTM_ERR: +LBL_ERR: free(buf); mp_clear_multi(&a, &b, NULL); return EXIT_FAILURE; diff --git a/doc/bn.tex b/doc/bn.tex index 27f27e7..fe6b5c6 100644 --- a/doc/bn.tex +++ b/doc/bn.tex @@ -174,11 +174,11 @@ The wrong \texttt{libtool} will build it all fine but when it comes to the final cc -I./ -Wall -Wsign-compare -Wextra -Wshadow -Wsystem-headers -Wdeclaration-afo... cc -I./ -Wall -Wsign-compare -Wextra -Wshadow -Wsystem-headers -Wdeclaration-afo... cc -I./ -Wall -Wsign-compare -Wextra -Wshadow -Wsystem-headers -Wdeclaration-afo... -libtool --mode=link --tag=CC cc bn_error.lo bn_s_mp_invmod_fast.lo bn_fast_mp_mo -libtool: link: cc bn_error.lo bn_s_mp_invmod_fast.lo bn_s_mp_montgomery_reduce_fast0 -bn_error.lo: file not recognized: File format not recognized +libtool --mode=link --tag=CC cc error.lo s_mp_invmod_fast.lo fast_mp_mo +libtool: link: cc error.lo s_mp_invmod_fast.lo s_mp_montgomery_reduce_fast0 +error.lo: file not recognized: File format not recognized cc: error: linker command failed with exit code 1 (use -v to see invocation) -Error while executing cc bn_error.lo bn_s_mp_invmod_fast.lo bn_fast_mp_montgomery0 +Error while executing cc error.lo s_mp_invmod_fast.lo fast_mp_montgomery0 gmake: *** [makefile.shared:64: libtommath.la] Error 1 \end{alltt} @@ -259,7 +259,7 @@ classes can be defined base on the need of the user. \subsection{Build Depends} In the file tommath\_class.h you will see a large list of C ``defines'' followed by a series of ``ifdefs'' which further define symbols. All of the symbols (technically they're macros $\ldots$) represent a given C source -file. For instance, BN\_MP\_ADD\_C represents the file ``bn\_mp\_add.c''. When a define has been enabled the +file. For instance, MP\_ADD\_C represents the file ``bn\_mp\_add.c''. When a define has been enabled the function in the respective file will be compiled and linked into the library. Accordingly when the define is absent the file will not be compiled and not contribute any size to the library. @@ -275,7 +275,7 @@ They can be enabled at any pass of the configuration phase. \begin{center} \begin{tabular}{|l|l|} \hline \textbf{Define} & \textbf{Purpose} \\ -\hline BN\_MP\_DIV\_SMALL & Enables a slower, smaller and equally \\ +\hline MP\_DIV\_SMALL & Enables a slower, smaller and equally \\ & functional mp\_div() function \\ \hline \end{tabular} @@ -293,20 +293,20 @@ only if LTM\_LAST has been defined. \begin{center} \begin{tabular}{|l|l|} \hline \textbf{Restriction} & \textbf{Undefine} \\ -\hline Exponentiation with odd moduli only & BN\_S\_MP\_EXPTMOD\_C \\ - & BN\_MP\_REDUCE\_C \\ - & BN\_MP\_REDUCE\_SETUP\_C \\ - & BN\_S\_MP\_MUL\_HIGH\_DIGS\_C \\ - & BN\_FAST\_S\_MP\_MUL\_HIGH\_DIGS\_C \\ +\hline Exponentiation with odd moduli only & S\_MP\_EXPTMOD\_C \\ + & MP\_REDUCE\_C \\ + & MP\_REDUCE\_SETUP\_C \\ + & S\_MP\_MUL\_HIGH\_DIGS\_C \\ + & FAST\_S\_MP\_MUL\_HIGH\_DIGS\_C \\ \hline Exponentiation with random odd moduli & (The above plus the following) \\ - & BN\_MP\_REDUCE\_2K\_C \\ - & BN\_MP\_REDUCE\_2K\_SETUP\_C \\ - & BN\_MP\_REDUCE\_IS\_2K\_C \\ - & BN\_MP\_DR\_IS\_MODULUS\_C \\ - & BN\_MP\_DR\_REDUCE\_C \\ - & BN\_MP\_DR\_SETUP\_C \\ -\hline Modular inverse odd moduli only & BN\_MP\_INVMOD\_SLOW\_C \\ -\hline Modular inverse (both, smaller/slower) & BN\_FAST\_MP\_INVMOD\_C \\ + & MP\_REDUCE\_2K\_C \\ + & MP\_REDUCE\_2K\_SETUP\_C \\ + & MP\_REDUCE\_IS\_2K\_C \\ + & MP\_DR\_IS\_MODULUS\_C \\ + & MP\_DR\_REDUCE\_C \\ + & MP\_DR\_SETUP\_C \\ +\hline Modular inverse odd moduli only & MP\_INVMOD\_SLOW\_C \\ +\hline Modular inverse (both, smaller/slower) & FAST\_MP\_INVMOD\_C \\ \hline \end{tabular} \end{center} @@ -317,14 +317,14 @@ only if LTM\_LAST has been defined. \begin{center} \begin{tabular}{|l|l|} \hline \textbf{Restriction} & \textbf{Undefine} \\ -\hline Moduli $\le 2560$ bits & BN\_MP\_MONTGOMERY\_REDUCE\_C \\ - & BN\_S\_MP\_MUL\_DIGS\_C \\ - & BN\_S\_MP\_MUL\_HIGH\_DIGS\_C \\ - & BN\_S\_MP\_SQR\_C \\ -\hline Polynomial Schmolynomial & BN\_MP\_KARATSUBA\_MUL\_C \\ - & BN\_MP\_KARATSUBA\_SQR\_C \\ - & BN\_MP\_TOOM\_MUL\_C \\ - & BN\_MP\_TOOM\_SQR\_C \\ +\hline Moduli $\le 2560$ bits & MP\_MONTGOMERY\_REDUCE\_C \\ + & S\_MP\_MUL\_DIGS\_C \\ + & S\_MP\_MUL\_HIGH\_DIGS\_C \\ + & S\_MP\_SQR\_C \\ +\hline Polynomial Schmolynomial & MP\_KARATSUBA\_MUL\_C \\ + & MP\_KARATSUBA\_SQR\_C \\ + & MP\_TOOM\_MUL\_C \\ + & MP\_TOOM\_SQR\_C \\ \hline \end{tabular} diff --git a/etc/tune.c b/etc/tune.c index 057e372..389ce2f 100644 --- a/etc/tune.c +++ b/etc/tune.c @@ -67,39 +67,39 @@ static uint64_t s_time_mul(int size) if ((e = mp_init_multi(&a, &b, &c, &d, NULL)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_rand(&a, size * s_offset)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_rand(&b, size)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } s_timer_start(); for (x = 0; x < s_number_of_test_loops; x++) { if ((e = mp_mul(&a,&b,&c)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } if (s_check_result == 1) { if ((e = s_mp_mul(&a,&b,&d)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&c, &d) != MP_EQ) { /* Time of 0 cannot happen (famous last words?) */ t1 = 0uLL; - goto LTM_ERR; + goto LBL_ERR; } } } t1 = s_timer_stop(); -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, &c, &d, NULL); return t1; } @@ -112,34 +112,34 @@ static uint64_t s_time_sqr(int size) if ((e = mp_init_multi(&a, &b, &c, NULL)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } if ((e = mp_rand(&a, size)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } s_timer_start(); for (x = 0; x < s_number_of_test_loops; x++) { if ((e = mp_sqr(&a,&b)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } if (s_check_result == 1) { if ((e = s_mp_sqr(&a,&c)) != MP_OKAY) { t1 = UINT64_MAX; - goto LTM_ERR; + goto LBL_ERR; } if (mp_cmp(&c, &b) != MP_EQ) { t1 = 0uLL; - goto LTM_ERR; + goto LBL_ERR; } } } t1 = s_timer_stop(); -LTM_ERR: +LBL_ERR: mp_clear_multi(&a, &b, &c, NULL); return t1; } diff --git a/gen.pl b/gen.pl index 332994d..4db24b5 100644 --- a/gen.pl +++ b/gen.pl @@ -7,7 +7,7 @@ use strict; use warnings; open(my $out, '>', 'mpi.c') or die "Couldn't open mpi.c for writing: $!"; -foreach my $filename (glob 'bn*.c') { +foreach my $filename (glob '*mp_*.c') { open(my $src, '<', $filename) or die "Couldn't open $filename for reading: $!"; print {$out} "/* Start: $filename */\n"; print {$out} $_ while <$src>; diff --git a/helper.pl b/helper.pl index 03b081c..a519619 100755 --- a/helper.pl +++ b/helper.pl @@ -270,7 +270,7 @@ sub draw_func my ($deplist, $depmap, $out, $indent, $funcslist) = @_; my @funcs = split ',', $funcslist; # try this if you want to have a look at a minimized version of the callgraph without all the trivial functions - #if ($deplist =~ /$funcs[0]/ || $funcs[0] =~ /BN_MP_(ADD|SUB|CLEAR|CLEAR_\S+|DIV|MUL|COPY|ZERO|GROW|CLAMP|INIT|INIT_\S+|SET|ABS|CMP|CMP_D|EXCH)_C/) { + #if ($deplist =~ /$funcs[0]/ || $funcs[0] =~ /MP_(ADD|SUB|CLEAR|CLEAR_\S+|DIV|MUL|COPY|ZERO|GROW|CLAMP|INIT|INIT_\S+|SET|ABS|CMP|CMP_D|EXCH)_C/) { if ($deplist =~ /$funcs[0]/) { return $deplist; } else { @@ -309,7 +309,7 @@ sub update_dep #if defined(LTM_ALL) EOS - foreach my $filename (glob 'bn*.c') { + foreach my $filename (glob '*mp_*.c') { my $define = $filename; print "Processing $filename\n"; @@ -356,7 +356,7 @@ EOS # now do classes my %depmap; - foreach my $filename (glob 'bn*.c') { + foreach my $filename (glob '*mp_*.c') { my $content; my $cc = $ENV{'CC'} || 'gcc'; $content = `$cc -E -x c -DLTM_ALL $filename`; @@ -379,7 +379,7 @@ EOS my $a = $&; next if $a eq "mp_err"; $a =~ tr/[a-z]/[A-Z]/; - $a = 'BN_' . $a . '_C'; + $a = $a . '_C'; push @deps, $a; } } diff --git a/libtommath_VS2008.vcproj b/libtommath_VS2008.vcproj index 7e51929..ccbd1cc 100644 --- a/libtommath_VS2008.vcproj +++ b/libtommath_VS2008.vcproj @@ -313,627 +313,627 @@ is not affected -* git log --follow can be used to show log across renames' - -./helper.pl -a diff --git a/bn_mp_2expt.c b/mp_2expt.c similarity index 97% rename from bn_mp_2expt.c rename to mp_2expt.c index 0ae3df1..66e8574 100644 --- a/bn_mp_2expt.c +++ b/mp_2expt.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_2EXPT_C +#ifdef MP_2EXPT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_abs.c b/mp_abs.c similarity index 96% rename from bn_mp_abs.c rename to mp_abs.c index 00900bb..4ad1a4a 100644 --- a/bn_mp_abs.c +++ b/mp_abs.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ABS_C +#ifdef MP_ABS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_add.c b/mp_add.c similarity index 98% rename from bn_mp_add.c rename to mp_add.c index dfa78de..c78614b 100644 --- a/bn_mp_add.c +++ b/mp_add.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ADD_C +#ifdef MP_ADD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_add_d.c b/mp_add_d.c similarity index 98% rename from bn_mp_add_d.c rename to mp_add_d.c index f301575..07242c6 100644 --- a/bn_mp_add_d.c +++ b/mp_add_d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ADD_D_C +#ifdef MP_ADD_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_addmod.c b/mp_addmod.c similarity index 95% rename from bn_mp_addmod.c rename to mp_addmod.c index 1dcfb67..beda872 100644 --- a/bn_mp_addmod.c +++ b/mp_addmod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ADDMOD_C +#ifdef MP_ADDMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_and.c b/mp_and.c similarity index 98% rename from bn_mp_and.c rename to mp_and.c index c259f8d..92e6aed 100644 --- a/bn_mp_and.c +++ b/mp_and.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_AND_C +#ifdef MP_AND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_clamp.c b/mp_clamp.c similarity index 96% rename from bn_mp_clamp.c rename to mp_clamp.c index ac23bfd..14c1814 100644 --- a/bn_mp_clamp.c +++ b/mp_clamp.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_CLAMP_C +#ifdef MP_CLAMP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_clear.c b/mp_clear.c similarity index 95% rename from bn_mp_clear.c rename to mp_clear.c index ff78324..55d76b2 100644 --- a/bn_mp_clear.c +++ b/mp_clear.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_CLEAR_C +#ifdef MP_CLEAR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_clear_multi.c b/mp_clear_multi.c similarity index 93% rename from bn_mp_clear_multi.c rename to mp_clear_multi.c index 794e45f..74406c7 100644 --- a/bn_mp_clear_multi.c +++ b/mp_clear_multi.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_CLEAR_MULTI_C +#ifdef MP_CLEAR_MULTI_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_cmp.c b/mp_cmp.c similarity index 96% rename from bn_mp_cmp.c rename to mp_cmp.c index ced4840..a9bd910 100644 --- a/bn_mp_cmp.c +++ b/mp_cmp.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_CMP_C +#ifdef MP_CMP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_cmp_d.c b/mp_cmp_d.c similarity index 96% rename from bn_mp_cmp_d.c rename to mp_cmp_d.c index 5a8337b..03d8e2c 100644 --- a/bn_mp_cmp_d.c +++ b/mp_cmp_d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_CMP_D_C +#ifdef MP_CMP_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_cmp_mag.c b/mp_cmp_mag.c similarity index 97% rename from bn_mp_cmp_mag.c rename to mp_cmp_mag.c index f144ea9..b3a7b04 100644 --- a/bn_mp_cmp_mag.c +++ b/mp_cmp_mag.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_CMP_MAG_C +#ifdef MP_CMP_MAG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_cnt_lsb.c b/mp_cnt_lsb.c similarity index 97% rename from bn_mp_cnt_lsb.c rename to mp_cnt_lsb.c index 4b2d206..a2cd5f8 100644 --- a/bn_mp_cnt_lsb.c +++ b/mp_cnt_lsb.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_CNT_LSB_C +#ifdef MP_CNT_LSB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_complement.c b/mp_complement.c similarity index 92% rename from bn_mp_complement.c rename to mp_complement.c index fef1423..ad6bed3 100644 --- a/bn_mp_complement.c +++ b/mp_complement.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_COMPLEMENT_C +#ifdef MP_COMPLEMENT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_copy.c b/mp_copy.c similarity index 97% rename from bn_mp_copy.c rename to mp_copy.c index e72fcf6..a7ac34a 100644 --- a/bn_mp_copy.c +++ b/mp_copy.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_COPY_C +#ifdef MP_COPY_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_count_bits.c b/mp_count_bits.c similarity index 95% rename from bn_mp_count_bits.c rename to mp_count_bits.c index b7c2cad..76257c8 100644 --- a/bn_mp_count_bits.c +++ b/mp_count_bits.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_COUNT_BITS_C +#ifdef MP_COUNT_BITS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_cutoffs.c b/mp_cutoffs.c similarity index 95% rename from bn_cutoffs.c rename to mp_cutoffs.c index b02ab71..5593b55 100644 --- a/bn_cutoffs.c +++ b/mp_cutoffs.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_CUTOFFS_C +#ifdef MP_CUTOFFS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_decr.c b/mp_decr.c similarity index 97% rename from bn_mp_decr.c rename to mp_decr.c index c6a1572..55516cf 100644 --- a/bn_mp_decr.c +++ b/mp_decr.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DECR_C +#ifdef MP_DECR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_div.c b/mp_div.c similarity index 99% rename from bn_mp_div.c rename to mp_div.c index 71de55b..1c87005 100644 --- a/bn_mp_div.c +++ b/mp_div.c @@ -1,9 +1,9 @@ #include "tommath_private.h" -#ifdef BN_MP_DIV_C +#ifdef MP_DIV_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ -#ifdef BN_MP_DIV_SMALL +#ifdef MP_DIV_SMALL /* slower bit-bang division... also smaller */ mp_err mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d) diff --git a/bn_mp_div_2.c b/mp_div_2.c similarity index 97% rename from bn_mp_div_2.c rename to mp_div_2.c index f56ea81..60bd63d 100644 --- a/bn_mp_div_2.c +++ b/mp_div_2.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DIV_2_C +#ifdef MP_DIV_2_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_div_2d.c b/mp_div_2d.c similarity index 98% rename from bn_mp_div_2d.c rename to mp_div_2d.c index c47d5ce..9b396ac 100644 --- a/bn_mp_div_2d.c +++ b/mp_div_2d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DIV_2D_C +#ifdef MP_DIV_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_div_3.c b/mp_div_3.c similarity index 98% rename from bn_mp_div_3.c rename to mp_div_3.c index 3a23fdf..5789b2d 100644 --- a/bn_mp_div_3.c +++ b/mp_div_3.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DIV_3_C +#ifdef MP_DIV_3_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_div_d.c b/mp_div_d.c similarity index 98% rename from bn_mp_div_d.c rename to mp_div_d.c index b9d718b..331b285 100644 --- a/bn_mp_div_d.c +++ b/mp_div_d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DIV_D_C +#ifdef MP_DIV_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_dr_is_modulus.c b/mp_dr_is_modulus.c similarity index 95% rename from bn_mp_dr_is_modulus.c rename to mp_dr_is_modulus.c index 83760ea..eed5e5f 100644 --- a/bn_mp_dr_is_modulus.c +++ b/mp_dr_is_modulus.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DR_IS_MODULUS_C +#ifdef MP_DR_IS_MODULUS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_dr_reduce.c b/mp_dr_reduce.c similarity index 98% rename from bn_mp_dr_reduce.c rename to mp_dr_reduce.c index ffc33a6..fba0e21 100644 --- a/bn_mp_dr_reduce.c +++ b/mp_dr_reduce.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DR_REDUCE_C +#ifdef MP_DR_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_dr_setup.c b/mp_dr_setup.c similarity index 94% rename from bn_mp_dr_setup.c rename to mp_dr_setup.c index 32d5f38..c5bb359 100644 --- a/bn_mp_dr_setup.c +++ b/mp_dr_setup.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_DR_SETUP_C +#ifdef MP_DR_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_error_to_string.c b/mp_error_to_string.c similarity index 94% rename from bn_mp_error_to_string.c rename to mp_error_to_string.c index e936ec1..a6f6fc7 100644 --- a/bn_mp_error_to_string.c +++ b/mp_error_to_string.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ERROR_TO_STRING_C +#ifdef MP_ERROR_TO_STRING_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_exch.c b/mp_exch.c similarity index 94% rename from bn_mp_exch.c rename to mp_exch.c index 552094c..7bc4ee7 100644 --- a/bn_mp_exch.c +++ b/mp_exch.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_EXCH_C +#ifdef MP_EXCH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_expt_u32.c b/mp_expt_u32.c similarity index 97% rename from bn_mp_expt_u32.c rename to mp_expt_u32.c index 2ab67ba..a580fbf 100644 --- a/bn_mp_expt_u32.c +++ b/mp_expt_u32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_EXPT_U32_C +#ifdef MP_EXPT_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_exptmod.c b/mp_exptmod.c similarity index 98% rename from bn_mp_exptmod.c rename to mp_exptmod.c index 5f811eb..fcc894b 100644 --- a/bn_mp_exptmod.c +++ b/mp_exptmod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_EXPTMOD_C +#ifdef MP_EXPTMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_exteuclid.c b/mp_exteuclid.c similarity index 99% rename from bn_mp_exteuclid.c rename to mp_exteuclid.c index faf47ba..5b850da 100644 --- a/bn_mp_exteuclid.c +++ b/mp_exteuclid.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_EXTEUCLID_C +#ifdef MP_EXTEUCLID_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_fread.c b/mp_fread.c similarity index 98% rename from bn_mp_fread.c rename to mp_fread.c index 1e5ecf7..34dd1e7 100644 --- a/bn_mp_fread.c +++ b/mp_fread.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_FREAD_C +#ifdef MP_FREAD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_from_sbin.c b/mp_from_sbin.c similarity index 96% rename from bn_mp_from_sbin.c rename to mp_from_sbin.c index 20e4597..4335d88 100644 --- a/bn_mp_from_sbin.c +++ b/mp_from_sbin.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_FROM_SBIN_C +#ifdef MP_FROM_SBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_from_ubin.c b/mp_from_ubin.c similarity index 96% rename from bn_mp_from_ubin.c rename to mp_from_ubin.c index f6d6e2a..315ff08 100644 --- a/bn_mp_from_ubin.c +++ b/mp_from_ubin.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_FROM_UBIN_C +#ifdef MP_FROM_UBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_fwrite.c b/mp_fwrite.c similarity index 97% rename from bn_mp_fwrite.c rename to mp_fwrite.c index abe2e67..f9d3ab0 100644 --- a/bn_mp_fwrite.c +++ b/mp_fwrite.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_FWRITE_C +#ifdef MP_FWRITE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_gcd.c b/mp_gcd.c similarity index 99% rename from bn_mp_gcd.c rename to mp_gcd.c index 53029ba..79b6749 100644 --- a/bn_mp_gcd.c +++ b/mp_gcd.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GCD_C +#ifdef MP_GCD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_double.c b/mp_get_double.c similarity index 94% rename from bn_mp_get_double.c rename to mp_get_double.c index c9b1b19..122b71b 100644 --- a/bn_mp_get_double.c +++ b/mp_get_double.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_DOUBLE_C +#ifdef MP_GET_DOUBLE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_i32.c b/mp_get_i32.c similarity index 90% rename from bn_mp_get_i32.c rename to mp_get_i32.c index 030b657..6b3b6ad 100644 --- a/bn_mp_get_i32.c +++ b/mp_get_i32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_I32_C +#ifdef MP_GET_I32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_i64.c b/mp_get_i64.c similarity index 90% rename from bn_mp_get_i64.c rename to mp_get_i64.c index 969c8d2..8d38a1f 100644 --- a/bn_mp_get_i64.c +++ b/mp_get_i64.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_I64_C +#ifdef MP_GET_I64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_l.c b/mp_get_l.c similarity index 90% rename from bn_mp_get_l.c rename to mp_get_l.c index 55d78ec..3a1a2f7 100644 --- a/bn_mp_get_l.c +++ b/mp_get_l.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_L_C +#ifdef MP_GET_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_ll.c b/mp_get_ll.c similarity index 90% rename from bn_mp_get_ll.c rename to mp_get_ll.c index 2687534..d31457d 100644 --- a/bn_mp_get_ll.c +++ b/mp_get_ll.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_LL_C +#ifdef MP_GET_LL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_mag_u32.c b/mp_get_mag_u32.c similarity index 87% rename from bn_mp_get_mag_u32.c rename to mp_get_mag_u32.c index d77189b..acddc58 100644 --- a/bn_mp_get_mag_u32.c +++ b/mp_get_mag_u32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_MAG_U32_C +#ifdef MP_GET_MAG_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_mag_u64.c b/mp_get_mag_u64.c similarity index 87% rename from bn_mp_get_mag_u64.c rename to mp_get_mag_u64.c index 36dd73f..f754639 100644 --- a/bn_mp_get_mag_u64.c +++ b/mp_get_mag_u64.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_MAG_U64_C +#ifdef MP_GET_MAG_U64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_mag_ul.c b/mp_get_mag_ul.c similarity index 87% rename from bn_mp_get_mag_ul.c rename to mp_get_mag_ul.c index e8819ae..5c60430 100644 --- a/bn_mp_get_mag_ul.c +++ b/mp_get_mag_ul.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_MAG_UL_C +#ifdef MP_GET_MAG_UL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_get_mag_ull.c b/mp_get_mag_ull.c similarity index 87% rename from bn_mp_get_mag_ull.c rename to mp_get_mag_ull.c index 63a2741..fea1ab1 100644 --- a/bn_mp_get_mag_ull.c +++ b/mp_get_mag_ull.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GET_MAG_ULL_C +#ifdef MP_GET_MAG_ULL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_grow.c b/mp_grow.c similarity index 98% rename from bn_mp_grow.c rename to mp_grow.c index 9e904c5..3354e59 100644 --- a/bn_mp_grow.c +++ b/mp_grow.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_GROW_C +#ifdef MP_GROW_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_incr.c b/mp_incr.c similarity index 97% rename from bn_mp_incr.c rename to mp_incr.c index 7695ac7..12dc20b 100644 --- a/bn_mp_incr.c +++ b/mp_incr.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INCR_C +#ifdef MP_INCR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init.c b/mp_init.c similarity index 96% rename from bn_mp_init.c rename to mp_init.c index 2eb7924..9b82282 100644 --- a/bn_mp_init.c +++ b/mp_init.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_C +#ifdef MP_INIT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_copy.c b/mp_init_copy.c similarity index 94% rename from bn_mp_init_copy.c rename to mp_init_copy.c index 1888203..4d0773b 100644 --- a/bn_mp_init_copy.c +++ b/mp_init_copy.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_COPY_C +#ifdef MP_INIT_COPY_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_i32.c b/mp_init_i32.c similarity index 88% rename from bn_mp_init_i32.c rename to mp_init_i32.c index bc4de8d..434788f 100644 --- a/bn_mp_init_i32.c +++ b/mp_init_i32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_I32_C +#ifdef MP_INIT_I32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_i64.c b/mp_init_i64.c similarity index 88% rename from bn_mp_init_i64.c rename to mp_init_i64.c index 2fa1516..7185678 100644 --- a/bn_mp_init_i64.c +++ b/mp_init_i64.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_I64_C +#ifdef MP_INIT_I64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_l.c b/mp_init_l.c similarity index 89% rename from bn_mp_init_l.c rename to mp_init_l.c index bc380b5..16be8f6 100644 --- a/bn_mp_init_l.c +++ b/mp_init_l.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_L_C +#ifdef MP_INIT_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_ll.c b/mp_init_ll.c similarity index 89% rename from bn_mp_init_ll.c rename to mp_init_ll.c index dc7c4a4..d8b44a6 100644 --- a/bn_mp_init_ll.c +++ b/mp_init_ll.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_LL_C +#ifdef MP_INIT_LL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_multi.c b/mp_init_multi.c similarity index 97% rename from bn_mp_init_multi.c rename to mp_init_multi.c index d8390b5..6567cf1 100644 --- a/bn_mp_init_multi.c +++ b/mp_init_multi.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_MULTI_C +#ifdef MP_INIT_MULTI_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_set.c b/mp_init_set.c similarity index 93% rename from bn_mp_init_set.c rename to mp_init_set.c index 5068f2b..e1f2ee9 100644 --- a/bn_mp_init_set.c +++ b/mp_init_set.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_SET_C +#ifdef MP_INIT_SET_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_size.c b/mp_init_size.c similarity index 95% rename from bn_mp_init_size.c rename to mp_init_size.c index d622687..9aa98b9 100644 --- a/bn_mp_init_size.c +++ b/mp_init_size.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_SIZE_C +#ifdef MP_INIT_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_u32.c b/mp_init_u32.c similarity index 88% rename from bn_mp_init_u32.c rename to mp_init_u32.c index 015d89b..d5a2b8f 100644 --- a/bn_mp_init_u32.c +++ b/mp_init_u32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_U32_C +#ifdef MP_INIT_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_u64.c b/mp_init_u64.c similarity index 88% rename from bn_mp_init_u64.c rename to mp_init_u64.c index 2b35f7e..ca75084 100644 --- a/bn_mp_init_u64.c +++ b/mp_init_u64.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_U64_C +#ifdef MP_INIT_U64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_ul.c b/mp_init_ul.c similarity index 89% rename from bn_mp_init_ul.c rename to mp_init_ul.c index 5164f72..21ca3be 100644 --- a/bn_mp_init_ul.c +++ b/mp_init_ul.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_UL_C +#ifdef MP_INIT_UL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_init_ull.c b/mp_init_ull.c similarity index 89% rename from bn_mp_init_ull.c rename to mp_init_ull.c index 84110c0..ef66c6a 100644 --- a/bn_mp_init_ull.c +++ b/mp_init_ull.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INIT_ULL_C +#ifdef MP_INIT_ULL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_invmod.c b/mp_invmod.c similarity index 96% rename from bn_mp_invmod.c rename to mp_invmod.c index 7b35a24..b797d4e 100644 --- a/bn_mp_invmod.c +++ b/mp_invmod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_INVMOD_C +#ifdef MP_INVMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_is_square.c b/mp_is_square.c similarity index 99% rename from bn_mp_is_square.c rename to mp_is_square.c index 69e77a2..c2428f8 100644 --- a/bn_mp_is_square.c +++ b/mp_is_square.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_IS_SQUARE_C +#ifdef MP_IS_SQUARE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_iseven.c b/mp_iseven.c similarity index 91% rename from bn_mp_iseven.c rename to mp_iseven.c index 5cb9622..4ebc9af 100644 --- a/bn_mp_iseven.c +++ b/mp_iseven.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ISEVEN_C +#ifdef MP_ISEVEN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_isodd.c b/mp_isodd.c similarity index 91% rename from bn_mp_isodd.c rename to mp_isodd.c index bf17646..f8a3e0e 100644 --- a/bn_mp_isodd.c +++ b/mp_isodd.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ISODD_C +#ifdef MP_ISODD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_kronecker.c b/mp_kronecker.c similarity index 99% rename from bn_mp_kronecker.c rename to mp_kronecker.c index 525a820..3111a78 100644 --- a/bn_mp_kronecker.c +++ b/mp_kronecker.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_KRONECKER_C +#ifdef MP_KRONECKER_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_lcm.c b/mp_lcm.c similarity index 98% rename from bn_mp_lcm.c rename to mp_lcm.c index c32b269..f2044f0 100644 --- a/bn_mp_lcm.c +++ b/mp_lcm.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_LCM_C +#ifdef MP_LCM_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_log_u32.c b/mp_log_u32.c similarity index 99% rename from bn_mp_log_u32.c rename to mp_log_u32.c index f7bca01..fb9dd5a 100644 --- a/bn_mp_log_u32.c +++ b/mp_log_u32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_LOG_U32_C +#ifdef MP_LOG_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_lshd.c b/mp_lshd.c similarity index 92% rename from bn_mp_lshd.c rename to mp_lshd.c index 8234580..eb9a5c3 100644 --- a/bn_mp_lshd.c +++ b/mp_lshd.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_LSHD_C +#ifdef MP_LSHD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ @@ -37,7 +37,7 @@ mp_err mp_lshd(mp_int *a, int b) /* much like mp_rshd this is implemented using a sliding window * except the window goes the otherway around. Copying from - * the bottom to the top. see bn_mp_rshd.c for more info. + * the bottom to the top. see mp_rshd.c for more info. */ for (x = a->used - 1; x >= b; x--) { *top-- = *bottom--; diff --git a/bn_mp_mod.c b/mp_mod.c similarity index 97% rename from bn_mp_mod.c rename to mp_mod.c index 8fbfe08..349fece 100644 --- a/bn_mp_mod.c +++ b/mp_mod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MOD_C +#ifdef MP_MOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_mod_2d.c b/mp_mod_2d.c similarity index 97% rename from bn_mp_mod_2d.c rename to mp_mod_2d.c index 5bf57a1..651c79a 100644 --- a/bn_mp_mod_2d.c +++ b/mp_mod_2d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MOD_2D_C +#ifdef MP_MOD_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_mod_d.c b/mp_mod_d.c similarity index 92% rename from bn_mp_mod_d.c rename to mp_mod_d.c index 0b6c12a..3f7e191 100644 --- a/bn_mp_mod_d.c +++ b/mp_mod_d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MOD_D_C +#ifdef MP_MOD_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_montgomery_calc_normalization.c b/mp_montgomery_calc_normalization.c similarity index 96% rename from bn_mp_montgomery_calc_normalization.c rename to mp_montgomery_calc_normalization.c index 8379789..0d0d5c4 100644 --- a/bn_mp_montgomery_calc_normalization.c +++ b/mp_montgomery_calc_normalization.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C +#ifdef MP_MONTGOMERY_CALC_NORMALIZATION_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_montgomery_reduce.c b/mp_montgomery_reduce.c similarity index 98% rename from bn_mp_montgomery_reduce.c rename to mp_montgomery_reduce.c index ffe8341..a872aba 100644 --- a/bn_mp_montgomery_reduce.c +++ b/mp_montgomery_reduce.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MONTGOMERY_REDUCE_C +#ifdef MP_MONTGOMERY_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_montgomery_setup.c b/mp_montgomery_setup.c similarity index 97% rename from bn_mp_montgomery_setup.c rename to mp_montgomery_setup.c index ad245eb..de57dc3 100644 --- a/bn_mp_montgomery_setup.c +++ b/mp_montgomery_setup.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MONTGOMERY_SETUP_C +#ifdef MP_MONTGOMERY_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_mul.c b/mp_mul.c similarity index 99% rename from bn_mp_mul.c rename to mp_mul.c index 561913a..bb0b652 100644 --- a/bn_mp_mul.c +++ b/mp_mul.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MUL_C +#ifdef MP_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_mul_2.c b/mp_mul_2.c similarity index 98% rename from bn_mp_mul_2.c rename to mp_mul_2.c index bc0691a..cd5589d 100644 --- a/bn_mp_mul_2.c +++ b/mp_mul_2.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MUL_2_C +#ifdef MP_MUL_2_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_mul_2d.c b/mp_mul_2d.c similarity index 98% rename from bn_mp_mul_2d.c rename to mp_mul_2d.c index 87354de..1ba53a0 100644 --- a/bn_mp_mul_2d.c +++ b/mp_mul_2d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MUL_2D_C +#ifdef MP_MUL_2D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_mul_d.c b/mp_mul_d.c similarity index 98% rename from bn_mp_mul_d.c rename to mp_mul_d.c index b56dfa3..399dc7b 100644 --- a/bn_mp_mul_d.c +++ b/mp_mul_d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MUL_D_C +#ifdef MP_MUL_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_mulmod.c b/mp_mulmod.c similarity index 95% rename from bn_mp_mulmod.c rename to mp_mulmod.c index 160d162..55b635b 100644 --- a/bn_mp_mulmod.c +++ b/mp_mulmod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_MULMOD_C +#ifdef MP_MULMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_neg.c b/mp_neg.c similarity index 96% rename from bn_mp_neg.c rename to mp_neg.c index 264d900..01fb276 100644 --- a/bn_mp_neg.c +++ b/mp_neg.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_NEG_C +#ifdef MP_NEG_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_or.c b/mp_or.c similarity index 98% rename from bn_mp_or.c rename to mp_or.c index cdacbfb..7fa1375 100644 --- a/bn_mp_or.c +++ b/mp_or.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_OR_C +#ifdef MP_OR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_pack.c b/mp_pack.c similarity index 98% rename from bn_mp_pack.c rename to mp_pack.c index 6e00b6f..ec0f62f 100644 --- a/bn_mp_pack.c +++ b/mp_pack.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PACK_C +#ifdef MP_PACK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_pack_count.c b/mp_pack_count.c similarity index 93% rename from bn_mp_pack_count.c rename to mp_pack_count.c index dfecdf9..aa682ba 100644 --- a/bn_mp_pack_count.c +++ b/mp_pack_count.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PACK_COUNT_C +#ifdef MP_PACK_COUNT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_prime_fermat.c b/mp_prime_fermat.c similarity index 97% rename from bn_mp_prime_fermat.c rename to mp_prime_fermat.c index af3e884..c6bc720 100644 --- a/bn_mp_prime_fermat.c +++ b/mp_prime_fermat.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_FERMAT_C +#ifdef MP_PRIME_FERMAT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_prime_frobenius_underwood.c b/mp_prime_frobenius_underwood.c similarity index 97% rename from bn_mp_prime_frobenius_underwood.c rename to mp_prime_frobenius_underwood.c index 618aa7c..ced0583 100644 --- a/bn_mp_prime_frobenius_underwood.c +++ b/mp_prime_frobenius_underwood.c @@ -1,11 +1,11 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_FROBENIUS_UNDERWOOD_C +#ifdef MP_PRIME_FROBENIUS_UNDERWOOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* - * See file bn_mp_prime_is_prime.c or the documentation in doc/bn.tex for the details + * See file mp_prime_is_prime.c or the documentation in doc/bn.tex for the details */ #ifndef LTM_USE_ONLY_MR diff --git a/bn_mp_prime_is_prime.c b/mp_prime_is_prime.c similarity index 99% rename from bn_mp_prime_is_prime.c rename to mp_prime_is_prime.c index 86edcb6..75d44c5 100644 --- a/bn_mp_prime_is_prime.c +++ b/mp_prime_is_prime.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_IS_PRIME_C +#ifdef MP_PRIME_IS_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_prime_miller_rabin.c b/mp_prime_miller_rabin.c similarity index 98% rename from bn_mp_prime_miller_rabin.c rename to mp_prime_miller_rabin.c index 96470db..f6d698b 100644 --- a/bn_mp_prime_miller_rabin.c +++ b/mp_prime_miller_rabin.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_MILLER_RABIN_C +#ifdef MP_PRIME_MILLER_RABIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_prime_next_prime.c b/mp_prime_next_prime.c similarity index 99% rename from bn_mp_prime_next_prime.c rename to mp_prime_next_prime.c index de27eab..3e2571a 100644 --- a/bn_mp_prime_next_prime.c +++ b/mp_prime_next_prime.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_NEXT_PRIME_C +#ifdef MP_PRIME_NEXT_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_prime_rabin_miller_trials.c b/mp_prime_rabin_miller_trials.c similarity index 97% rename from bn_mp_prime_rabin_miller_trials.c rename to mp_prime_rabin_miller_trials.c index 8bbaf6c..1728142 100644 --- a/bn_mp_prime_rabin_miller_trials.c +++ b/mp_prime_rabin_miller_trials.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_RABIN_MILLER_TRIALS_C +#ifdef MP_PRIME_RABIN_MILLER_TRIALS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_prime_rand.c b/mp_prime_rand.c similarity index 99% rename from bn_mp_prime_rand.c rename to mp_prime_rand.c index af19d76..b37089b 100644 --- a/bn_mp_prime_rand.c +++ b/mp_prime_rand.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_RAND_C +#ifdef MP_PRIME_RAND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_prime_strong_lucas_selfridge.c b/mp_prime_strong_lucas_selfridge.c similarity index 98% rename from bn_mp_prime_strong_lucas_selfridge.c rename to mp_prime_strong_lucas_selfridge.c index a5ea16d..6934336 100644 --- a/bn_mp_prime_strong_lucas_selfridge.c +++ b/mp_prime_strong_lucas_selfridge.c @@ -1,11 +1,11 @@ #include "tommath_private.h" -#ifdef BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C +#ifdef MP_PRIME_STRONG_LUCAS_SELFRIDGE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* - * See file bn_mp_prime_is_prime.c or the documentation in doc/bn.tex for the details + * See file mp_prime_is_prime.c or the documentation in doc/bn.tex for the details */ #ifndef LTM_USE_ONLY_MR diff --git a/bn_prime_tab.c b/mp_prime_tab.c similarity index 99% rename from bn_prime_tab.c rename to mp_prime_tab.c index 92a5159..24b4016 100644 --- a/bn_prime_tab.c +++ b/mp_prime_tab.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_PRIME_TAB_C +#ifdef MP_PRIME_TAB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_radix_size.c b/mp_radix_size.c similarity index 96% rename from bn_mp_radix_size.c rename to mp_radix_size.c index 5ed9ab1..387e0ec 100644 --- a/bn_mp_radix_size.c +++ b/mp_radix_size.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_RADIX_SIZE_C +#ifdef MP_RADIX_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_radix_smap.c b/mp_radix_smap.c similarity index 97% rename from bn_mp_radix_smap.c rename to mp_radix_smap.c index e7d7c06..678e806 100644 --- a/bn_mp_radix_smap.c +++ b/mp_radix_smap.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_RADIX_SMAP_C +#ifdef MP_RADIX_SMAP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_rand.c b/mp_rand.c similarity index 98% rename from bn_mp_rand.c rename to mp_rand.c index 7e9052c..df665b7 100644 --- a/bn_mp_rand.c +++ b/mp_rand.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_RAND_C +#ifdef MP_RAND_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_read_radix.c b/mp_read_radix.c similarity index 98% rename from bn_mp_read_radix.c rename to mp_read_radix.c index 456a387..dc5e167 100644 --- a/bn_mp_read_radix.c +++ b/mp_read_radix.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_READ_RADIX_C +#ifdef MP_READ_RADIX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce.c b/mp_reduce.c similarity index 98% rename from bn_mp_reduce.c rename to mp_reduce.c index 3c669d4..1b4435c 100644 --- a/bn_mp_reduce.c +++ b/mp_reduce.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_C +#ifdef MP_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce_2k.c b/mp_reduce_2k.c similarity index 97% rename from bn_mp_reduce_2k.c rename to mp_reduce_2k.c index 1cea6cb..5d3c7f9 100644 --- a/bn_mp_reduce_2k.c +++ b/mp_reduce_2k.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_2K_C +#ifdef MP_REDUCE_2K_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce_2k_l.c b/mp_reduce_2k_l.c similarity index 97% rename from bn_mp_reduce_2k_l.c rename to mp_reduce_2k_l.c index 6a9f3d3..6328cbc 100644 --- a/bn_mp_reduce_2k_l.c +++ b/mp_reduce_2k_l.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_2K_L_C +#ifdef MP_REDUCE_2K_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce_2k_setup.c b/mp_reduce_2k_setup.c similarity index 95% rename from bn_mp_reduce_2k_setup.c rename to mp_reduce_2k_setup.c index 2eaf7ad..0f3fd29 100644 --- a/bn_mp_reduce_2k_setup.c +++ b/mp_reduce_2k_setup.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_2K_SETUP_C +#ifdef MP_REDUCE_2K_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce_2k_setup_l.c b/mp_reduce_2k_setup_l.c similarity index 94% rename from bn_mp_reduce_2k_setup_l.c rename to mp_reduce_2k_setup_l.c index 4f9aa14..b647c9d 100644 --- a/bn_mp_reduce_2k_setup_l.c +++ b/mp_reduce_2k_setup_l.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_2K_SETUP_L_C +#ifdef MP_REDUCE_2K_SETUP_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce_is_2k.c b/mp_reduce_is_2k.c similarity index 96% rename from bn_mp_reduce_is_2k.c rename to mp_reduce_is_2k.c index a9f4f9f..ec12338 100644 --- a/bn_mp_reduce_is_2k.c +++ b/mp_reduce_is_2k.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_IS_2K_C +#ifdef MP_REDUCE_IS_2K_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce_is_2k_l.c b/mp_reduce_is_2k_l.c similarity index 95% rename from bn_mp_reduce_is_2k_l.c rename to mp_reduce_is_2k_l.c index 4bc69be..1aa3d4e 100644 --- a/bn_mp_reduce_is_2k_l.c +++ b/mp_reduce_is_2k_l.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_IS_2K_L_C +#ifdef MP_REDUCE_IS_2K_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_reduce_setup.c b/mp_reduce_setup.c similarity index 94% rename from bn_mp_reduce_setup.c rename to mp_reduce_setup.c index f02160f..e12056e 100644 --- a/bn_mp_reduce_setup.c +++ b/mp_reduce_setup.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_REDUCE_SETUP_C +#ifdef MP_REDUCE_SETUP_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_root_u32.c b/mp_root_u32.c similarity index 99% rename from bn_mp_root_u32.c rename to mp_root_u32.c index ba65549..f682749 100644 --- a/bn_mp_root_u32.c +++ b/mp_root_u32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ROOT_U32_C +#ifdef MP_ROOT_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_rshd.c b/mp_rshd.c similarity index 98% rename from bn_mp_rshd.c rename to mp_rshd.c index bb8743e..2eabb12 100644 --- a/bn_mp_rshd.c +++ b/mp_rshd.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_RSHD_C +#ifdef MP_RSHD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_sbin_size.c b/mp_sbin_size.c similarity index 91% rename from bn_mp_sbin_size.c rename to mp_sbin_size.c index e0993d6..2f40df3 100644 --- a/bn_mp_sbin_size.c +++ b/mp_sbin_size.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SBIN_SIZE_C +#ifdef MP_SBIN_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set.c b/mp_set.c similarity index 94% rename from bn_mp_set.c rename to mp_set.c index 44ac6df..0777f09 100644 --- a/bn_mp_set.c +++ b/mp_set.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_C +#ifdef MP_SET_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_double.c b/mp_set_double.c similarity index 97% rename from bn_mp_set_double.c rename to mp_set_double.c index a42fc70..f7e3b8d 100644 --- a/bn_mp_set_double.c +++ b/mp_set_double.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_DOUBLE_C +#ifdef MP_SET_DOUBLE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_i32.c b/mp_set_i32.c similarity index 89% rename from bn_mp_set_i32.c rename to mp_set_i32.c index df4513d..123613e 100644 --- a/bn_mp_set_i32.c +++ b/mp_set_i32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_I32_C +#ifdef MP_SET_I32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_i64.c b/mp_set_i64.c similarity index 89% rename from bn_mp_set_i64.c rename to mp_set_i64.c index 395103b..4635ca3 100644 --- a/bn_mp_set_i64.c +++ b/mp_set_i64.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_I64_C +#ifdef MP_SET_I64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_l.c b/mp_set_l.c similarity index 90% rename from bn_mp_set_l.c rename to mp_set_l.c index 1e445fb..411f6eb 100644 --- a/bn_mp_set_l.c +++ b/mp_set_l.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_L_C +#ifdef MP_SET_L_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_ll.c b/mp_set_ll.c similarity index 90% rename from bn_mp_set_ll.c rename to mp_set_ll.c index 3e2324f..343012d 100644 --- a/bn_mp_set_ll.c +++ b/mp_set_ll.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_LL_C +#ifdef MP_SET_LL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_u32.c b/mp_set_u32.c similarity index 88% rename from bn_mp_set_u32.c rename to mp_set_u32.c index 18ba5e1..8ff84dc 100644 --- a/bn_mp_set_u32.c +++ b/mp_set_u32.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_U32_C +#ifdef MP_SET_U32_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_u64.c b/mp_set_u64.c similarity index 88% rename from bn_mp_set_u64.c rename to mp_set_u64.c index 88fab6c..9acb1fe 100644 --- a/bn_mp_set_u64.c +++ b/mp_set_u64.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_U64_C +#ifdef MP_SET_U64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_ul.c b/mp_set_ul.c similarity index 89% rename from bn_mp_set_ul.c rename to mp_set_ul.c index adfd85c..baf8e18 100644 --- a/bn_mp_set_ul.c +++ b/mp_set_ul.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_UL_C +#ifdef MP_SET_UL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_set_ull.c b/mp_set_ull.c similarity index 89% rename from bn_mp_set_ull.c rename to mp_set_ull.c index 8fbc1bd..cd10b1c 100644 --- a/bn_mp_set_ull.c +++ b/mp_set_ull.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SET_ULL_C +#ifdef MP_SET_ULL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_shrink.c b/mp_shrink.c similarity index 96% rename from bn_mp_shrink.c rename to mp_shrink.c index cf27ed9..6c3c95b 100644 --- a/bn_mp_shrink.c +++ b/mp_shrink.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SHRINK_C +#ifdef MP_SHRINK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_signed_rsh.c b/mp_signed_rsh.c similarity index 95% rename from bn_mp_signed_rsh.c rename to mp_signed_rsh.c index 8d8d841..c56dfba 100644 --- a/bn_mp_signed_rsh.c +++ b/mp_signed_rsh.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SIGNED_RSH_C +#ifdef MP_SIGNED_RSH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_sqr.c b/mp_sqr.c similarity index 97% rename from bn_mp_sqr.c rename to mp_sqr.c index e0d0a73..e38130b 100644 --- a/bn_mp_sqr.c +++ b/mp_sqr.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SQR_C +#ifdef MP_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_sqrmod.c b/mp_sqrmod.c similarity index 95% rename from bn_mp_sqrmod.c rename to mp_sqrmod.c index 626ea2c..f1a92ef 100644 --- a/bn_mp_sqrmod.c +++ b/mp_sqrmod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SQRMOD_C +#ifdef MP_SQRMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_sqrt.c b/mp_sqrt.c similarity index 98% rename from bn_mp_sqrt.c rename to mp_sqrt.c index 82d6824..2839868 100644 --- a/bn_mp_sqrt.c +++ b/mp_sqrt.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SQRT_C +#ifdef MP_SQRT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_sqrtmod_prime.c b/mp_sqrtmod_prime.c similarity index 99% rename from bn_mp_sqrtmod_prime.c rename to mp_sqrtmod_prime.c index a833ed7..bf72005 100644 --- a/bn_mp_sqrtmod_prime.c +++ b/mp_sqrtmod_prime.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SQRTMOD_PRIME_C +#ifdef MP_SQRTMOD_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_sub.c b/mp_sub.c similarity index 98% rename from bn_mp_sub.c rename to mp_sub.c index c1ea39e..c859026 100644 --- a/bn_mp_sub.c +++ b/mp_sub.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SUB_C +#ifdef MP_SUB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_sub_d.c b/mp_sub_d.c similarity index 98% rename from bn_mp_sub_d.c rename to mp_sub_d.c index 3ebf9b4..16c6165 100644 --- a/bn_mp_sub_d.c +++ b/mp_sub_d.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SUB_D_C +#ifdef MP_SUB_D_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_submod.c b/mp_submod.c similarity index 95% rename from bn_mp_submod.c rename to mp_submod.c index 5ebd374..c5dc401 100644 --- a/bn_mp_submod.c +++ b/mp_submod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_SUBMOD_C +#ifdef MP_SUBMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_to_radix.c b/mp_to_radix.c similarity index 98% rename from bn_mp_to_radix.c rename to mp_to_radix.c index 18cb504..95def74 100644 --- a/bn_mp_to_radix.c +++ b/mp_to_radix.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_TO_RADIX_C +#ifdef MP_TO_RADIX_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_to_sbin.c b/mp_to_sbin.c similarity index 96% rename from bn_mp_to_sbin.c rename to mp_to_sbin.c index dbaf53e..ed21adc 100644 --- a/bn_mp_to_sbin.c +++ b/mp_to_sbin.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_TO_SBIN_C +#ifdef MP_TO_SBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_to_ubin.c b/mp_to_ubin.c similarity index 97% rename from bn_mp_to_ubin.c rename to mp_to_ubin.c index a2c6e28..2583503 100644 --- a/bn_mp_to_ubin.c +++ b/mp_to_ubin.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_TO_UBIN_C +#ifdef MP_TO_UBIN_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_ubin_size.c b/mp_ubin_size.c similarity index 93% rename from bn_mp_ubin_size.c rename to mp_ubin_size.c index 21230b4..4f16404 100644 --- a/bn_mp_ubin_size.c +++ b/mp_ubin_size.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_UBIN_SIZE_C +#ifdef MP_UBIN_SIZE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_unpack.c b/mp_unpack.c similarity index 98% rename from bn_mp_unpack.c rename to mp_unpack.c index d4eb90e..5305b43 100644 --- a/bn_mp_unpack.c +++ b/mp_unpack.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_UNPACK_C +#ifdef MP_UNPACK_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_xor.c b/mp_xor.c similarity index 98% rename from bn_mp_xor.c rename to mp_xor.c index 71e7ca1..ca2c2f1 100644 --- a/bn_mp_xor.c +++ b/mp_xor.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_XOR_C +#ifdef MP_XOR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_mp_zero.c b/mp_zero.c similarity index 93% rename from bn_mp_zero.c rename to mp_zero.c index 72a255e..0b79f50 100644 --- a/bn_mp_zero.c +++ b/mp_zero.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_MP_ZERO_C +#ifdef MP_ZERO_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_add.c b/s_mp_add.c similarity index 98% rename from bn_s_mp_add.c rename to s_mp_add.c index c946aa8..9220719 100644 --- a/bn_s_mp_add.c +++ b/s_mp_add.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_ADD_C +#ifdef S_MP_ADD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_balance_mul.c b/s_mp_balance_mul.c similarity index 98% rename from bn_s_mp_balance_mul.c rename to s_mp_balance_mul.c index 7ece5d7..4108830 100644 --- a/bn_s_mp_balance_mul.c +++ b/s_mp_balance_mul.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_BALANCE_MUL_C +#ifdef S_MP_BALANCE_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_exptmod.c b/s_mp_exptmod.c similarity index 99% rename from bn_s_mp_exptmod.c rename to s_mp_exptmod.c index c3bfa95..2a89a2c 100644 --- a/bn_s_mp_exptmod.c +++ b/s_mp_exptmod.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_EXPTMOD_C +#ifdef S_MP_EXPTMOD_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_exptmod_fast.c b/s_mp_exptmod_fast.c similarity index 99% rename from bn_s_mp_exptmod_fast.c rename to s_mp_exptmod_fast.c index 682ded8..d581129 100644 --- a/bn_s_mp_exptmod_fast.c +++ b/s_mp_exptmod_fast.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_EXPTMOD_FAST_C +#ifdef S_MP_EXPTMOD_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_get_bit.c b/s_mp_get_bit.c similarity index 95% rename from bn_s_mp_get_bit.c rename to s_mp_get_bit.c index 28598df..397499c 100644 --- a/bn_s_mp_get_bit.c +++ b/s_mp_get_bit.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_GET_BIT_C +#ifdef S_MP_GET_BIT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_invmod_fast.c b/s_mp_invmod_fast.c similarity index 99% rename from bn_s_mp_invmod_fast.c rename to s_mp_invmod_fast.c index 677d7ab..0d00ea9 100644 --- a/bn_s_mp_invmod_fast.c +++ b/s_mp_invmod_fast.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_INVMOD_FAST_C +#ifdef S_MP_INVMOD_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_invmod_slow.c b/s_mp_invmod_slow.c similarity index 99% rename from bn_s_mp_invmod_slow.c rename to s_mp_invmod_slow.c index 4c5db33..4fecfb8 100644 --- a/bn_s_mp_invmod_slow.c +++ b/s_mp_invmod_slow.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_INVMOD_SLOW_C +#ifdef S_MP_INVMOD_SLOW_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_karatsuba_mul.c b/s_mp_karatsuba_mul.c similarity index 99% rename from bn_s_mp_karatsuba_mul.c rename to s_mp_karatsuba_mul.c index 85899fb..df3daa7 100644 --- a/bn_s_mp_karatsuba_mul.c +++ b/s_mp_karatsuba_mul.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_KARATSUBA_MUL_C +#ifdef S_MP_KARATSUBA_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_karatsuba_sqr.c b/s_mp_karatsuba_sqr.c similarity index 98% rename from bn_s_mp_karatsuba_sqr.c rename to s_mp_karatsuba_sqr.c index f132d07..7f22842 100644 --- a/bn_s_mp_karatsuba_sqr.c +++ b/s_mp_karatsuba_sqr.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_KARATSUBA_SQR_C +#ifdef S_MP_KARATSUBA_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_montgomery_reduce_fast.c b/s_mp_montgomery_reduce_fast.c similarity index 99% rename from bn_s_mp_montgomery_reduce_fast.c rename to s_mp_montgomery_reduce_fast.c index 3f0c672..083e7a4 100644 --- a/bn_s_mp_montgomery_reduce_fast.c +++ b/s_mp_montgomery_reduce_fast.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_MONTGOMERY_REDUCE_FAST_C +#ifdef S_MP_MONTGOMERY_REDUCE_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_mul_digs.c b/s_mp_mul_digs.c similarity index 98% rename from bn_s_mp_mul_digs.c rename to s_mp_mul_digs.c index 64509d4..ea0985b 100644 --- a/bn_s_mp_mul_digs.c +++ b/s_mp_mul_digs.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_MUL_DIGS_C +#ifdef S_MP_MUL_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_mul_digs_fast.c b/s_mp_mul_digs_fast.c similarity index 98% rename from bn_s_mp_mul_digs_fast.c rename to s_mp_mul_digs_fast.c index b2a287b..8988838 100644 --- a/bn_s_mp_mul_digs_fast.c +++ b/s_mp_mul_digs_fast.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_MUL_DIGS_FAST_C +#ifdef S_MP_MUL_DIGS_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_mul_high_digs.c b/s_mp_mul_high_digs.c similarity index 98% rename from bn_s_mp_mul_high_digs.c rename to s_mp_mul_high_digs.c index 2bb2a50..87cfbe5 100644 --- a/bn_s_mp_mul_high_digs.c +++ b/s_mp_mul_high_digs.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_MUL_HIGH_DIGS_C +#ifdef S_MP_MUL_HIGH_DIGS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_mul_high_digs_fast.c b/s_mp_mul_high_digs_fast.c similarity index 98% rename from bn_s_mp_mul_high_digs_fast.c rename to s_mp_mul_high_digs_fast.c index a2c4fb6..06561a9 100644 --- a/bn_s_mp_mul_high_digs_fast.c +++ b/s_mp_mul_high_digs_fast.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_MUL_HIGH_DIGS_FAST_C +#ifdef S_MP_MUL_HIGH_DIGS_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_prime_is_divisible.c b/s_mp_prime_is_divisible.c similarity index 95% rename from bn_s_mp_prime_is_divisible.c rename to s_mp_prime_is_divisible.c index ca303a5..d8bdedc 100644 --- a/bn_s_mp_prime_is_divisible.c +++ b/s_mp_prime_is_divisible.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_PRIME_IS_DIVISIBLE_C +#ifdef S_MP_PRIME_IS_DIVISIBLE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_rand_jenkins.c b/s_mp_rand_jenkins.c similarity index 97% rename from bn_s_mp_rand_jenkins.c rename to s_mp_rand_jenkins.c index da0771c..cbbe066 100644 --- a/bn_s_mp_rand_jenkins.c +++ b/s_mp_rand_jenkins.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_RAND_JENKINS_C +#ifdef S_MP_RAND_JENKINS_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_rand_platform.c b/s_mp_rand_platform.c similarity index 92% rename from bn_s_mp_rand_platform.c rename to s_mp_rand_platform.c index 07555db..8f79d89 100644 --- a/bn_s_mp_rand_platform.c +++ b/s_mp_rand_platform.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_RAND_PLATFORM_C +#ifdef S_MP_RAND_PLATFORM_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ @@ -8,7 +8,7 @@ * - Windows */ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) -#define BN_S_READ_ARC4RANDOM_C +#define S_READ_ARC4RANDOM_C static mp_err s_read_arc4random(void *p, size_t n) { arc4random_buf(p, n); @@ -17,7 +17,7 @@ static mp_err s_read_arc4random(void *p, size_t n) #endif #if defined(_WIN32) || defined(_WIN32_WCE) -#define BN_S_READ_WINCSP_C +#define S_READ_WINCSP_C #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 @@ -55,9 +55,9 @@ static mp_err s_read_wincsp(void *p, size_t n) } #endif /* WIN32 */ -#if !defined(BN_S_READ_WINCSP_C) && defined(__linux__) && defined(__GLIBC_PREREQ) +#if !defined(S_READ_WINCSP_C) && defined(__linux__) && defined(__GLIBC_PREREQ) #if __GLIBC_PREREQ(2, 25) -#define BN_S_READ_GETRANDOM_C +#define S_READ_GETRANDOM_C #include #include @@ -83,8 +83,8 @@ static mp_err s_read_getrandom(void *p, size_t n) /* We assume all platforms besides windows provide "/dev/urandom". * In case yours doesn't, define MP_NO_DEV_URANDOM at compile-time. */ -#if !defined(BN_S_READ_WINCSP_C) && !defined(MP_NO_DEV_URANDOM) -#define BN_S_READ_URANDOM_C +#if !defined(S_READ_WINCSP_C) && !defined(MP_NO_DEV_URANDOM) +#define S_READ_URANDOM_C #ifndef MP_DEV_URANDOM #define MP_DEV_URANDOM "/dev/urandom" #endif diff --git a/bn_s_mp_reverse.c b/s_mp_reverse.c similarity index 94% rename from bn_s_mp_reverse.c rename to s_mp_reverse.c index c549e60..d288dc5 100644 --- a/bn_s_mp_reverse.c +++ b/s_mp_reverse.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_REVERSE_C +#ifdef S_MP_REVERSE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_sqr.c b/s_mp_sqr.c similarity index 98% rename from bn_s_mp_sqr.c rename to s_mp_sqr.c index 505c9f0..61106ed 100644 --- a/bn_s_mp_sqr.c +++ b/s_mp_sqr.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_SQR_C +#ifdef S_MP_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_sqr_fast.c b/s_mp_sqr_fast.c similarity index 98% rename from bn_s_mp_sqr_fast.c rename to s_mp_sqr_fast.c index 4a8a891..bcb1f5e 100644 --- a/bn_s_mp_sqr_fast.c +++ b/s_mp_sqr_fast.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_SQR_FAST_C +#ifdef S_MP_SQR_FAST_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_sub.c b/s_mp_sub.c similarity index 98% rename from bn_s_mp_sub.c rename to s_mp_sub.c index 5672dab..bef1fce 100644 --- a/bn_s_mp_sub.c +++ b/s_mp_sub.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_SUB_C +#ifdef S_MP_SUB_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_toom_mul.c b/s_mp_toom_mul.c similarity index 99% rename from bn_s_mp_toom_mul.c rename to s_mp_toom_mul.c index 8efd803..0b2d57d 100644 --- a/bn_s_mp_toom_mul.c +++ b/s_mp_toom_mul.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_TOOM_MUL_C +#ifdef S_MP_TOOM_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/bn_s_mp_toom_sqr.c b/s_mp_toom_sqr.c similarity index 99% rename from bn_s_mp_toom_sqr.c rename to s_mp_toom_sqr.c index 9eaa9d0..884a532 100644 --- a/bn_s_mp_toom_sqr.c +++ b/s_mp_toom_sqr.c @@ -1,5 +1,5 @@ #include "tommath_private.h" -#ifdef BN_S_MP_TOOM_SQR_C +#ifdef S_MP_TOOM_SQR_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ diff --git a/tommath.def b/tommath.def index 9c7f226..7c241bc 100644 --- a/tommath.def +++ b/tommath.def @@ -22,6 +22,7 @@ EXPORTS mp_complement mp_copy mp_count_bits + mp_cutoffs mp_decr mp_div mp_div_2 @@ -96,6 +97,7 @@ EXPORTS mp_prime_rabin_miller_trials mp_prime_rand mp_prime_strong_lucas_selfridge + mp_prime_tab mp_radix_size mp_rand mp_read_radix diff --git a/tommath.h b/tommath.h index cca5411..b82477e 100644 --- a/tommath.h +++ b/tommath.h @@ -1,8 +1,8 @@ /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ -#ifndef BN_H_ -#define BN_H_ +#ifndef TOMMATH_H_ +#define TOMMATH_H_ #include #include diff --git a/tommath_class.h b/tommath_class.h index 209d809..c6dcde1 100644 --- a/tommath_class.h +++ b/tommath_class.h @@ -11,1208 +11,1208 @@ #endif #define LTM1 #if defined(LTM_ALL) -# define BN_CUTOFFS_C -# define BN_MP_2EXPT_C -# define BN_MP_ABS_C -# define BN_MP_ADD_C -# define BN_MP_ADD_D_C -# define BN_MP_ADDMOD_C -# define BN_MP_AND_C -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_CMP_MAG_C -# define BN_MP_CNT_LSB_C -# define BN_MP_COMPLEMENT_C -# define BN_MP_COPY_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DECR_C -# define BN_MP_DIV_C -# define BN_MP_DIV_2_C -# define BN_MP_DIV_2D_C -# define BN_MP_DIV_3_C -# define BN_MP_DIV_D_C -# define BN_MP_DR_IS_MODULUS_C -# define BN_MP_DR_REDUCE_C -# define BN_MP_DR_SETUP_C -# define BN_MP_ERROR_TO_STRING_C -# define BN_MP_EXCH_C -# define BN_MP_EXPT_U32_C -# define BN_MP_EXPTMOD_C -# define BN_MP_EXTEUCLID_C -# define BN_MP_FREAD_C -# define BN_MP_FROM_SBIN_C -# define BN_MP_FROM_UBIN_C -# define BN_MP_FWRITE_C -# define BN_MP_GCD_C -# define BN_MP_GET_DOUBLE_C -# define BN_MP_GET_I32_C -# define BN_MP_GET_I64_C -# define BN_MP_GET_L_C -# define BN_MP_GET_LL_C -# define BN_MP_GET_MAG_U32_C -# define BN_MP_GET_MAG_U64_C -# define BN_MP_GET_MAG_UL_C -# define BN_MP_GET_MAG_ULL_C -# define BN_MP_GROW_C -# define BN_MP_INCR_C -# define BN_MP_INIT_C -# define BN_MP_INIT_COPY_C -# define BN_MP_INIT_I32_C -# define BN_MP_INIT_I64_C -# define BN_MP_INIT_L_C -# define BN_MP_INIT_LL_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_INIT_SET_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_INIT_U32_C -# define BN_MP_INIT_U64_C -# define BN_MP_INIT_UL_C -# define BN_MP_INIT_ULL_C -# define BN_MP_INVMOD_C -# define BN_MP_IS_SQUARE_C -# define BN_MP_ISEVEN_C -# define BN_MP_ISODD_C -# define BN_MP_KRONECKER_C -# define BN_MP_LCM_C -# define BN_MP_LOG_U32_C -# define BN_MP_LSHD_C -# define BN_MP_MOD_C -# define BN_MP_MOD_2D_C -# define BN_MP_MOD_D_C -# define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C -# define BN_MP_MONTGOMERY_REDUCE_C -# define BN_MP_MONTGOMERY_SETUP_C -# define BN_MP_MUL_C -# define BN_MP_MUL_2_C -# define BN_MP_MUL_2D_C -# define BN_MP_MUL_D_C -# define BN_MP_MULMOD_C -# define BN_MP_NEG_C -# define BN_MP_OR_C -# define BN_MP_PACK_C -# define BN_MP_PACK_COUNT_C -# define BN_MP_PRIME_FERMAT_C -# define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C -# define BN_MP_PRIME_IS_PRIME_C -# define BN_MP_PRIME_MILLER_RABIN_C -# define BN_MP_PRIME_NEXT_PRIME_C -# define BN_MP_PRIME_RABIN_MILLER_TRIALS_C -# define BN_MP_PRIME_RAND_C -# define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C -# define BN_MP_RADIX_SIZE_C -# define BN_MP_RADIX_SMAP_C -# define BN_MP_RAND_C -# define BN_MP_READ_RADIX_C -# define BN_MP_REDUCE_C -# define BN_MP_REDUCE_2K_C -# define BN_MP_REDUCE_2K_L_C -# define BN_MP_REDUCE_2K_SETUP_C -# define BN_MP_REDUCE_2K_SETUP_L_C -# define BN_MP_REDUCE_IS_2K_C -# define BN_MP_REDUCE_IS_2K_L_C -# define BN_MP_REDUCE_SETUP_C -# define BN_MP_ROOT_U32_C -# define BN_MP_RSHD_C -# define BN_MP_SBIN_SIZE_C -# define BN_MP_SET_C -# define BN_MP_SET_DOUBLE_C -# define BN_MP_SET_I32_C -# define BN_MP_SET_I64_C -# define BN_MP_SET_L_C -# define BN_MP_SET_LL_C -# define BN_MP_SET_U32_C -# define BN_MP_SET_U64_C -# define BN_MP_SET_UL_C -# define BN_MP_SET_ULL_C -# define BN_MP_SHRINK_C -# define BN_MP_SIGNED_RSH_C -# define BN_MP_SQR_C -# define BN_MP_SQRMOD_C -# define BN_MP_SQRT_C -# define BN_MP_SQRTMOD_PRIME_C -# define BN_MP_SUB_C -# define BN_MP_SUB_D_C -# define BN_MP_SUBMOD_C -# define BN_MP_TO_RADIX_C -# define BN_MP_TO_SBIN_C -# define BN_MP_TO_UBIN_C -# define BN_MP_UBIN_SIZE_C -# define BN_MP_UNPACK_C -# define BN_MP_XOR_C -# define BN_MP_ZERO_C -# define BN_PRIME_TAB_C -# define BN_S_MP_ADD_C -# define BN_S_MP_BALANCE_MUL_C -# define BN_S_MP_EXPTMOD_C -# define BN_S_MP_EXPTMOD_FAST_C -# define BN_S_MP_GET_BIT_C -# define BN_S_MP_INVMOD_FAST_C -# define BN_S_MP_INVMOD_SLOW_C -# define BN_S_MP_KARATSUBA_MUL_C -# define BN_S_MP_KARATSUBA_SQR_C -# define BN_S_MP_MONTGOMERY_REDUCE_FAST_C -# define BN_S_MP_MUL_DIGS_C -# define BN_S_MP_MUL_DIGS_FAST_C -# define BN_S_MP_MUL_HIGH_DIGS_C -# define BN_S_MP_MUL_HIGH_DIGS_FAST_C -# define BN_S_MP_PRIME_IS_DIVISIBLE_C -# define BN_S_MP_RAND_JENKINS_C -# define BN_S_MP_RAND_PLATFORM_C -# define BN_S_MP_REVERSE_C -# define BN_S_MP_SQR_C -# define BN_S_MP_SQR_FAST_C -# define BN_S_MP_SUB_C -# define BN_S_MP_TOOM_MUL_C -# define BN_S_MP_TOOM_SQR_C -#endif -#endif -#if defined(BN_CUTOFFS_C) -#endif - -#if defined(BN_MP_2EXPT_C) -# define BN_MP_GROW_C -# define BN_MP_ZERO_C -#endif - -#if defined(BN_MP_ABS_C) -# define BN_MP_COPY_C -#endif - -#if defined(BN_MP_ADD_C) -# define BN_MP_CMP_MAG_C -# define BN_S_MP_ADD_C -# define BN_S_MP_SUB_C -#endif - -#if defined(BN_MP_ADD_D_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C -# define BN_MP_SUB_D_C -#endif - -#if defined(BN_MP_ADDMOD_C) -# define BN_MP_ADD_C -# define BN_MP_CLEAR_C -# define BN_MP_INIT_C -# define BN_MP_MOD_C -#endif - -#if defined(BN_MP_AND_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C +# define MP_2EXPT_C +# define MP_ABS_C +# define MP_ADD_C +# define MP_ADD_D_C +# define MP_ADDMOD_C +# define MP_AND_C +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_CLEAR_MULTI_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_CMP_MAG_C +# define MP_CNT_LSB_C +# define MP_COMPLEMENT_C +# define MP_COPY_C +# define MP_COUNT_BITS_C +# define MP_CUTOFFS_C +# define MP_DECR_C +# define MP_DIV_C +# define MP_DIV_2_C +# define MP_DIV_2D_C +# define MP_DIV_3_C +# define MP_DIV_D_C +# define MP_DR_IS_MODULUS_C +# define MP_DR_REDUCE_C +# define MP_DR_SETUP_C +# define MP_ERROR_TO_STRING_C +# define MP_EXCH_C +# define MP_EXPT_U32_C +# define MP_EXPTMOD_C +# define MP_EXTEUCLID_C +# define MP_FREAD_C +# define MP_FROM_SBIN_C +# define MP_FROM_UBIN_C +# define MP_FWRITE_C +# define MP_GCD_C +# define MP_GET_DOUBLE_C +# define MP_GET_I32_C +# define MP_GET_I64_C +# define MP_GET_L_C +# define MP_GET_LL_C +# define MP_GET_MAG_U32_C +# define MP_GET_MAG_U64_C +# define MP_GET_MAG_UL_C +# define MP_GET_MAG_ULL_C +# define MP_GROW_C +# define MP_INCR_C +# define MP_INIT_C +# define MP_INIT_COPY_C +# define MP_INIT_I32_C +# define MP_INIT_I64_C +# define MP_INIT_L_C +# define MP_INIT_LL_C +# define MP_INIT_MULTI_C +# define MP_INIT_SET_C +# define MP_INIT_SIZE_C +# define MP_INIT_U32_C +# define MP_INIT_U64_C +# define MP_INIT_UL_C +# define MP_INIT_ULL_C +# define MP_INVMOD_C +# define MP_IS_SQUARE_C +# define MP_ISEVEN_C +# define MP_ISODD_C +# define MP_KRONECKER_C +# define MP_LCM_C +# define MP_LOG_U32_C +# define MP_LSHD_C +# define MP_MOD_C +# define MP_MOD_2D_C +# define MP_MOD_D_C +# define MP_MONTGOMERY_CALC_NORMALIZATION_C +# define MP_MONTGOMERY_REDUCE_C +# define MP_MONTGOMERY_SETUP_C +# define MP_MUL_C +# define MP_MUL_2_C +# define MP_MUL_2D_C +# define MP_MUL_D_C +# define MP_MULMOD_C +# define MP_NEG_C +# define MP_OR_C +# define MP_PACK_C +# define MP_PACK_COUNT_C +# define MP_PRIME_FERMAT_C +# define MP_PRIME_FROBENIUS_UNDERWOOD_C +# define MP_PRIME_IS_PRIME_C +# define MP_PRIME_MILLER_RABIN_C +# define MP_PRIME_NEXT_PRIME_C +# define MP_PRIME_RABIN_MILLER_TRIALS_C +# define MP_PRIME_RAND_C +# define MP_PRIME_STRONG_LUCAS_SELFRIDGE_C +# define MP_PRIME_TAB_C +# define MP_RADIX_SIZE_C +# define MP_RADIX_SMAP_C +# define MP_RAND_C +# define MP_READ_RADIX_C +# define MP_REDUCE_C +# define MP_REDUCE_2K_C +# define MP_REDUCE_2K_L_C +# define MP_REDUCE_2K_SETUP_C +# define MP_REDUCE_2K_SETUP_L_C +# define MP_REDUCE_IS_2K_C +# define MP_REDUCE_IS_2K_L_C +# define MP_REDUCE_SETUP_C +# define MP_ROOT_U32_C +# define MP_RSHD_C +# define MP_SBIN_SIZE_C +# define MP_SET_C +# define MP_SET_DOUBLE_C +# define MP_SET_I32_C +# define MP_SET_I64_C +# define MP_SET_L_C +# define MP_SET_LL_C +# define MP_SET_U32_C +# define MP_SET_U64_C +# define MP_SET_UL_C +# define MP_SET_ULL_C +# define MP_SHRINK_C +# define MP_SIGNED_RSH_C +# define MP_SQR_C +# define MP_SQRMOD_C +# define MP_SQRT_C +# define MP_SQRTMOD_PRIME_C +# define MP_SUB_C +# define MP_SUB_D_C +# define MP_SUBMOD_C +# define MP_TO_RADIX_C +# define MP_TO_SBIN_C +# define MP_TO_UBIN_C +# define MP_UBIN_SIZE_C +# define MP_UNPACK_C +# define MP_XOR_C +# define MP_ZERO_C +# define S_MP_ADD_C +# define S_MP_BALANCE_MUL_C +# define S_MP_EXPTMOD_C +# define S_MP_EXPTMOD_FAST_C +# define S_MP_GET_BIT_C +# define S_MP_INVMOD_FAST_C +# define S_MP_INVMOD_SLOW_C +# define S_MP_KARATSUBA_MUL_C +# define S_MP_KARATSUBA_SQR_C +# define S_MP_MONTGOMERY_REDUCE_FAST_C +# define S_MP_MUL_DIGS_C +# define S_MP_MUL_DIGS_FAST_C +# define S_MP_MUL_HIGH_DIGS_C +# define S_MP_MUL_HIGH_DIGS_FAST_C +# define S_MP_PRIME_IS_DIVISIBLE_C +# define S_MP_RAND_JENKINS_C +# define S_MP_RAND_PLATFORM_C +# define S_MP_REVERSE_C +# define S_MP_SQR_C +# define S_MP_SQR_FAST_C +# define S_MP_SUB_C +# define S_MP_TOOM_MUL_C +# define S_MP_TOOM_SQR_C +#endif +#endif +#if defined(MP_2EXPT_C) +# define MP_GROW_C +# define MP_ZERO_C +#endif + +#if defined(MP_ABS_C) +# define MP_COPY_C +#endif + +#if defined(MP_ADD_C) +# define MP_CMP_MAG_C +# define S_MP_ADD_C +# define S_MP_SUB_C +#endif + +#if defined(MP_ADD_D_C) +# define MP_CLAMP_C +# define MP_GROW_C +# define MP_SUB_D_C +#endif + +#if defined(MP_ADDMOD_C) +# define MP_ADD_C +# define MP_CLEAR_C +# define MP_INIT_C +# define MP_MOD_C +#endif + +#if defined(MP_AND_C) +# define MP_CLAMP_C +# define MP_GROW_C #endif -#if defined(BN_MP_CLAMP_C) +#if defined(MP_CLAMP_C) #endif -#if defined(BN_MP_CLEAR_C) +#if defined(MP_CLEAR_C) #endif -#if defined(BN_MP_CLEAR_MULTI_C) -# define BN_MP_CLEAR_C +#if defined(MP_CLEAR_MULTI_C) +# define MP_CLEAR_C #endif -#if defined(BN_MP_CMP_C) -# define BN_MP_CMP_MAG_C +#if defined(MP_CMP_C) +# define MP_CMP_MAG_C #endif -#if defined(BN_MP_CMP_D_C) +#if defined(MP_CMP_D_C) #endif -#if defined(BN_MP_CMP_MAG_C) +#if defined(MP_CMP_MAG_C) #endif -#if defined(BN_MP_CNT_LSB_C) +#if defined(MP_CNT_LSB_C) #endif -#if defined(BN_MP_COMPLEMENT_C) -# define BN_MP_NEG_C -# define BN_MP_SUB_D_C +#if defined(MP_COMPLEMENT_C) +# define MP_NEG_C +# define MP_SUB_D_C #endif -#if defined(BN_MP_COPY_C) -# define BN_MP_GROW_C +#if defined(MP_COPY_C) +# define MP_GROW_C #endif -#if defined(BN_MP_COUNT_BITS_C) +#if defined(MP_COUNT_BITS_C) #endif -#if defined(BN_MP_DECR_C) -# define BN_MP_INCR_C -# define BN_MP_SET_C -# define BN_MP_SUB_D_C -# define BN_MP_ZERO_C +#if defined(MP_CUTOFFS_C) #endif -#if defined(BN_MP_DIV_C) -# define BN_MP_ADD_C -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_CMP_C -# define BN_MP_CMP_MAG_C -# define BN_MP_COPY_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DIV_2D_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_C -# define BN_MP_INIT_COPY_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_LSHD_C -# define BN_MP_MUL_2D_C -# define BN_MP_MUL_D_C -# define BN_MP_RSHD_C -# define BN_MP_SUB_C -# define BN_MP_ZERO_C +#if defined(MP_DECR_C) +# define MP_INCR_C +# define MP_SET_C +# define MP_SUB_D_C +# define MP_ZERO_C #endif -#if defined(BN_MP_DIV_2_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C +#if defined(MP_DIV_C) +# define MP_ADD_C +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_CMP_C +# define MP_CMP_MAG_C +# define MP_COPY_C +# define MP_COUNT_BITS_C +# define MP_DIV_2D_C +# define MP_EXCH_C +# define MP_INIT_C +# define MP_INIT_COPY_C +# define MP_INIT_SIZE_C +# define MP_LSHD_C +# define MP_MUL_2D_C +# define MP_MUL_D_C +# define MP_RSHD_C +# define MP_SUB_C +# define MP_ZERO_C #endif -#if defined(BN_MP_DIV_2D_C) -# define BN_MP_CLAMP_C -# define BN_MP_COPY_C -# define BN_MP_MOD_2D_C -# define BN_MP_RSHD_C -# define BN_MP_ZERO_C +#if defined(MP_DIV_2_C) +# define MP_CLAMP_C +# define MP_GROW_C #endif -#if defined(BN_MP_DIV_3_C) -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_SIZE_C +#if defined(MP_DIV_2D_C) +# define MP_CLAMP_C +# define MP_COPY_C +# define MP_MOD_2D_C +# define MP_RSHD_C +# define MP_ZERO_C #endif -#if defined(BN_MP_DIV_D_C) -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_COPY_C -# define BN_MP_DIV_2D_C -# define BN_MP_DIV_3_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_SIZE_C +#if defined(MP_DIV_3_C) +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_EXCH_C +# define MP_INIT_SIZE_C #endif -#if defined(BN_MP_DR_IS_MODULUS_C) +#if defined(MP_DIV_D_C) +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_COPY_C +# define MP_DIV_2D_C +# define MP_DIV_3_C +# define MP_EXCH_C +# define MP_INIT_SIZE_C #endif -#if defined(BN_MP_DR_REDUCE_C) -# define BN_MP_CLAMP_C -# define BN_MP_CMP_MAG_C -# define BN_MP_GROW_C -# define BN_S_MP_SUB_C +#if defined(MP_DR_IS_MODULUS_C) #endif -#if defined(BN_MP_DR_SETUP_C) +#if defined(MP_DR_REDUCE_C) +# define MP_CLAMP_C +# define MP_CMP_MAG_C +# define MP_GROW_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_ERROR_TO_STRING_C) +#if defined(MP_DR_SETUP_C) #endif -#if defined(BN_MP_EXCH_C) +#if defined(MP_ERROR_TO_STRING_C) #endif -#if defined(BN_MP_EXPT_U32_C) -# define BN_MP_CLEAR_C -# define BN_MP_INIT_COPY_C -# define BN_MP_MUL_C -# define BN_MP_SET_C -# define BN_MP_SQR_C +#if defined(MP_EXCH_C) #endif -#if defined(BN_MP_EXPTMOD_C) -# define BN_MP_ABS_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_DR_IS_MODULUS_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_INVMOD_C -# define BN_MP_REDUCE_IS_2K_C -# define BN_MP_REDUCE_IS_2K_L_C -# define BN_S_MP_EXPTMOD_C -# define BN_S_MP_EXPTMOD_FAST_C +#if defined(MP_EXPT_U32_C) +# define MP_CLEAR_C +# define MP_INIT_COPY_C +# define MP_MUL_C +# define MP_SET_C +# define MP_SQR_C #endif -#if defined(BN_MP_EXTEUCLID_C) -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_COPY_C -# define BN_MP_DIV_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_MUL_C -# define BN_MP_NEG_C -# define BN_MP_SET_C -# define BN_MP_SUB_C +#if defined(MP_EXPTMOD_C) +# define MP_ABS_C +# define MP_CLEAR_MULTI_C +# define MP_DR_IS_MODULUS_C +# define MP_INIT_MULTI_C +# define MP_INVMOD_C +# define MP_REDUCE_IS_2K_C +# define MP_REDUCE_IS_2K_L_C +# define S_MP_EXPTMOD_C +# define S_MP_EXPTMOD_FAST_C #endif -#if defined(BN_MP_FREAD_C) -# define BN_MP_ADD_D_C -# define BN_MP_MUL_D_C -# define BN_MP_ZERO_C +#if defined(MP_EXTEUCLID_C) +# define MP_CLEAR_MULTI_C +# define MP_COPY_C +# define MP_DIV_C +# define MP_EXCH_C +# define MP_INIT_MULTI_C +# define MP_MUL_C +# define MP_NEG_C +# define MP_SET_C +# define MP_SUB_C #endif -#if defined(BN_MP_FROM_SBIN_C) -# define BN_MP_FROM_UBIN_C +#if defined(MP_FREAD_C) +# define MP_ADD_D_C +# define MP_MUL_D_C +# define MP_ZERO_C #endif -#if defined(BN_MP_FROM_UBIN_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C -# define BN_MP_MUL_2D_C -# define BN_MP_ZERO_C +#if defined(MP_FROM_SBIN_C) +# define MP_FROM_UBIN_C #endif -#if defined(BN_MP_FWRITE_C) -# define BN_MP_RADIX_SIZE_C -# define BN_MP_TO_RADIX_C +#if defined(MP_FROM_UBIN_C) +# define MP_CLAMP_C +# define MP_GROW_C +# define MP_MUL_2D_C +# define MP_ZERO_C #endif -#if defined(BN_MP_GCD_C) -# define BN_MP_ABS_C -# define BN_MP_CLEAR_C -# define BN_MP_CMP_MAG_C -# define BN_MP_CNT_LSB_C -# define BN_MP_DIV_2D_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_COPY_C -# define BN_MP_MUL_2D_C -# define BN_S_MP_SUB_C +#if defined(MP_FWRITE_C) +# define MP_RADIX_SIZE_C +# define MP_TO_RADIX_C #endif -#if defined(BN_MP_GET_DOUBLE_C) +#if defined(MP_GCD_C) +# define MP_ABS_C +# define MP_CLEAR_C +# define MP_CMP_MAG_C +# define MP_CNT_LSB_C +# define MP_DIV_2D_C +# define MP_EXCH_C +# define MP_INIT_COPY_C +# define MP_MUL_2D_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_GET_I32_C) -# define BN_MP_GET_MAG_U32_C +#if defined(MP_GET_DOUBLE_C) #endif -#if defined(BN_MP_GET_I64_C) -# define BN_MP_GET_MAG_U64_C +#if defined(MP_GET_I32_C) +# define MP_GET_MAG_U32_C #endif -#if defined(BN_MP_GET_L_C) -# define BN_MP_GET_MAG_UL_C +#if defined(MP_GET_I64_C) +# define MP_GET_MAG_U64_C #endif -#if defined(BN_MP_GET_LL_C) -# define BN_MP_GET_MAG_ULL_C +#if defined(MP_GET_L_C) +# define MP_GET_MAG_UL_C #endif -#if defined(BN_MP_GET_MAG_U32_C) +#if defined(MP_GET_LL_C) +# define MP_GET_MAG_ULL_C #endif -#if defined(BN_MP_GET_MAG_U64_C) +#if defined(MP_GET_MAG_U32_C) #endif -#if defined(BN_MP_GET_MAG_UL_C) +#if defined(MP_GET_MAG_U64_C) #endif -#if defined(BN_MP_GET_MAG_ULL_C) +#if defined(MP_GET_MAG_UL_C) #endif -#if defined(BN_MP_GROW_C) +#if defined(MP_GET_MAG_ULL_C) #endif -#if defined(BN_MP_INCR_C) -# define BN_MP_ADD_D_C -# define BN_MP_DECR_C -# define BN_MP_SET_C +#if defined(MP_GROW_C) #endif -#if defined(BN_MP_INIT_C) +#if defined(MP_INCR_C) +# define MP_ADD_D_C +# define MP_DECR_C +# define MP_SET_C #endif -#if defined(BN_MP_INIT_COPY_C) -# define BN_MP_CLEAR_C -# define BN_MP_COPY_C -# define BN_MP_INIT_SIZE_C +#if defined(MP_INIT_C) #endif -#if defined(BN_MP_INIT_I32_C) -# define BN_MP_INIT_C -# define BN_MP_SET_I32_C +#if defined(MP_INIT_COPY_C) +# define MP_CLEAR_C +# define MP_COPY_C +# define MP_INIT_SIZE_C #endif -#if defined(BN_MP_INIT_I64_C) -# define BN_MP_INIT_C -# define BN_MP_SET_I64_C +#if defined(MP_INIT_I32_C) +# define MP_INIT_C +# define MP_SET_I32_C #endif -#if defined(BN_MP_INIT_L_C) -# define BN_MP_INIT_C -# define BN_MP_SET_L_C +#if defined(MP_INIT_I64_C) +# define MP_INIT_C +# define MP_SET_I64_C #endif -#if defined(BN_MP_INIT_LL_C) -# define BN_MP_INIT_C -# define BN_MP_SET_LL_C +#if defined(MP_INIT_L_C) +# define MP_INIT_C +# define MP_SET_L_C #endif -#if defined(BN_MP_INIT_MULTI_C) -# define BN_MP_CLEAR_C -# define BN_MP_INIT_C +#if defined(MP_INIT_LL_C) +# define MP_INIT_C +# define MP_SET_LL_C #endif -#if defined(BN_MP_INIT_SET_C) -# define BN_MP_INIT_C -# define BN_MP_SET_C +#if defined(MP_INIT_MULTI_C) +# define MP_CLEAR_C +# define MP_INIT_C #endif -#if defined(BN_MP_INIT_SIZE_C) +#if defined(MP_INIT_SET_C) +# define MP_INIT_C +# define MP_SET_C #endif -#if defined(BN_MP_INIT_U32_C) -# define BN_MP_INIT_C -# define BN_MP_SET_U32_C +#if defined(MP_INIT_SIZE_C) #endif -#if defined(BN_MP_INIT_U64_C) -# define BN_MP_INIT_C -# define BN_MP_SET_U64_C +#if defined(MP_INIT_U32_C) +# define MP_INIT_C +# define MP_SET_U32_C #endif -#if defined(BN_MP_INIT_UL_C) -# define BN_MP_INIT_C -# define BN_MP_SET_UL_C +#if defined(MP_INIT_U64_C) +# define MP_INIT_C +# define MP_SET_U64_C #endif -#if defined(BN_MP_INIT_ULL_C) -# define BN_MP_INIT_C -# define BN_MP_SET_ULL_C +#if defined(MP_INIT_UL_C) +# define MP_INIT_C +# define MP_SET_UL_C #endif -#if defined(BN_MP_INVMOD_C) -# define BN_MP_CMP_D_C -# define BN_S_MP_INVMOD_FAST_C -# define BN_S_MP_INVMOD_SLOW_C +#if defined(MP_INIT_ULL_C) +# define MP_INIT_C +# define MP_SET_ULL_C #endif -#if defined(BN_MP_IS_SQUARE_C) -# define BN_MP_CLEAR_C -# define BN_MP_CMP_MAG_C -# define BN_MP_GET_I32_C -# define BN_MP_INIT_U32_C -# define BN_MP_MOD_C -# define BN_MP_MOD_D_C -# define BN_MP_SQRT_C -# define BN_MP_SQR_C +#if defined(MP_INVMOD_C) +# define MP_CMP_D_C +# define S_MP_INVMOD_FAST_C +# define S_MP_INVMOD_SLOW_C #endif -#if defined(BN_MP_ISEVEN_C) +#if defined(MP_IS_SQUARE_C) +# define MP_CLEAR_C +# define MP_CMP_MAG_C +# define MP_GET_I32_C +# define MP_INIT_U32_C +# define MP_MOD_C +# define MP_MOD_D_C +# define MP_SQRT_C +# define MP_SQR_C #endif -#if defined(BN_MP_ISODD_C) +#if defined(MP_ISEVEN_C) #endif -#if defined(BN_MP_KRONECKER_C) -# define BN_MP_CLEAR_C -# define BN_MP_CMP_D_C -# define BN_MP_CNT_LSB_C -# define BN_MP_COPY_C -# define BN_MP_DIV_2D_C -# define BN_MP_INIT_C -# define BN_MP_INIT_COPY_C -# define BN_MP_MOD_C +#if defined(MP_ISODD_C) #endif -#if defined(BN_MP_LCM_C) -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_MAG_C -# define BN_MP_DIV_C -# define BN_MP_GCD_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_MUL_C +#if defined(MP_KRONECKER_C) +# define MP_CLEAR_C +# define MP_CMP_D_C +# define MP_CNT_LSB_C +# define MP_COPY_C +# define MP_DIV_2D_C +# define MP_INIT_C +# define MP_INIT_COPY_C +# define MP_MOD_C #endif -#if defined(BN_MP_LOG_U32_C) -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_COPY_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_EXCH_C -# define BN_MP_EXPT_U32_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_MUL_C -# define BN_MP_SET_C -# define BN_MP_SQR_C +#if defined(MP_LCM_C) +# define MP_CLEAR_MULTI_C +# define MP_CMP_MAG_C +# define MP_DIV_C +# define MP_GCD_C +# define MP_INIT_MULTI_C +# define MP_MUL_C #endif -#if defined(BN_MP_LSHD_C) -# define BN_MP_GROW_C +#if defined(MP_LOG_U32_C) +# define MP_CLEAR_MULTI_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_COPY_C +# define MP_COUNT_BITS_C +# define MP_EXCH_C +# define MP_EXPT_U32_C +# define MP_INIT_MULTI_C +# define MP_MUL_C +# define MP_SET_C +# define MP_SQR_C #endif -#if defined(BN_MP_MOD_C) -# define BN_MP_ADD_C -# define BN_MP_CLEAR_C -# define BN_MP_DIV_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_SIZE_C +#if defined(MP_LSHD_C) +# define MP_GROW_C #endif -#if defined(BN_MP_MOD_2D_C) -# define BN_MP_CLAMP_C -# define BN_MP_COPY_C -# define BN_MP_ZERO_C +#if defined(MP_MOD_C) +# define MP_ADD_C +# define MP_CLEAR_C +# define MP_DIV_C +# define MP_EXCH_C +# define MP_INIT_SIZE_C #endif -#if defined(BN_MP_MOD_D_C) -# define BN_MP_DIV_D_C +#if defined(MP_MOD_2D_C) +# define MP_CLAMP_C +# define MP_COPY_C +# define MP_ZERO_C #endif -#if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C) -# define BN_MP_2EXPT_C -# define BN_MP_CMP_MAG_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_MUL_2_C -# define BN_MP_SET_C -# define BN_S_MP_SUB_C +#if defined(MP_MOD_D_C) +# define MP_DIV_D_C #endif -#if defined(BN_MP_MONTGOMERY_REDUCE_C) -# define BN_MP_CLAMP_C -# define BN_MP_CMP_MAG_C -# define BN_MP_GROW_C -# define BN_MP_RSHD_C -# define BN_S_MP_MONTGOMERY_REDUCE_FAST_C -# define BN_S_MP_SUB_C +#if defined(MP_MONTGOMERY_CALC_NORMALIZATION_C) +# define MP_2EXPT_C +# define MP_CMP_MAG_C +# define MP_COUNT_BITS_C +# define MP_MUL_2_C +# define MP_SET_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_MONTGOMERY_SETUP_C) +#if defined(MP_MONTGOMERY_REDUCE_C) +# define MP_CLAMP_C +# define MP_CMP_MAG_C +# define MP_GROW_C +# define MP_RSHD_C +# define S_MP_MONTGOMERY_REDUCE_FAST_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_MUL_C) -# define BN_S_MP_BALANCE_MUL_C -# define BN_S_MP_KARATSUBA_MUL_C -# define BN_S_MP_MUL_DIGS_C -# define BN_S_MP_MUL_DIGS_FAST_C -# define BN_S_MP_TOOM_MUL_C +#if defined(MP_MONTGOMERY_SETUP_C) #endif -#if defined(BN_MP_MUL_2_C) -# define BN_MP_GROW_C +#if defined(MP_MUL_C) +# define S_MP_BALANCE_MUL_C +# define S_MP_KARATSUBA_MUL_C +# define S_MP_MUL_DIGS_C +# define S_MP_MUL_DIGS_FAST_C +# define S_MP_TOOM_MUL_C #endif -#if defined(BN_MP_MUL_2D_C) -# define BN_MP_CLAMP_C -# define BN_MP_COPY_C -# define BN_MP_GROW_C -# define BN_MP_LSHD_C +#if defined(MP_MUL_2_C) +# define MP_GROW_C #endif -#if defined(BN_MP_MUL_D_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C +#if defined(MP_MUL_2D_C) +# define MP_CLAMP_C +# define MP_COPY_C +# define MP_GROW_C +# define MP_LSHD_C #endif -#if defined(BN_MP_MULMOD_C) -# define BN_MP_CLEAR_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_MOD_C -# define BN_MP_MUL_C +#if defined(MP_MUL_D_C) +# define MP_CLAMP_C +# define MP_GROW_C #endif -#if defined(BN_MP_NEG_C) -# define BN_MP_COPY_C -#endif - -#if defined(BN_MP_OR_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C +#if defined(MP_MULMOD_C) +# define MP_CLEAR_C +# define MP_INIT_SIZE_C +# define MP_MOD_C +# define MP_MUL_C #endif -#if defined(BN_MP_PACK_C) -# define BN_MP_CLEAR_C -# define BN_MP_DIV_2D_C -# define BN_MP_INIT_COPY_C -# define BN_MP_PACK_COUNT_C -#endif - -#if defined(BN_MP_PACK_COUNT_C) -# define BN_MP_COUNT_BITS_C -#endif - -#if defined(BN_MP_PRIME_FERMAT_C) -# define BN_MP_CLEAR_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_EXPTMOD_C -# define BN_MP_INIT_C -#endif - -#if defined(BN_MP_PRIME_FROBENIUS_UNDERWOOD_C) -# define BN_MP_ADD_C -# define BN_MP_ADD_D_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_EXCH_C -# define BN_MP_GCD_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_KRONECKER_C -# define BN_MP_MOD_C -# define BN_MP_MUL_2_C -# define BN_MP_MUL_C -# define BN_MP_MUL_D_C -# define BN_MP_SET_C -# define BN_MP_SET_U32_C -# define BN_MP_SQR_C -# define BN_MP_SUB_C -# define BN_MP_SUB_D_C -# define BN_S_MP_GET_BIT_C -#endif - -#if defined(BN_MP_PRIME_IS_PRIME_C) -# define BN_MP_CLEAR_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DIV_2D_C -# define BN_MP_INIT_SET_C -# define BN_MP_IS_SQUARE_C -# define BN_MP_PRIME_MILLER_RABIN_C -# define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C -# define BN_MP_RAND_C -# define BN_MP_READ_RADIX_C -# define BN_MP_SET_C -# define BN_S_MP_PRIME_IS_DIVISIBLE_C -#endif - -#if defined(BN_MP_PRIME_MILLER_RABIN_C) -# define BN_MP_CLEAR_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_CNT_LSB_C -# define BN_MP_DIV_2D_C -# define BN_MP_EXPTMOD_C -# define BN_MP_INIT_C -# define BN_MP_INIT_COPY_C -# define BN_MP_SQRMOD_C -# define BN_MP_SUB_D_C -#endif - -#if defined(BN_MP_PRIME_NEXT_PRIME_C) -# define BN_MP_ADD_D_C -# define BN_MP_CLEAR_C -# define BN_MP_CMP_D_C -# define BN_MP_INIT_C -# define BN_MP_MOD_D_C -# define BN_MP_PRIME_IS_PRIME_C -# define BN_MP_SET_C -# define BN_MP_SUB_D_C -#endif - -#if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C) -#endif - -#if defined(BN_MP_PRIME_RAND_C) -# define BN_MP_ADD_D_C -# define BN_MP_DIV_2_C -# define BN_MP_FROM_UBIN_C -# define BN_MP_MUL_2_C -# define BN_MP_PRIME_IS_PRIME_C -# define BN_MP_SUB_D_C -# define BN_S_MP_PRIME_RANDOM_EX_C -# define BN_S_MP_RAND_CB_C -# define BN_S_MP_RAND_SOURCE_C -#endif - -#if defined(BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C) -# define BN_MP_ADD_C -# define BN_MP_ADD_D_C -# define BN_MP_CLEAR_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_CNT_LSB_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DIV_2D_C -# define BN_MP_DIV_2_C -# define BN_MP_GCD_C -# define BN_MP_INIT_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_KRONECKER_C -# define BN_MP_MOD_C -# define BN_MP_MUL_2_C -# define BN_MP_MUL_C -# define BN_MP_SET_C -# define BN_MP_SET_I32_C -# define BN_MP_SET_U32_C -# define BN_MP_SQR_C -# define BN_MP_SUB_C -# define BN_MP_SUB_D_C -# define BN_S_MP_GET_BIT_C -# define BN_S_MP_MUL_SI_C -#endif - -#if defined(BN_MP_RADIX_SIZE_C) -# define BN_MP_LOG_U32_C -#endif - -#if defined(BN_MP_RADIX_SMAP_C) -#endif - -#if defined(BN_MP_RAND_C) -# define BN_MP_GROW_C -# define BN_MP_RAND_SOURCE_C -# define BN_MP_ZERO_C -# define BN_S_MP_RAND_PLATFORM_C -# define BN_S_MP_RAND_SOURCE_C -#endif - -#if defined(BN_MP_READ_RADIX_C) -# define BN_MP_ADD_D_C -# define BN_MP_MUL_D_C -# define BN_MP_ZERO_C -#endif - -#if defined(BN_MP_REDUCE_C) -# define BN_MP_ADD_C -# define BN_MP_CLEAR_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_INIT_COPY_C -# define BN_MP_LSHD_C -# define BN_MP_MOD_2D_C -# define BN_MP_MUL_C -# define BN_MP_RSHD_C -# define BN_MP_SET_C -# define BN_MP_SUB_C -# define BN_S_MP_MUL_DIGS_C -# define BN_S_MP_MUL_HIGH_DIGS_C -# define BN_S_MP_MUL_HIGH_DIGS_FAST_C -# define BN_S_MP_SUB_C +#if defined(MP_NEG_C) +# define MP_COPY_C +#endif + +#if defined(MP_OR_C) +# define MP_CLAMP_C +# define MP_GROW_C #endif -#if defined(BN_MP_REDUCE_2K_C) -# define BN_MP_CLEAR_C -# define BN_MP_CMP_MAG_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DIV_2D_C -# define BN_MP_INIT_C -# define BN_MP_MUL_D_C -# define BN_S_MP_ADD_C -# define BN_S_MP_SUB_C +#if defined(MP_PACK_C) +# define MP_CLEAR_C +# define MP_DIV_2D_C +# define MP_INIT_COPY_C +# define MP_PACK_COUNT_C +#endif + +#if defined(MP_PACK_COUNT_C) +# define MP_COUNT_BITS_C +#endif + +#if defined(MP_PRIME_FERMAT_C) +# define MP_CLEAR_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_EXPTMOD_C +# define MP_INIT_C +#endif + +#if defined(MP_PRIME_FROBENIUS_UNDERWOOD_C) +# define MP_ADD_C +# define MP_ADD_D_C +# define MP_CLEAR_MULTI_C +# define MP_CMP_C +# define MP_COUNT_BITS_C +# define MP_EXCH_C +# define MP_GCD_C +# define MP_INIT_MULTI_C +# define MP_KRONECKER_C +# define MP_MOD_C +# define MP_MUL_2_C +# define MP_MUL_C +# define MP_MUL_D_C +# define MP_SET_C +# define MP_SET_U32_C +# define MP_SQR_C +# define MP_SUB_C +# define MP_SUB_D_C +# define S_MP_GET_BIT_C +#endif + +#if defined(MP_PRIME_IS_PRIME_C) +# define MP_CLEAR_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_COUNT_BITS_C +# define MP_DIV_2D_C +# define MP_INIT_SET_C +# define MP_IS_SQUARE_C +# define MP_PRIME_MILLER_RABIN_C +# define MP_PRIME_STRONG_LUCAS_SELFRIDGE_C +# define MP_RAND_C +# define MP_READ_RADIX_C +# define MP_SET_C +# define S_MP_PRIME_IS_DIVISIBLE_C +#endif + +#if defined(MP_PRIME_MILLER_RABIN_C) +# define MP_CLEAR_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_CNT_LSB_C +# define MP_DIV_2D_C +# define MP_EXPTMOD_C +# define MP_INIT_C +# define MP_INIT_COPY_C +# define MP_SQRMOD_C +# define MP_SUB_D_C +#endif + +#if defined(MP_PRIME_NEXT_PRIME_C) +# define MP_ADD_D_C +# define MP_CLEAR_C +# define MP_CMP_D_C +# define MP_INIT_C +# define MP_MOD_D_C +# define MP_PRIME_IS_PRIME_C +# define MP_SET_C +# define MP_SUB_D_C +#endif + +#if defined(MP_PRIME_RABIN_MILLER_TRIALS_C) +#endif + +#if defined(MP_PRIME_RAND_C) +# define MP_ADD_D_C +# define MP_DIV_2_C +# define MP_FROM_UBIN_C +# define MP_MUL_2_C +# define MP_PRIME_IS_PRIME_C +# define MP_SUB_D_C +# define S_MP_PRIME_RANDOM_EX_C +# define S_MP_RAND_CB_C +# define S_MP_RAND_SOURCE_C +#endif + +#if defined(MP_PRIME_STRONG_LUCAS_SELFRIDGE_C) +# define MP_ADD_C +# define MP_ADD_D_C +# define MP_CLEAR_C +# define MP_CLEAR_MULTI_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_CNT_LSB_C +# define MP_COUNT_BITS_C +# define MP_DIV_2D_C +# define MP_DIV_2_C +# define MP_GCD_C +# define MP_INIT_C +# define MP_INIT_MULTI_C +# define MP_KRONECKER_C +# define MP_MOD_C +# define MP_MUL_2_C +# define MP_MUL_C +# define MP_SET_C +# define MP_SET_I32_C +# define MP_SET_U32_C +# define MP_SQR_C +# define MP_SUB_C +# define MP_SUB_D_C +# define S_MP_GET_BIT_C +# define S_MP_MUL_SI_C +#endif + +#if defined(MP_PRIME_TAB_C) +#endif + +#if defined(MP_RADIX_SIZE_C) +# define MP_LOG_U32_C +#endif + +#if defined(MP_RADIX_SMAP_C) +#endif + +#if defined(MP_RAND_C) +# define MP_GROW_C +# define MP_RAND_SOURCE_C +# define MP_ZERO_C +# define S_MP_RAND_PLATFORM_C +# define S_MP_RAND_SOURCE_C +#endif + +#if defined(MP_READ_RADIX_C) +# define MP_ADD_D_C +# define MP_MUL_D_C +# define MP_ZERO_C +#endif + +#if defined(MP_REDUCE_C) +# define MP_ADD_C +# define MP_CLEAR_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_INIT_COPY_C +# define MP_LSHD_C +# define MP_MOD_2D_C +# define MP_MUL_C +# define MP_RSHD_C +# define MP_SET_C +# define MP_SUB_C +# define S_MP_MUL_DIGS_C +# define S_MP_MUL_HIGH_DIGS_C +# define S_MP_MUL_HIGH_DIGS_FAST_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_REDUCE_2K_L_C) -# define BN_MP_CLEAR_C -# define BN_MP_CMP_MAG_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DIV_2D_C -# define BN_MP_INIT_C -# define BN_MP_MUL_C -# define BN_S_MP_ADD_C -# define BN_S_MP_SUB_C +#if defined(MP_REDUCE_2K_C) +# define MP_CLEAR_C +# define MP_CMP_MAG_C +# define MP_COUNT_BITS_C +# define MP_DIV_2D_C +# define MP_INIT_C +# define MP_MUL_D_C +# define S_MP_ADD_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_REDUCE_2K_SETUP_C) -# define BN_MP_2EXPT_C -# define BN_MP_CLEAR_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_INIT_C -# define BN_S_MP_SUB_C +#if defined(MP_REDUCE_2K_L_C) +# define MP_CLEAR_C +# define MP_CMP_MAG_C +# define MP_COUNT_BITS_C +# define MP_DIV_2D_C +# define MP_INIT_C +# define MP_MUL_C +# define S_MP_ADD_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_REDUCE_2K_SETUP_L_C) -# define BN_MP_2EXPT_C -# define BN_MP_CLEAR_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_INIT_C -# define BN_S_MP_SUB_C +#if defined(MP_REDUCE_2K_SETUP_C) +# define MP_2EXPT_C +# define MP_CLEAR_C +# define MP_COUNT_BITS_C +# define MP_INIT_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_REDUCE_IS_2K_C) -# define BN_MP_COUNT_BITS_C +#if defined(MP_REDUCE_2K_SETUP_L_C) +# define MP_2EXPT_C +# define MP_CLEAR_C +# define MP_COUNT_BITS_C +# define MP_INIT_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_REDUCE_IS_2K_L_C) +#if defined(MP_REDUCE_IS_2K_C) +# define MP_COUNT_BITS_C #endif -#if defined(BN_MP_REDUCE_SETUP_C) -# define BN_MP_2EXPT_C -# define BN_MP_DIV_C +#if defined(MP_REDUCE_IS_2K_L_C) #endif -#if defined(BN_MP_ROOT_U32_C) -# define BN_MP_2EXPT_C -# define BN_MP_ADD_D_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_C -# define BN_MP_COPY_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DIV_C -# define BN_MP_EXCH_C -# define BN_MP_EXPT_U32_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_MUL_C -# define BN_MP_MUL_D_C -# define BN_MP_SET_C -# define BN_MP_SUB_C -# define BN_MP_SUB_D_C +#if defined(MP_REDUCE_SETUP_C) +# define MP_2EXPT_C +# define MP_DIV_C #endif -#if defined(BN_MP_RSHD_C) -# define BN_MP_ZERO_C +#if defined(MP_ROOT_U32_C) +# define MP_2EXPT_C +# define MP_ADD_D_C +# define MP_CLEAR_MULTI_C +# define MP_CMP_C +# define MP_COPY_C +# define MP_COUNT_BITS_C +# define MP_DIV_C +# define MP_EXCH_C +# define MP_EXPT_U32_C +# define MP_INIT_MULTI_C +# define MP_MUL_C +# define MP_MUL_D_C +# define MP_SET_C +# define MP_SUB_C +# define MP_SUB_D_C #endif -#if defined(BN_MP_SBIN_SIZE_C) -# define BN_MP_UBIN_SIZE_C +#if defined(MP_RSHD_C) +# define MP_ZERO_C #endif -#if defined(BN_MP_SET_C) +#if defined(MP_SBIN_SIZE_C) +# define MP_UBIN_SIZE_C #endif -#if defined(BN_MP_SET_DOUBLE_C) -# define BN_MP_DIV_2D_C -# define BN_MP_MUL_2D_C -# define BN_MP_SET_U64_C +#if defined(MP_SET_C) #endif -#if defined(BN_MP_SET_I32_C) -# define BN_MP_SET_U32_C +#if defined(MP_SET_DOUBLE_C) +# define MP_DIV_2D_C +# define MP_MUL_2D_C +# define MP_SET_U64_C #endif -#if defined(BN_MP_SET_I64_C) -# define BN_MP_SET_U64_C +#if defined(MP_SET_I32_C) +# define MP_SET_U32_C #endif -#if defined(BN_MP_SET_L_C) -# define BN_MP_SET_UL_C +#if defined(MP_SET_I64_C) +# define MP_SET_U64_C #endif -#if defined(BN_MP_SET_LL_C) -# define BN_MP_SET_ULL_C +#if defined(MP_SET_L_C) +# define MP_SET_UL_C #endif -#if defined(BN_MP_SET_U32_C) +#if defined(MP_SET_LL_C) +# define MP_SET_ULL_C #endif -#if defined(BN_MP_SET_U64_C) +#if defined(MP_SET_U32_C) #endif -#if defined(BN_MP_SET_UL_C) +#if defined(MP_SET_U64_C) #endif -#if defined(BN_MP_SET_ULL_C) +#if defined(MP_SET_UL_C) #endif -#if defined(BN_MP_SHRINK_C) +#if defined(MP_SET_ULL_C) #endif -#if defined(BN_MP_SIGNED_RSH_C) -# define BN_MP_ADD_D_C -# define BN_MP_DIV_2D_C -# define BN_MP_SUB_D_C +#if defined(MP_SHRINK_C) #endif -#if defined(BN_MP_SQR_C) -# define BN_S_MP_KARATSUBA_SQR_C -# define BN_S_MP_SQR_C -# define BN_S_MP_SQR_FAST_C -# define BN_S_MP_TOOM_SQR_C +#if defined(MP_SIGNED_RSH_C) +# define MP_ADD_D_C +# define MP_DIV_2D_C +# define MP_SUB_D_C #endif -#if defined(BN_MP_SQRMOD_C) -# define BN_MP_CLEAR_C -# define BN_MP_INIT_C -# define BN_MP_MOD_C -# define BN_MP_SQR_C +#if defined(MP_SQR_C) +# define S_MP_KARATSUBA_SQR_C +# define S_MP_SQR_C +# define S_MP_SQR_FAST_C +# define S_MP_TOOM_SQR_C #endif -#if defined(BN_MP_SQRT_C) -# define BN_MP_ADD_C -# define BN_MP_CLEAR_C -# define BN_MP_CMP_MAG_C -# define BN_MP_DIV_2_C -# define BN_MP_DIV_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_C -# define BN_MP_INIT_COPY_C -# define BN_MP_RSHD_C -# define BN_MP_ZERO_C +#if defined(MP_SQRMOD_C) +# define MP_CLEAR_C +# define MP_INIT_C +# define MP_MOD_C +# define MP_SQR_C #endif -#if defined(BN_MP_SQRTMOD_PRIME_C) -# define BN_MP_ADD_D_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_D_C -# define BN_MP_COPY_C -# define BN_MP_DIV_2_C -# define BN_MP_EXPTMOD_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_KRONECKER_C -# define BN_MP_MOD_D_C -# define BN_MP_MULMOD_C -# define BN_MP_SET_C -# define BN_MP_SET_U32_C -# define BN_MP_SQRMOD_C -# define BN_MP_SUB_D_C -# define BN_MP_ZERO_C +#if defined(MP_SQRT_C) +# define MP_ADD_C +# define MP_CLEAR_C +# define MP_CMP_MAG_C +# define MP_DIV_2_C +# define MP_DIV_C +# define MP_EXCH_C +# define MP_INIT_C +# define MP_INIT_COPY_C +# define MP_RSHD_C +# define MP_ZERO_C #endif -#if defined(BN_MP_SUB_C) -# define BN_MP_CMP_MAG_C -# define BN_S_MP_ADD_C -# define BN_S_MP_SUB_C +#if defined(MP_SQRTMOD_PRIME_C) +# define MP_ADD_D_C +# define MP_CLEAR_MULTI_C +# define MP_CMP_D_C +# define MP_COPY_C +# define MP_DIV_2_C +# define MP_EXPTMOD_C +# define MP_INIT_MULTI_C +# define MP_KRONECKER_C +# define MP_MOD_D_C +# define MP_MULMOD_C +# define MP_SET_C +# define MP_SET_U32_C +# define MP_SQRMOD_C +# define MP_SUB_D_C +# define MP_ZERO_C #endif -#if defined(BN_MP_SUB_D_C) -# define BN_MP_ADD_D_C -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C +#if defined(MP_SUB_C) +# define MP_CMP_MAG_C +# define S_MP_ADD_C +# define S_MP_SUB_C #endif -#if defined(BN_MP_SUBMOD_C) -# define BN_MP_CLEAR_C -# define BN_MP_INIT_C -# define BN_MP_MOD_C -# define BN_MP_SUB_C +#if defined(MP_SUB_D_C) +# define MP_ADD_D_C +# define MP_CLAMP_C +# define MP_GROW_C #endif -#if defined(BN_MP_TO_RADIX_C) -# define BN_MP_CLEAR_C -# define BN_MP_DIV_D_C -# define BN_MP_INIT_COPY_C -# define BN_S_MP_REVERSE_C +#if defined(MP_SUBMOD_C) +# define MP_CLEAR_C +# define MP_INIT_C +# define MP_MOD_C +# define MP_SUB_C #endif -#if defined(BN_MP_TO_SBIN_C) -# define BN_MP_TO_UBIN_C +#if defined(MP_TO_RADIX_C) +# define MP_CLEAR_C +# define MP_DIV_D_C +# define MP_INIT_COPY_C +# define S_MP_REVERSE_C #endif -#if defined(BN_MP_TO_UBIN_C) -# define BN_MP_CLEAR_C -# define BN_MP_DIV_2D_C -# define BN_MP_INIT_COPY_C -# define BN_MP_UBIN_SIZE_C +#if defined(MP_TO_SBIN_C) +# define MP_TO_UBIN_C #endif -#if defined(BN_MP_UBIN_SIZE_C) -# define BN_MP_COUNT_BITS_C +#if defined(MP_TO_UBIN_C) +# define MP_CLEAR_C +# define MP_DIV_2D_C +# define MP_INIT_COPY_C +# define MP_UBIN_SIZE_C #endif -#if defined(BN_MP_UNPACK_C) -# define BN_MP_CLAMP_C -# define BN_MP_MUL_2D_C -# define BN_MP_ZERO_C -#endif - -#if defined(BN_MP_XOR_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C -#endif - -#if defined(BN_MP_ZERO_C) -#endif - -#if defined(BN_PRIME_TAB_C) -#endif - -#if defined(BN_S_MP_ADD_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C -#endif - -#if defined(BN_S_MP_BALANCE_MUL_C) -# define BN_MP_ADD_C -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_LSHD_C -# define BN_MP_MUL_C -#endif - -#if defined(BN_S_MP_EXPTMOD_C) -# define BN_MP_CLEAR_C -# define BN_MP_COPY_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_C -# define BN_MP_MOD_C -# define BN_MP_MUL_C -# define BN_MP_REDUCE_2K_L_C -# define BN_MP_REDUCE_2K_SETUP_L_C -# define BN_MP_REDUCE_C -# define BN_MP_REDUCE_SETUP_C -# define BN_MP_SET_C -# define BN_MP_SQR_C -#endif - -#if defined(BN_S_MP_EXPTMOD_FAST_C) -# define BN_MP_CLEAR_C -# define BN_MP_COPY_C -# define BN_MP_COUNT_BITS_C -# define BN_MP_DR_REDUCE_C -# define BN_MP_DR_SETUP_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_MOD_C -# define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C -# define BN_MP_MONTGOMERY_REDUCE_C -# define BN_MP_MONTGOMERY_SETUP_C -# define BN_MP_MULMOD_C -# define BN_MP_MUL_C -# define BN_MP_REDUCE_2K_C -# define BN_MP_REDUCE_2K_SETUP_C -# define BN_MP_SET_C -# define BN_MP_SQR_C -# define BN_S_MP_MONTGOMERY_REDUCE_FAST_C +#if defined(MP_UBIN_SIZE_C) +# define MP_COUNT_BITS_C +#endif + +#if defined(MP_UNPACK_C) +# define MP_CLAMP_C +# define MP_MUL_2D_C +# define MP_ZERO_C +#endif + +#if defined(MP_XOR_C) +# define MP_CLAMP_C +# define MP_GROW_C +#endif + +#if defined(MP_ZERO_C) +#endif + +#if defined(S_MP_ADD_C) +# define MP_CLAMP_C +# define MP_GROW_C +#endif + +#if defined(S_MP_BALANCE_MUL_C) +# define MP_ADD_C +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_CLEAR_MULTI_C +# define MP_EXCH_C +# define MP_INIT_MULTI_C +# define MP_INIT_SIZE_C +# define MP_LSHD_C +# define MP_MUL_C +#endif + +#if defined(S_MP_EXPTMOD_C) +# define MP_CLEAR_C +# define MP_COPY_C +# define MP_COUNT_BITS_C +# define MP_EXCH_C +# define MP_INIT_C +# define MP_MOD_C +# define MP_MUL_C +# define MP_REDUCE_2K_L_C +# define MP_REDUCE_2K_SETUP_L_C +# define MP_REDUCE_C +# define MP_REDUCE_SETUP_C +# define MP_SET_C +# define MP_SQR_C +#endif + +#if defined(S_MP_EXPTMOD_FAST_C) +# define MP_CLEAR_C +# define MP_COPY_C +# define MP_COUNT_BITS_C +# define MP_DR_REDUCE_C +# define MP_DR_SETUP_C +# define MP_EXCH_C +# define MP_INIT_SIZE_C +# define MP_MOD_C +# define MP_MONTGOMERY_CALC_NORMALIZATION_C +# define MP_MONTGOMERY_REDUCE_C +# define MP_MONTGOMERY_SETUP_C +# define MP_MULMOD_C +# define MP_MUL_C +# define MP_REDUCE_2K_C +# define MP_REDUCE_2K_SETUP_C +# define MP_SET_C +# define MP_SQR_C +# define S_MP_MONTGOMERY_REDUCE_FAST_C #endif -#if defined(BN_S_MP_GET_BIT_C) +#if defined(S_MP_GET_BIT_C) #endif -#if defined(BN_S_MP_INVMOD_FAST_C) -# define BN_MP_ADD_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_CMP_MAG_C -# define BN_MP_COPY_C -# define BN_MP_DIV_2_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_MOD_C -# define BN_MP_SET_C -# define BN_MP_SUB_C +#if defined(S_MP_INVMOD_FAST_C) +# define MP_ADD_C +# define MP_CLEAR_MULTI_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_CMP_MAG_C +# define MP_COPY_C +# define MP_DIV_2_C +# define MP_EXCH_C +# define MP_INIT_MULTI_C +# define MP_MOD_C +# define MP_SET_C +# define MP_SUB_C #endif -#if defined(BN_S_MP_INVMOD_SLOW_C) -# define BN_MP_ADD_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_CMP_C -# define BN_MP_CMP_D_C -# define BN_MP_CMP_MAG_C -# define BN_MP_COPY_C -# define BN_MP_DIV_2_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_MOD_C -# define BN_MP_SET_C -# define BN_MP_SUB_C -#endif - -#if defined(BN_S_MP_KARATSUBA_MUL_C) -# define BN_MP_ADD_C -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_LSHD_C -# define BN_MP_MUL_C -# define BN_S_MP_ADD_C -# define BN_S_MP_SUB_C -#endif - -#if defined(BN_S_MP_KARATSUBA_SQR_C) -# define BN_MP_ADD_C -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_LSHD_C -# define BN_MP_SQR_C -# define BN_S_MP_ADD_C -# define BN_S_MP_SUB_C -#endif - -#if defined(BN_S_MP_MONTGOMERY_REDUCE_FAST_C) -# define BN_MP_CLAMP_C -# define BN_MP_CMP_MAG_C -# define BN_MP_GROW_C -# define BN_S_MP_SUB_C -#endif - -#if defined(BN_S_MP_MUL_DIGS_C) -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_SIZE_C -# define BN_S_MP_MUL_DIGS_FAST_C -#endif - -#if defined(BN_S_MP_MUL_DIGS_FAST_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C -#endif - -#if defined(BN_S_MP_MUL_HIGH_DIGS_C) -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_SIZE_C -# define BN_S_MP_MUL_HIGH_DIGS_FAST_C -#endif - -#if defined(BN_S_MP_MUL_HIGH_DIGS_FAST_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C -#endif - -#if defined(BN_S_MP_PRIME_IS_DIVISIBLE_C) -# define BN_MP_MOD_D_C -#endif +#if defined(S_MP_INVMOD_SLOW_C) +# define MP_ADD_C +# define MP_CLEAR_MULTI_C +# define MP_CMP_C +# define MP_CMP_D_C +# define MP_CMP_MAG_C +# define MP_COPY_C +# define MP_DIV_2_C +# define MP_EXCH_C +# define MP_INIT_MULTI_C +# define MP_MOD_C +# define MP_SET_C +# define MP_SUB_C +#endif + +#if defined(S_MP_KARATSUBA_MUL_C) +# define MP_ADD_C +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_INIT_SIZE_C +# define MP_LSHD_C +# define MP_MUL_C +# define S_MP_ADD_C +# define S_MP_SUB_C +#endif + +#if defined(S_MP_KARATSUBA_SQR_C) +# define MP_ADD_C +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_INIT_SIZE_C +# define MP_LSHD_C +# define MP_SQR_C +# define S_MP_ADD_C +# define S_MP_SUB_C +#endif + +#if defined(S_MP_MONTGOMERY_REDUCE_FAST_C) +# define MP_CLAMP_C +# define MP_CMP_MAG_C +# define MP_GROW_C +# define S_MP_SUB_C +#endif + +#if defined(S_MP_MUL_DIGS_C) +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_EXCH_C +# define MP_INIT_SIZE_C +# define S_MP_MUL_DIGS_FAST_C +#endif + +#if defined(S_MP_MUL_DIGS_FAST_C) +# define MP_CLAMP_C +# define MP_GROW_C +#endif + +#if defined(S_MP_MUL_HIGH_DIGS_C) +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_EXCH_C +# define MP_INIT_SIZE_C +# define S_MP_MUL_HIGH_DIGS_FAST_C +#endif + +#if defined(S_MP_MUL_HIGH_DIGS_FAST_C) +# define MP_CLAMP_C +# define MP_GROW_C +#endif + +#if defined(S_MP_PRIME_IS_DIVISIBLE_C) +# define MP_MOD_D_C +#endif -#if defined(BN_S_MP_RAND_JENKINS_C) -# define BN_S_MP_RAND_JENKINS_INIT_C +#if defined(S_MP_RAND_JENKINS_C) +# define S_MP_RAND_JENKINS_INIT_C #endif -#if defined(BN_S_MP_RAND_PLATFORM_C) +#if defined(S_MP_RAND_PLATFORM_C) #endif -#if defined(BN_S_MP_REVERSE_C) +#if defined(S_MP_REVERSE_C) #endif -#if defined(BN_S_MP_SQR_C) -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_EXCH_C -# define BN_MP_INIT_SIZE_C +#if defined(S_MP_SQR_C) +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_EXCH_C +# define MP_INIT_SIZE_C #endif -#if defined(BN_S_MP_SQR_FAST_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C +#if defined(S_MP_SQR_FAST_C) +# define MP_CLAMP_C +# define MP_GROW_C #endif -#if defined(BN_S_MP_SUB_C) -# define BN_MP_CLAMP_C -# define BN_MP_GROW_C +#if defined(S_MP_SUB_C) +# define MP_CLAMP_C +# define MP_GROW_C #endif -#if defined(BN_S_MP_TOOM_MUL_C) -# define BN_MP_ADD_C -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_DIV_2_C -# define BN_MP_DIV_3_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_LSHD_C -# define BN_MP_MUL_2_C -# define BN_MP_MUL_C -# define BN_MP_SUB_C +#if defined(S_MP_TOOM_MUL_C) +# define MP_ADD_C +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_CLEAR_MULTI_C +# define MP_DIV_2_C +# define MP_DIV_3_C +# define MP_INIT_MULTI_C +# define MP_INIT_SIZE_C +# define MP_LSHD_C +# define MP_MUL_2_C +# define MP_MUL_C +# define MP_SUB_C #endif -#if defined(BN_S_MP_TOOM_SQR_C) -# define BN_MP_ADD_C -# define BN_MP_CLAMP_C -# define BN_MP_CLEAR_C -# define BN_MP_DIV_2_C -# define BN_MP_INIT_C -# define BN_MP_INIT_SIZE_C -# define BN_MP_LSHD_C -# define BN_MP_MUL_2_C -# define BN_MP_MUL_C -# define BN_MP_SQR_C -# define BN_MP_SUB_C +#if defined(S_MP_TOOM_SQR_C) +# define MP_ADD_C +# define MP_CLAMP_C +# define MP_CLEAR_C +# define MP_DIV_2_C +# define MP_INIT_C +# define MP_INIT_SIZE_C +# define MP_LSHD_C +# define MP_MUL_2_C +# define MP_MUL_C +# define MP_SQR_C +# define MP_SUB_C #endif #ifdef LTM_INSIDE diff --git a/tommath_private.h b/tommath_private.h index d87ee9b..c44c72a 100644 --- a/tommath_private.h +++ b/tommath_private.h @@ -1,8 +1,8 @@ /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ -#ifndef TOMMATH_PRIV_H_ -#define TOMMATH_PRIV_H_ +#ifndef TOMMATH_PRIVATE_H_ +#define TOMMATH_PRIVATE_H_ #include "tommath.h" #include "tommath_class.h" @@ -142,7 +142,7 @@ extern void MP_FREE(void *mem, size_t size); /* feature detection macro */ #define MP_STRINGIZE(x) MP__STRINGIZE(x) #define MP__STRINGIZE(x) ""#x"" -#define MP_HAS(x) (sizeof(MP_STRINGIZE(BN_##x##_C)) == 1u) +#define MP_HAS(x) (sizeof(MP_STRINGIZE(x##_C)) == 1u) /* TODO: Remove private_mp_word as soon as deprecated mp_word is removed from tommath. */ typedef private_mp_word mp_word; diff --git a/tommath_superclass.h b/tommath_superclass.h index bb606b5..7179975 100644 --- a/tommath_superclass.h +++ b/tommath_superclass.h @@ -19,56 +19,56 @@ */ #ifdef SC_RSA_1_WITH_TESTS -# define BN_MP_ERROR_TO_STRING_C -# define BN_MP_FREAD_C -# define BN_MP_FWRITE_C -# define BN_MP_INCR_C -# define BN_MP_ISEVEN_C -# define BN_MP_ISODD_C -# define BN_MP_NEG_C -# define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C -# define BN_MP_RADIX_SIZE_C -# define BN_MP_LOG_U32_C -# define BN_MP_RAND_C -# define BN_MP_REDUCE_C -# define BN_MP_REDUCE_2K_L_C -# define BN_MP_FROM_SBIN_C -# define BN_MP_ROOT_U32_C -# define BN_MP_SET_L_C -# define BN_MP_SET_UL_C -# define BN_MP_SBIN_SIZE_C -# define BN_MP_TO_RADIX_C -# define BN_MP_TO_SBIN_C -# define BN_S_MP_RAND_JENKINS_C -# define BN_S_MP_RAND_PLATFORM_C +# define MP_ERROR_TO_STRING_C +# define MP_FREAD_C +# define MP_FWRITE_C +# define MP_INCR_C +# define MP_ISEVEN_C +# define MP_ISODD_C +# define MP_NEG_C +# define MP_PRIME_FROBENIUS_UNDERWOOD_C +# define MP_RADIX_SIZE_C +# define MP_LOG_U32_C +# define MP_RAND_C +# define MP_REDUCE_C +# define MP_REDUCE_2K_L_C +# define MP_FROM_SBIN_C +# define MP_ROOT_U32_C +# define MP_SET_L_C +# define MP_SET_UL_C +# define MP_SBIN_SIZE_C +# define MP_TO_RADIX_C +# define MP_TO_SBIN_C +# define S_MP_RAND_JENKINS_C +# define S_MP_RAND_PLATFORM_C #endif /* Works for RSA only, mpi.o is 68KiB */ #if defined(SC_RSA_1) || defined (SC_RSA_1_WITH_TESTS) -# define BN_CUTOFFS_C -# define BN_MP_ADDMOD_C -# define BN_MP_CLEAR_MULTI_C -# define BN_MP_EXPTMOD_C -# define BN_MP_GCD_C -# define BN_MP_INIT_MULTI_C -# define BN_MP_INVMOD_C -# define BN_MP_LCM_C -# define BN_MP_MOD_C -# define BN_MP_MOD_D_C -# define BN_MP_MULMOD_C -# define BN_MP_PRIME_IS_PRIME_C -# define BN_MP_PRIME_RABIN_MILLER_TRIALS_C -# define BN_MP_PRIME_RAND_C -# define BN_MP_RADIX_SMAP_C -# define BN_MP_SET_INT_C -# define BN_MP_SHRINK_C -# define BN_MP_TO_UNSIGNED_BIN_C -# define BN_MP_UNSIGNED_BIN_SIZE_C -# define BN_PRIME_TAB_C -# define BN_S_MP_REVERSE_C +# define MP_CUTOFFS_C +# define MP_ADDMOD_C +# define MP_CLEAR_MULTI_C +# define MP_EXPTMOD_C +# define MP_GCD_C +# define MP_INIT_MULTI_C +# define MP_INVMOD_C +# define MP_LCM_C +# define MP_MOD_C +# define MP_MOD_D_C +# define MP_MULMOD_C +# define MP_PRIME_IS_PRIME_C +# define MP_PRIME_RABIN_MILLER_TRIALS_C +# define MP_PRIME_RAND_C +# define MP_RADIX_SMAP_C +# define MP_SET_INT_C +# define MP_SHRINK_C +# define MP_TO_UNSIGNED_BIN_C +# define MP_UNSIGNED_BIN_SIZE_C +# define MP_PRIME_TAB_C +# define S_MP_REVERSE_C /* other modifiers */ -# define BN_MP_DIV_SMALL /* Slower division, not critical */ +# define MP_DIV_SMALL /* Slower division, not critical */ /* here we are on the last pass so we turn things off. The functions classes are still there @@ -76,26 +76,26 @@ * like removing support for even moduli, etc... */ # ifdef LTM_LAST -# undef BN_MP_DR_IS_MODULUS_C -# undef BN_MP_DR_SETUP_C -# undef BN_MP_DR_REDUCE_C -# undef BN_MP_DIV_3_C -# undef BN_MP_REDUCE_2K_SETUP_C -# undef BN_MP_REDUCE_2K_C -# undef BN_MP_REDUCE_IS_2K_C -# undef BN_MP_REDUCE_SETUP_C -# undef BN_S_MP_BALANCE_MUL_C -# undef BN_S_MP_EXPTMOD_C -# undef BN_S_MP_INVMOD_FAST_C -# undef BN_S_MP_KARATSUBA_MUL_C -# undef BN_S_MP_KARATSUBA_SQR_C -# undef BN_S_MP_MUL_HIGH_DIGS_C -# undef BN_S_MP_MUL_HIGH_DIGS_FAST_C -# undef BN_S_MP_TOOM_MUL_C -# undef BN_S_MP_TOOM_SQR_C +# undef MP_DR_IS_MODULUS_C +# undef MP_DR_SETUP_C +# undef MP_DR_REDUCE_C +# undef MP_DIV_3_C +# undef MP_REDUCE_2K_SETUP_C +# undef MP_REDUCE_2K_C +# undef MP_REDUCE_IS_2K_C +# undef MP_REDUCE_SETUP_C +# undef S_MP_BALANCE_MUL_C +# undef S_MP_EXPTMOD_C +# undef S_MP_INVMOD_FAST_C +# undef S_MP_KARATSUBA_MUL_C +# undef S_MP_KARATSUBA_SQR_C +# undef S_MP_MUL_HIGH_DIGS_C +# undef S_MP_MUL_HIGH_DIGS_FAST_C +# undef S_MP_TOOM_MUL_C +# undef S_MP_TOOM_SQR_C # ifndef SC_RSA_1_WITH_TESTS -# undef BN_MP_REDUCE_C +# undef MP_REDUCE_C # endif /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold @@ -103,9 +103,9 @@ * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without * trouble. */ -# undef BN_MP_MONTGOMERY_REDUCE_C -# undef BN_S_MP_MUL_DIGS_C -# undef BN_S_MP_SQR_C +# undef MP_MONTGOMERY_REDUCE_C +# undef S_MP_MUL_DIGS_C +# undef S_MP_SQR_C # endif #endif