Go to file
Steffen Jaeckel a8357d4328
Merge pull request #459 from libtom/less-long-long
Don't use long long where not necessary, some platforms lack it
2019-11-25 11:13:53 +01:00
demo correction of typo in test.c 2019-11-22 03:14:59 +01:00
doc suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
etc more spacing around PRIu64, needed for C++ compatibility 2019-11-14 14:18:45 +01:00
logs compare logs before and after single-object profiling 2019-10-28 15:31:36 +01:00
mtest Don't use long long where not necessary, some platforms lack it 2019-11-25 11:06:35 +01:00
.gitattributes improve build 2018-04-11 23:35:43 +02:00
.gitignore ignore&clean tommath_amalgam.c [skip ci] 2019-10-28 16:36:40 +01:00
.travis.yml disable lto test for clang for now 2019-11-05 21:01:54 +01:00
appveyor.yml also build support/ branches in CI 2019-10-29 15:39:00 +01:00
astylerc hardening: add MP_ZERO_BUFFER, MP_ZERO_DIGITS 2019-05-12 01:01:03 +02:00
changes.txt fix date in changelog...again :-\ 2019-10-22 11:53:41 +02:00
helper.pl fix generate_def, rename some internal files 2019-11-05 21:11:58 +01:00
libtommath_VS2008.sln make libtommath_VS2008 better upgradable to the newer visual studio 2018-12-08 11:56:08 +01:00
libtommath_VS2008.vcproj regen 2019-11-14 09:17:00 +01:00
libtommath.pc.in add pkg-config file for shared library 2017-05-09 14:25:11 +02:00
LICENSE Re-license 2018-12-27 15:41:16 +01:00
makefile Make sure that c89 conversion doesn't produce LL or uLL postfix, since that isn't c89 at all 2019-11-14 14:18:45 +01:00
makefile_include.mk don't use ranlib, ar s is equivalent 2019-11-05 20:28:59 +01:00
makefile.mingw regen 2019-11-14 09:17:00 +01:00
makefile.msvc regen 2019-11-14 09:17:00 +01:00
makefile.shared regen 2019-11-14 09:17:00 +01:00
makefile.unix regen 2019-11-14 09:17:00 +01:00
mp_2expt.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_abs.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_add_d.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_add.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_addmod.c simplify mod functions 2019-11-07 01:01:19 +01:00
mp_and.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_clamp.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_clear_multi.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_clear.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
mp_cmp_d.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_cmp_mag.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_cmp.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_cnt_lsb.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_complement.c simplify mp_complement 2019-11-04 15:41:33 +01:00
mp_copy.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_count_bits.c remove MP_IS_* macros 2019-10-27 18:36:55 +01:00
mp_cutoffs.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
mp_div_2.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_div_2d.c simplifications: basic arithmetic functions 2019-11-04 15:41:31 +01:00
mp_div_d.c add macro MP_IS_2EXPT 2019-11-09 06:43:59 +01:00
mp_div.c corrected startvalue for sigma and cutoff in mp_div 2019-11-24 05:44:29 +01:00
mp_dr_is_modulus.c replace mp_bool by stdbool 2019-10-27 18:36:56 +01:00
mp_dr_reduce.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_dr_setup.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_error_to_string.c handles MP_BUF in mp_error_to_string 2019-10-20 17:29:18 +02:00
mp_exch.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_expt_n.c suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
mp_exptmod.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_exteuclid.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_fread.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_from_sbin.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_from_ubin.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_fwrite.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
mp_gcd.c remove MP_IS_* macros 2019-10-27 18:36:55 +01:00
mp_get_double.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_get_i32.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_get_i64.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_get_l.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_get_ll.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_get_mag_u32.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_get_mag_u64.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_get_mag_ul.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_get_mag_ull.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_grow.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
mp_init_copy.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_i32.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_i64.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_l.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_ll.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_multi.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_set.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_size.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_u32.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_u64.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_ul.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init_ull.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_init.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_invmod.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_is_square.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_kronecker.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_lcm.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_log_n.c suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
mp_lshd.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_mod_2d.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
mp_mod.c simplify mod functions 2019-11-07 01:01:19 +01:00
mp_montgomery_calc_normalization.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_montgomery_reduce.c rename MP_MAXFAST to MP_MAX_COMBA 2019-11-05 20:09:23 +01:00
mp_montgomery_setup.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_mul_2.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_mul_2d.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
mp_mul_d.c add macro MP_IS_2EXPT 2019-11-09 06:43:59 +01:00
mp_mul.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_mulmod.c simplify mod functions 2019-11-07 01:01:19 +01:00
mp_neg.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_or.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_pack_count.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_pack.c use uint8_t instead of unsigned char 2019-10-29 17:40:59 +01:00
mp_prime_fermat.c simplifications: prime functions 2019-11-04 15:41:32 +01:00
mp_prime_frobenius_underwood.c simplifications: prime functions 2019-11-04 15:41:32 +01:00
mp_prime_is_prime.c simplifications: prime functions 2019-11-04 15:41:32 +01:00
mp_prime_miller_rabin.c simplifications: prime functions 2019-11-04 15:41:32 +01:00
mp_prime_next_prime.c simplifications: prime functions 2019-11-04 15:41:32 +01:00
mp_prime_rabin_miller_trials.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_prime_rand.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
mp_prime_strong_lucas_selfridge.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_radix_size.c suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
mp_rand.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_read_radix.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_reduce_2k_l.c simplifications: reduce functions 2019-11-04 15:41:32 +01:00
mp_reduce_2k_setup_l.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_reduce_2k_setup.c simplifications: reduce functions 2019-11-04 15:41:32 +01:00
mp_reduce_2k.c simplifications: reduce functions 2019-11-04 15:41:32 +01:00
mp_reduce_is_2k_l.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_reduce_is_2k.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_reduce_setup.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_reduce.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
mp_root_n.c suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
mp_rshd.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
mp_sbin_size.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_double.c use type-cast in stead of UINT64_C 2019-11-14 14:18:45 +01:00
mp_set_i32.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_i64.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_l.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_ll.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_u32.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_u64.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_ul.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set_ull.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_set.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
mp_shrink.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_signed_rsh.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_sqrmod.c simplify mod functions 2019-11-07 01:01:19 +01:00
mp_sqrt.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_sqrtmod_prime.c first batch of simplifications 2019-10-29 19:30:23 +01:00
mp_sub_d.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_sub.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_submod.c simplify mod functions 2019-11-07 01:01:19 +01:00
mp_to_radix.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_to_sbin.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_to_ubin.c use uint8_t instead of unsigned char 2019-10-29 17:40:59 +01:00
mp_ubin_size.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
mp_unpack.c use uint8_t instead of unsigned char 2019-10-29 17:40:59 +01:00
mp_xor.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
mp_zero.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
README.md create mtest_opponent instead of alt version of test 2019-09-30 23:44:49 +02:00
s_mp_add.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
s_mp_copy_digs.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
s_mp_div_3.c make mp_div_3 private 2019-11-09 06:43:58 +01:00
s_mp_div_recursive.c corrected startvalue for sigma and cutoff in mp_div 2019-11-24 05:44:29 +01:00
s_mp_div_school.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
s_mp_div_small.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
s_mp_exptmod_fast.c rename MP_MAXFAST to MP_MAX_COMBA 2019-11-05 20:09:23 +01:00
s_mp_exptmod.c Execute move.sh - Rename files from bn_* to match the function names. 2019-10-19 16:24:39 +02:00
s_mp_get_bit.c simplifications: prime functions 2019-11-04 15:41:32 +01:00
s_mp_invmod_odd.c better use of mp_isneg() and mp_iszero() 2019-11-11 21:52:20 +01:00
s_mp_invmod.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_log_2expt.c suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
s_mp_log_d.c suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
s_mp_log.c suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
s_mp_montgomery_reduce_comba.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_mul_balance.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_mul_comba.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_mul_high_comba.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_mul_high.c rename MP_MAXFAST to MP_MAX_COMBA 2019-11-05 20:09:23 +01:00
s_mp_mul_karatsuba.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_mul_toom.c make mp_div_3 private 2019-11-09 06:43:58 +01:00
s_mp_mul.c rename MP_MAXFAST to MP_MAX_COMBA 2019-11-05 20:09:23 +01:00
s_mp_prime_is_divisible.c simplifications: prime functions 2019-11-04 15:41:32 +01:00
s_mp_prime_tab.c fix generate_def, rename some internal files 2019-11-05 21:11:58 +01:00
s_mp_radix_map.c fix generate_def, rename some internal files 2019-11-05 21:11:58 +01:00
s_mp_rand_jenkins.c more unnecessary type-casts, correct type-case for malloc 2019-11-14 14:18:45 +01:00
s_mp_rand_platform.c s_mp_rand_platform: add comment regarding MP_HAS requiring dead code elim 2019-11-12 01:16:33 +01:00
s_mp_sqr_comba.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_sqr_karatsuba.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_sqr_toom.c rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
s_mp_sqr.c simplifications: basic arithmetic functions 2019-11-04 15:41:31 +01:00
s_mp_sub.c simplifications: remove unnecessary optimization 2019-11-04 15:41:33 +01:00
s_mp_zero_buf.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
s_mp_zero_digs.c simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs 2019-11-04 15:41:32 +01:00
testme.sh add COMPILE_LTO to test link time optimization 2019-11-05 20:28:59 +01:00
tommath_c89.h better comment in tommath_c89.h 2019-10-27 18:36:57 +01:00
tommath_class.h regen 2019-11-14 09:17:00 +01:00
tommath_cutoffs.h rename mul/sqr functions for consistency, comba instead of fast suffix 2019-11-04 15:41:33 +01:00
tommath_private.h suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
tommath_superclass.h suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00
tommath.def regen 2019-11-14 09:17:00 +01:00
tommath.h suffix _u32 -> _n of mp_(expt|log|root) functions, use int for now 2019-11-14 09:16:00 +01:00

libtommath

This is the git repository for LibTomMath, a free open source portable number theoretic multiple-precision integer (MPI) library written entirely in C.

Build Status

Travis CI

master: Build Status

develop: Build Status

AppVeyor

master: Build status

develop: Build status

ABI Laboratory

API/ABI changes: check here

Summary

The develop branch contains the in-development version. Stable releases are tagged.

Documentation is built from the LaTeX file bn.tex. There is also limited documentation in tommath.h. There is also a document, tommath.pdf, which describes the goals of the project and many of the algorithms used.

The project can be build by using make. Along with the usual make, make clean and make install, there are several other build targets, see the makefile for details. There are also makefiles for certain specific platforms.

Testing

Tests are located in demo/ and can be built in two flavors.

  • make test creates a stand-alone test binary that executes several test routines.
  • make mtest_opponent creates a test binary that is intended to be run against mtest. mtest can be built with make mtest and test execution is done like ./mtest/mtest | ./mtest_opponent. mtest is creating test vectors using an alternative MPI library and test is consuming these vectors to verify correct behavior of ltm

Building and Installing

Building is straightforward for GNU Linux only, the section "Building LibTomMath" in the documentation in doc/bn.pdf has the details.