Go to file
2017-08-17 21:06:50 -07:00
demos Delete demo_dynamic.py 2017-08-17 21:06:50 -07:00
doc Fix crypt.tex with newer TeXLive (thanks Norbert Preining) 2017-08-01 12:04:01 +02:00
hooks add pre-commit hook 2017-03-22 11:21:49 +01:00
notes OCBv3: fix testvector generation 2017-08-07 19:43:09 +02:00
src default ChaCha to ChaCha20 2017-08-16 11:49:25 +02:00
tests fix call to gettimeofday() 2017-08-16 11:52:40 +02:00
.clang-format add .clang-format 2015-08-25 23:58:08 +02:00
.gitattributes or perhaps exclude .git* 2017-05-11 23:04:37 +02:00
.gitignore also build openssl-enc 2017-06-08 21:32:10 +02:00
.travis.yml tv.txt contains errors from tv_gen 2017-08-07 19:37:53 +02:00
build.sh tv.txt contains errors from tv_gen 2017-08-07 19:37:53 +02:00
changes update changes 2017-07-05 14:30:16 +02:00
check_source.sh replace SVN tags 2017-06-20 15:16:11 +02:00
coverage_more.sh replace SVN tags 2017-06-20 15:16:11 +02:00
coverage.sh replace SVN tags 2017-06-20 15:16:11 +02:00
coverity.sh update coverity build script to use makefile.unix 2017-06-23 16:46:31 +02:00
helper.pl update VERSION variables in makefiles 2017-07-05 14:30:17 +02:00
libtomcrypt_VS2008.sln improving MS Windows builds (msvc) 2017-03-29 08:48:33 +02:00
libtomcrypt_VS2008.vcproj Update makefiles 2017-08-02 18:55:42 +02:00
libtomcrypt.pc.in drop the need for testprof/makefile* 2017-05-11 23:04:37 +02:00
LICENSE after multiple objections of libtom users [1], we decided to change licensing 2011-01-19 10:18:15 +01:00
makefile fix help of {un,}install targets 2017-07-20 12:58:28 +02:00
makefile_include.mk Update makefiles 2017-08-02 18:55:42 +02:00
makefile.mingw Update makefiles 2017-08-02 18:55:42 +02:00
makefile.msvc Update makefiles 2017-08-02 18:55:42 +02:00
makefile.shared fix help of {un,}install targets 2017-07-20 12:58:28 +02:00
makefile.unix Update makefiles 2017-08-02 18:55:42 +02:00
printinfo.sh small fix-ups 2017-05-11 23:04:37 +02:00
README.md update README.md a bit 2017-08-09 15:55:15 +02:00
run.sh replace SVN tags 2017-06-20 15:16:11 +02:00
scan_build.sh this is a horrible PR 2017-06-13 18:41:09 +02:00
testbuild.sh travis: print version information in build scripts 2014-02-25 10:31:13 +01:00
testme.sh replace SVN tags 2017-06-20 15:16:11 +02:00
TODO added libtomcrypt-1.17 2010-06-16 12:39:13 +02:00
updatemakes.sh small fix-ups 2017-05-11 23:04:37 +02:00

libtomcrypt

See doc/crypt.pdf for a detailed documentation

Project Status

master: Build Status Coverage Status

develop: Build Status Coverage Status

Coverity Scan Build Status

Submitting patches

Please branch off from develop if you want to submit a patch.

Patch integration will be faster if tests and documentation are included.

Please update the makefiles in a separate commit. To update them simply run the updatemakes.sh script.

If you have something bigger to submit, feel free to contact us beforehand. Then we can give you write access to this repo, so you can open your PR based on this repo and we can easier follow the rebase-before-merge approach we're using (or even do the rebase ourself).

Reviews

We're using Pull Request reviews to make sure that the code is in line with the existing code base.

Please have a look here to get an idea of the approach.

Branches

