Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C.
C TeX Perl Makefile Shell Assembly Other
Failed to load latest commit information.
demo demo: read from urandom if someone requests real random data
etc minor changes & clean-up & small fixes
logs added libtommath-0.36
mtest mtest vs. test: add possibility to exit testing
pics added libtommath-0.30
pre_gen trim trailing spaces
tombc added libtommath-0.35
.gitignore makefile: add 'coverage' make target
LICENSE after multiple objections of libtom users [1], we decided to change l…
README.md update README
bn.tex (wrong version bump in bn.tex, fixed)
bn_error.c mp_error_to_string: return const char* instead of char*
bn_fast_mp_invmod.c added libtommath-0.41
bn_fast_mp_montgomery_reduce.c added libtommath-0.41
bn_fast_s_mp_mul_digs.c added libtommath-0.41
bn_fast_s_mp_mul_high_digs.c added libtommath-0.41
bn_fast_s_mp_sqr.c added libtommath-0.41
bn_mp_2expt.c added libtommath-0.41
bn_mp_abs.c added libtommath-0.41
bn_mp_add.c added libtommath-0.41
bn_mp_add_d.c added libtommath-0.41
bn_mp_addmod.c added libtommath-0.41
bn_mp_and.c added libtommath-0.41
bn_mp_clamp.c added libtommath-0.41
bn_mp_clear.c added libtommath-0.41
bn_mp_clear_multi.c added libtommath-0.41
bn_mp_cmp.c added libtommath-0.41
bn_mp_cmp_d.c added libtommath-0.41
bn_mp_cmp_mag.c added libtommath-0.41
bn_mp_cnt_lsb.c added libtommath-0.41
bn_mp_copy.c added libtommath-0.41
bn_mp_count_bits.c added libtommath-0.41
bn_mp_div.c added libtommath-0.41
bn_mp_div_2.c added libtommath-0.41
bn_mp_div_2d.c added libtommath-0.41
bn_mp_div_3.c added libtommath-0.41
bn_mp_div_d.c added libtommath-0.41
bn_mp_dr_is_modulus.c added libtommath-0.41
bn_mp_dr_reduce.c added libtommath-0.41
bn_mp_dr_setup.c added libtommath-0.41
bn_mp_exch.c added libtommath-0.41
bn_mp_export.c added mp_import / mp_export
bn_mp_expt_d.c mp_expt_d: bring back pre 921be35 state
bn_mp_expt_d_ex.c mp_expt_d: bring back pre 921be35 state
bn_mp_exptmod.c added libtommath-0.41
bn_mp_exptmod_fast.c added libtommath-0.41
bn_mp_exteuclid.c added libtommath-0.41
bn_mp_fread.c added libtommath-0.41
bn_mp_fwrite.c added libtommath-0.41
bn_mp_gcd.c added libtommath-0.41
bn_mp_get_int.c fix x32 compilation
bn_mp_get_long.c fix compiler warning when compiling with "-mx32" option
bn_mp_get_long_long.c add mp_get_long_long() and mp_set_long_long()
bn_mp_grow.c added libtommath-0.41
bn_mp_import.c added mp_import / mp_export
bn_mp_init.c added libtommath-0.41
bn_mp_init_copy.c Update bn_mp_init_copy.c
bn_mp_init_multi.c added libtommath-0.41
bn_mp_init_set.c added libtommath-0.41
bn_mp_init_set_int.c added libtommath-0.41
bn_mp_init_size.c added libtommath-0.41
bn_mp_invmod.c Avoid consecutive return statements
bn_mp_invmod_slow.c added libtommath-0.41
bn_mp_is_square.c added libtommath-0.41
bn_mp_jacobi.c added libtommath-0.41
bn_mp_karatsuba_mul.c added libtommath-0.41
bn_mp_karatsuba_sqr.c added libtommath-0.41
bn_mp_lcm.c added libtommath-0.41
bn_mp_lshd.c added libtommath-0.41
bn_mp_mod.c Fix mp_mod(a, b, c) if b < 0 and a = n * b, n integer
bn_mp_mod_2d.c added libtommath-0.41
bn_mp_mod_d.c added libtommath-0.41
bn_mp_montgomery_calc_normalization.c added libtommath-0.41
bn_mp_montgomery_reduce.c added libtommath-0.41
bn_mp_montgomery_setup.c fix x32 compilation
bn_mp_mul.c Revert "balancing multiplication like that in Ruby 1.9"
bn_mp_mul_2.c added libtommath-0.41
bn_mp_mul_2d.c added libtommath-0.41
bn_mp_mul_d.c added libtommath-0.41
bn_mp_mulmod.c added libtommath-0.41
bn_mp_n_root.c mp_n_root: add mp_n_root_ex() with parameter 'fast' for mp_expt_d_ex()
bn_mp_n_root_ex.c mp_n_root: add mp_n_root_ex() with parameter 'fast' for mp_expt_d_ex()
bn_mp_neg.c added libtommath-0.41
bn_mp_or.c added libtommath-0.41
bn_mp_prime_fermat.c added libtommath-0.41
bn_mp_prime_is_divisible.c added libtommath-0.41
bn_mp_prime_is_prime.c added libtommath-0.41
bn_mp_prime_miller_rabin.c added libtommath-0.41
bn_mp_prime_next_prime.c Initialize variable "res" to MP_NO.
bn_mp_prime_rabin_miller_trials.c added libtommath-0.41
bn_mp_prime_random_ex.c removed flag LTM_PRIME_2MSB_OFF since it's no more available
bn_mp_radix_size.c fix bug in mp_radix_size()
bn_mp_radix_smap.c added libtommath-0.41
bn_mp_rand.c use arc4random() instead of rand() on *BSD
bn_mp_read_radix.c fixed comment
bn_mp_read_signed_bin.c added libtommath-0.41
bn_mp_read_unsigned_bin.c added libtommath-0.41
bn_mp_reduce.c fix x32 compilation
bn_mp_reduce_2k.c added libtommath-0.41
bn_mp_reduce_2k_l.c added libtommath-0.41
bn_mp_reduce_2k_setup.c added libtommath-0.41
bn_mp_reduce_2k_setup_l.c added libtommath-0.41
bn_mp_reduce_is_2k.c added libtommath-0.41
bn_mp_reduce_is_2k_l.c added libtommath-0.41
bn_mp_reduce_setup.c added libtommath-0.41
bn_mp_rshd.c added libtommath-0.41
bn_mp_set.c added libtommath-0.41
bn_mp_set_int.c added libtommath-0.41
bn_mp_set_long.c replace mp_set_long() implementation by macro
bn_mp_set_long_long.c add mp_get_long_long() and mp_set_long_long()
bn_mp_shrink.c + allow mp_shrink to shrink initialized, but empty MPI's
bn_mp_signed_bin_size.c added libtommath-0.41
bn_mp_sqr.c added libtommath-0.41
bn_mp_sqrmod.c added libtommath-0.41
bn_mp_sqrt.c added libtommath-0.41
bn_mp_sub.c added libtommath-0.41
bn_mp_sub_d.c added libtommath-0.41
bn_mp_submod.c added libtommath-0.41
bn_mp_to_signed_bin.c added libtommath-0.41
bn_mp_to_signed_bin_n.c added libtommath-0.41
bn_mp_to_unsigned_bin.c added libtommath-0.41
bn_mp_to_unsigned_bin_n.c added libtommath-0.41
bn_mp_toom_mul.c added libtommath-0.41
bn_mp_toom_sqr.c added libtommath-0.41
bn_mp_toradix.c added libtommath-0.41
bn_mp_toradix_n.c added libtommath-0.41
bn_mp_unsigned_bin_size.c added libtommath-0.41
bn_mp_xor.c added libtommath-0.41
bn_mp_zero.c added libtommath-0.41
bn_prime_tab.c added libtommath-0.41
bn_reverse.c added libtommath-0.41
bn_s_mp_add.c added libtommath-0.41
bn_s_mp_exptmod.c added libtommath-0.41
bn_s_mp_mul_digs.c added libtommath-0.41
bn_s_mp_mul_high_digs.c added libtommath-0.41
bn_s_mp_sqr.c added libtommath-0.41
bn_s_mp_sub.c added libtommath-0.41
bncore.c added libtommath-0.41
booker.pl minor changes & clean-up & small fixes
callgraph.txt udpate makefiles etc.
changes.txt updated changes.txt
dep.pl dep.pl: add new type mp_min_u32
filter.pl add "updatemakes" from libtomcrypt
gen.pl trim trailing spaces
genlist.sh add "updatemakes" from libtomcrypt
libtommath.dsp added libtommath-0.41
libtommath_VS2005.sln Added project and solution files for Visual Studio 2005 and Visual St…
libtommath_VS2005.vcproj update makefiles
libtommath_VS2008.sln Added project and solution files for Visual Studio 2005 and Visual St…
libtommath_VS2008.vcproj update makefiles
makefile makefile: add 'coverage' make target
makefile.bcc udpate makefiles etc.
makefile.cygwin_dll udpate makefiles etc.
makefile.icc udpate makefiles etc.
makefile.include makefiles: improve a bit
makefile.msvc udpate makefiles etc.
makefile.shared makefiles: improve a bit
mess.sh added libtommath-0.36
parsenames.pl add "updatemakes" from libtomcrypt
poster.tex added libtommath-0.28
pretty.build added libtommath-0.31
testme.sh testme.sh: improve a bit
tommath.h use arc4random() instead of rand() on *BSD
tommath.pdf added libtommath-0.41
tommath.src trim trailing spaces/clean up
tommath_class.h udpate makefiles etc.
tommath_superclass.h added libtommath-0.36
updatemakes.sh add "updatemakes" from libtomcrypt

README.md

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

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.

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.
Something went wrong with that request. Please try again.