LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.
C C++ Makefile Perl Shell Assembly Other
sjaeckel Merge pull request #108 from ararslan/aa/freebsd
Make the build logic more robust for BSD systems
Latest commit bc685fd Jun 10, 2018
Permalink
Failed to load latest commit information.
demo fix timing & logs/*.png generation Feb 27, 2018
doc clean-up file headers Feb 27, 2018
etc fix type & cast Feb 13, 2018
logs update results when running the timing demo Feb 27, 2018
mtest run astyle Dec 6, 2017
tombc added libtommath-0.35 Jul 15, 2010
.gitattributes improve build Apr 11, 2018
.gitignore remove pre_gen/mpi.c from repo Apr 11, 2018
.travis.yml also run test vs mtest with real random data Oct 19, 2017
LICENSE after multiple objections of libtom users [1], we decided to change l… Jan 19, 2011
README.md update README.md Apr 11, 2018
astylerc format with astyle (step 1) Aug 30, 2017
bn_error.c Do not use installed headers for building May 2, 2018
bn_fast_mp_invmod.c Do not use installed headers for building May 2, 2018
bn_fast_mp_montgomery_reduce.c Do not use installed headers for building May 2, 2018
bn_fast_s_mp_mul_digs.c Do not use installed headers for building May 2, 2018
bn_fast_s_mp_mul_high_digs.c Do not use installed headers for building May 2, 2018
bn_fast_s_mp_sqr.c Do not use installed headers for building May 2, 2018
bn_mp_2expt.c Do not use installed headers for building May 2, 2018
bn_mp_abs.c Do not use installed headers for building May 2, 2018
bn_mp_add.c Do not use installed headers for building May 2, 2018
bn_mp_add_d.c Do not use installed headers for building May 2, 2018
bn_mp_addmod.c Do not use installed headers for building May 2, 2018
bn_mp_and.c Do not use installed headers for building May 2, 2018
bn_mp_clamp.c Do not use installed headers for building May 2, 2018
bn_mp_clear.c Do not use installed headers for building May 2, 2018
bn_mp_clear_multi.c Do not use installed headers for building May 2, 2018
bn_mp_cmp.c Do not use installed headers for building May 2, 2018
bn_mp_cmp_d.c Do not use installed headers for building May 2, 2018
bn_mp_cmp_mag.c Do not use installed headers for building May 2, 2018
bn_mp_cnt_lsb.c Do not use installed headers for building May 2, 2018
bn_mp_copy.c Do not use installed headers for building May 2, 2018
bn_mp_count_bits.c Do not use installed headers for building May 2, 2018
bn_mp_div.c Do not use installed headers for building May 2, 2018
bn_mp_div_2.c Do not use installed headers for building May 2, 2018
bn_mp_div_2d.c Do not use installed headers for building May 2, 2018
bn_mp_div_3.c Do not use installed headers for building May 2, 2018
bn_mp_div_d.c Do not use installed headers for building May 2, 2018
bn_mp_dr_is_modulus.c Do not use installed headers for building May 2, 2018
bn_mp_dr_reduce.c Do not use installed headers for building May 2, 2018
bn_mp_dr_setup.c Do not use installed headers for building May 2, 2018
bn_mp_exch.c Do not use installed headers for building May 2, 2018
bn_mp_export.c Do not use installed headers for building May 2, 2018
bn_mp_expt_d.c Do not use installed headers for building May 2, 2018
bn_mp_expt_d_ex.c Do not use installed headers for building May 2, 2018
bn_mp_exptmod.c Do not use installed headers for building May 2, 2018
bn_mp_exptmod_fast.c Do not use installed headers for building May 2, 2018
bn_mp_exteuclid.c Do not use installed headers for building May 2, 2018
bn_mp_fread.c Do not use installed headers for building May 2, 2018
bn_mp_fwrite.c Do not use installed headers for building May 2, 2018
bn_mp_gcd.c Do not use installed headers for building May 2, 2018
bn_mp_get_int.c Do not use installed headers for building May 2, 2018
bn_mp_get_long.c Do not use installed headers for building May 2, 2018
bn_mp_get_long_long.c Do not use installed headers for building May 2, 2018
bn_mp_grow.c Do not use installed headers for building May 2, 2018
bn_mp_import.c Do not use installed headers for building May 2, 2018
bn_mp_init.c Do not use installed headers for building May 2, 2018
bn_mp_init_copy.c Do not use installed headers for building May 2, 2018
bn_mp_init_multi.c Do not use installed headers for building May 2, 2018
bn_mp_init_set.c Do not use installed headers for building May 2, 2018
bn_mp_init_set_int.c Do not use installed headers for building May 2, 2018
bn_mp_init_size.c Do not use installed headers for building May 2, 2018
bn_mp_invmod.c Do not use installed headers for building May 2, 2018
bn_mp_invmod_slow.c Do not use installed headers for building May 2, 2018
bn_mp_is_square.c Do not use installed headers for building May 2, 2018
bn_mp_jacobi.c Do not use installed headers for building May 2, 2018
bn_mp_karatsuba_mul.c Do not use installed headers for building May 2, 2018
bn_mp_karatsuba_sqr.c Do not use installed headers for building May 2, 2018
bn_mp_lcm.c Do not use installed headers for building May 2, 2018
bn_mp_lshd.c Do not use installed headers for building May 2, 2018
bn_mp_mod.c Do not use installed headers for building May 2, 2018
bn_mp_mod_2d.c Do not use installed headers for building May 2, 2018
bn_mp_mod_d.c Do not use installed headers for building May 2, 2018
bn_mp_montgomery_calc_normalization.c Do not use installed headers for building May 2, 2018
bn_mp_montgomery_reduce.c Do not use installed headers for building May 2, 2018
bn_mp_montgomery_setup.c Do not use installed headers for building May 2, 2018
bn_mp_mul.c Do not use installed headers for building May 2, 2018
bn_mp_mul_2.c Do not use installed headers for building May 2, 2018
bn_mp_mul_2d.c Do not use installed headers for building May 2, 2018
bn_mp_mul_d.c Do not use installed headers for building May 2, 2018
bn_mp_mulmod.c Do not use installed headers for building May 2, 2018
bn_mp_n_root.c Do not use installed headers for building May 2, 2018
bn_mp_n_root_ex.c Do not use installed headers for building May 2, 2018
bn_mp_neg.c Do not use installed headers for building May 2, 2018
bn_mp_or.c Do not use installed headers for building May 2, 2018
bn_mp_prime_fermat.c Do not use installed headers for building May 2, 2018
bn_mp_prime_is_divisible.c Do not use installed headers for building May 2, 2018
bn_mp_prime_is_prime.c Do not use installed headers for building May 2, 2018
bn_mp_prime_miller_rabin.c Do not use installed headers for building May 2, 2018
bn_mp_prime_next_prime.c Do not use installed headers for building May 2, 2018
bn_mp_prime_rabin_miller_trials.c Do not use installed headers for building May 2, 2018
bn_mp_prime_random_ex.c Do not use installed headers for building May 2, 2018
bn_mp_radix_size.c Do not use installed headers for building May 2, 2018
bn_mp_radix_smap.c const mp_s_rmap Jun 4, 2018
bn_mp_rand.c Do not use installed headers for building May 2, 2018
bn_mp_read_radix.c Do not use installed headers for building May 2, 2018
bn_mp_read_signed_bin.c Do not use installed headers for building May 2, 2018
bn_mp_read_unsigned_bin.c Do not use installed headers for building May 2, 2018
bn_mp_reduce.c Do not use installed headers for building May 2, 2018
bn_mp_reduce_2k.c Do not use installed headers for building May 2, 2018
bn_mp_reduce_2k_l.c Do not use installed headers for building May 2, 2018
bn_mp_reduce_2k_setup.c Do not use installed headers for building May 2, 2018
bn_mp_reduce_2k_setup_l.c Do not use installed headers for building May 2, 2018
bn_mp_reduce_is_2k.c Do not use installed headers for building May 2, 2018
bn_mp_reduce_is_2k_l.c Do not use installed headers for building May 2, 2018
bn_mp_reduce_setup.c Do not use installed headers for building May 2, 2018
bn_mp_rshd.c Do not use installed headers for building May 2, 2018
bn_mp_set.c Do not use installed headers for building May 2, 2018
bn_mp_set_int.c Do not use installed headers for building May 2, 2018
bn_mp_set_long.c Do not use installed headers for building May 2, 2018
bn_mp_set_long_long.c Do not use installed headers for building May 2, 2018
bn_mp_shrink.c Do not use installed headers for building May 2, 2018
bn_mp_signed_bin_size.c Do not use installed headers for building May 2, 2018
bn_mp_sqr.c Do not use installed headers for building May 2, 2018
bn_mp_sqrmod.c Do not use installed headers for building May 2, 2018
bn_mp_sqrt.c Do not use installed headers for building May 2, 2018
bn_mp_sqrtmod_prime.c Do not use installed headers for building May 2, 2018
bn_mp_sub.c Do not use installed headers for building May 2, 2018
bn_mp_sub_d.c Do not use installed headers for building May 2, 2018
bn_mp_submod.c Do not use installed headers for building May 2, 2018
bn_mp_to_signed_bin.c Do not use installed headers for building May 2, 2018
bn_mp_to_signed_bin_n.c Do not use installed headers for building May 2, 2018
bn_mp_to_unsigned_bin.c Do not use installed headers for building May 2, 2018
bn_mp_to_unsigned_bin_n.c Do not use installed headers for building May 2, 2018
bn_mp_toom_mul.c Do not use installed headers for building May 2, 2018
bn_mp_toom_sqr.c Do not use installed headers for building May 2, 2018
bn_mp_toradix.c Do not use installed headers for building May 2, 2018
bn_mp_toradix_n.c Do not use installed headers for building May 2, 2018
bn_mp_unsigned_bin_size.c Do not use installed headers for building May 2, 2018
bn_mp_xor.c Do not use installed headers for building May 2, 2018
bn_mp_zero.c Do not use installed headers for building May 2, 2018
bn_prime_tab.c Do not use installed headers for building May 2, 2018
bn_reverse.c Do not use installed headers for building May 2, 2018
bn_s_mp_add.c Do not use installed headers for building May 2, 2018
bn_s_mp_exptmod.c Do not use installed headers for building May 2, 2018
bn_s_mp_mul_digs.c Do not use installed headers for building May 2, 2018
bn_s_mp_mul_high_digs.c Do not use installed headers for building May 2, 2018
bn_s_mp_sqr.c Do not use installed headers for building May 2, 2018
bn_s_mp_sub.c Do not use installed headers for building May 2, 2018
bncore.c Do not use installed headers for building May 2, 2018
callgraph.txt update callgraph Aug 28, 2017
changes.txt fix date in changes.txt Aug 29, 2017
dep.pl Do not use tommath.h from the system for building May 2, 2018
filter.pl replace SVN tags Aug 28, 2017
gen.pl sanitize some Perl scripts Apr 8, 2017
genlist.sh replace SVN tags Aug 28, 2017
libtommath.dsp added libtommath-0.41 Jul 15, 2010
libtommath.pc.in add pkg-config file for shared library May 9, 2017
libtommath_VS2005.sln Added project and solution files for Visual Studio 2005 and Visual St… Jul 15, 2010
libtommath_VS2005.vcproj update makefiles Nov 24, 2013
libtommath_VS2008.sln Added project and solution files for Visual Studio 2005 and Visual St… Jul 15, 2010
libtommath_VS2008.vcproj update makefiles Nov 24, 2013
makefile improve build Apr 11, 2018
makefile.bcc update makefiles etc. Oct 30, 2015
makefile.cygwin_dll update makefiles etc. Oct 30, 2015
makefile.icc rename timing demo Feb 27, 2018
makefile.msvc fix makefile.msvc Feb 27, 2018
makefile.shared makefile.shared: Respect LIBTOOL. May 19, 2018
makefile_include.mk Make the build logic more robust for BSD systems Jun 10, 2018
mess.sh added libtommath-0.36 Jul 15, 2010
parsenames.pl replace SVN tags Aug 28, 2017
pretty.build added libtommath-0.31 Jul 15, 2010
testme.sh also run test vs mtest with real random data Oct 19, 2017
tommath.h improved detection of MP_64BIT May 28, 2018
tommath_class.h Do not use tommath.h from the system for building May 2, 2018
tommath_private.h const mp_s_rmap Jun 4, 2018
tommath_superclass.h format with astyle (step 5) Aug 30, 2017
updatemakes.sh replace SVN tags Aug 28, 2017

README.md

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

master: Build Status

develop: Build Status

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 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 | ./test. mtest is creating test vectors using an alternative MPI library and test is consuming these vectors to verify correct behavior of ltm
  • make test_standalone creates a stand-alone test binary that executes several test routines.