Please be aware, that all branches besides master and develop can and will be force-pushed, rebased and/or removed!

If you want to rely on such an unstable branch, create your own fork of this repository to make sure nothing breaks for you.

Configuration options

By default the library builds its entire feature set (besides katja) in a (depending on your needs more or less) optimal way.

There are numerous configuration options available if you want to trim down the functionality of the library.

Please have a look at src/headers/tomcrypt_custom.h for all available configuration options.

The following list is a small part of the available, but the most often required, configuration switches.

Flag Behavior
LTC_NO_TEST Remove all algorithm self-tests from the library
LTC_NO_FILE Remove all API functions requiring a pre-defined FILE data-type (mostly useful for embedded targets)
MAX_RSA_SIZE Per default set to 4096, if you need support for importing or generating bigger RSA keys, change this at compile-time.
GMP_DESC enable gmp as MPI provider *1
LTM_DESC enable libtommath as MPI provider *1
TFM_DESC enable tomsfastmath as MPI provider *1 *2
USE_GMP use gmp as MPI provider when building the binaries *3
USE_LTM use libtommath as MPI provider when building the binaries *3
USE_TFM use tomsfastmath as MPI provider when building the binaries *3

*1 It is possible to build the library against all MPI providers in parallel and choose at startup-time which math library should be used.

*2 Please be aware that tomsfastmath has the limitation of a fixed max size of MPI's.

*3 Only one is supported at the time & this is only required when building the binaries, not when building the library itself.

Building the library

There are several makefiles provided. Please choose the one that fits best for you.

makefile use-case
makefile builds a static library (GNU Make required, broken on Mac OSX - use makefile.unix instead)
makefile.shared builds a shared (and static) library (GNU Make required)
makefile.unix for unusual UNIX platforms, or if you do not have GNU Make
makefile.mingw for usage with the mingw compiler on MS Windows
makefile.msvc for usage with the MSVC compiler on MS Windows
libtomcrypt_VS2008.sln A VisualStudio 2008 project for MS Windows

Make targets

The makefiles provide several targets to build (VS project excluded). The following list does not claim to be complete resp. to be available across all makefile variants.

target application
empty target/none given c.f. library
library builds only the library
hashsum builds the hashsum binary, similar to shasum, but with support for all hash-algorithms included in the library *4
ltcrypt builds the ltcrypt binary, implementing something similar to crypt *4
sizes builds the sizes binary, printing all internal data sizes on invocation *4
constants builds the constants binary, printing all internal constants on invocation *4
openssl-enc builds the openssl-enc binary, which is more or less compatible to openssl enc *4 *5
test builds the test binary, which runs all algorithm self-tests + some extended tests *4 *6
timing builds the timing binary, which can be used to measure timings for algorithms and modes *4 *6
bins builds hashsum *4
all_test builds test, hashsum, ltcrypt, small, tv_gen, sizes & constants *4

*4 also builds library

*5 broken build in some configurations, therefore not built by default

*6 requires define of one of USE_GMP, USE_LTM or USE_TFM (+ the appropriate MPI provider)

Examples

You want to build the library as static library

make

You want to build the library as shared library

make -f makefile.shared

You have libtommath installed on your system and want to build a static library and the test binary to run the self-tests.

make CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" test

You have tomsfastmath installed on your system and want to build a shared library and all binaries

make -f makefile.shared CFLAGS="-DUSE_TFM -DTFM_DESC" EXTRALIBS="-ltfm" all demos

You have gmp, libtommath and tomsfastmath installed on your system and want to build a static library and the timing binary to measure timings against gmp.

make CFLAGS="-DUSE_GMP -DGMP_DESC -DLTM_DESC -DTFM_DESC" EXTRALIBS="-lgmp" timing

If you have libtommath in a non-standard location:

make CFLAGS="-DUSE_LTM -DLTM_DESC -I/opt/devel/ltm" EXTRALIBS="/opt/devel/ltm/libtommath.a" all