descriptionPublic domain cryptographic toolkit
homepage URLhttp://www.libtom.net/LibTomCrypt/
repository URLhttps://github.com/libtom/libtomcrypt.git
ownermackyle@fastmail.com
last changeMon, 26 Feb 2024 16:02:46 +0000 (26 17:02 +0100)
last refreshTue, 28 May 2024 20:55:40 +0000 (28 22:55 +0200)
content tags
add:
README.md

libtomcrypt

Previously the git repository contained doc/crypt.pdf for detailed documentation. This was changed and the file is now only available from the tarball of the appropriate version or from the page https://github.com/libtom/libtomcrypt/releases .

Project Status

Travis CI

master: Build Status Coverage Status

develop: Build Status Coverage Status

AppVeyor

master: Build status

develop: Build status

Coverity

Coverity Scan Build Status

ABI Laboratory

API/ABI changes: check here

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.

FlagBehavior
LTC_NO_TESTRemove all algorithm self-tests from the library
LTC_NO_FILERemove all API functions requiring a pre-defined FILE data-type (mostly useful for embedded targets)
GMP_DESCenable gmp as MPI provider *1
LTM_DESCenable libtommath as MPI provider *1
TFM_DESCenable tomsfastmath as MPI provider *1 *2
USE_GMPuse gmp as MPI provider when building the binaries *3
USE_LTMuse libtommath as MPI provider when building the binaries *3
USE_TFMuse 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.

makefileuse-case
makefilebuilds a static library (GNU Make required)
makefile.sharedbuilds a shared (and static) library (GNU Make required)
makefile.unixfor unusual UNIX platforms, or if you do not have GNU Make
makefile.mingwfor usage with the mingw compiler on MS Windows
makefile.msvcfor usage with the MSVC compiler on MS Windows
libtomcrypt_VS2008.slnA 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.

targetapplication
empty target/none givenc.f. library
librarybuilds only the library
hashsumbuilds the hashsum binary, similar to shasum, but with support for all hash-algorithms included in the library *4
ltcryptbuilds the ltcrypt binary, implementing something similar to crypt *4
sizesbuilds the sizes binary, printing all internal data sizes on invocation *4
constantsbuilds the constants binary, printing all internal constants on invocation *4
openssl-encbuilds the openssl-enc binary, which is more or less compatible to openssl enc *4 *5
testbuilds the test binary, which runs all algorithm self-tests + some extended tests *4
timingbuilds the timing binary, which can be used to measure timings for algorithms and modes *4
binsbuilds hashsum *4
all_testbuilds test, hashsum, ltcrypt, small, tv_gen, sizes & constants *4
docsbuilds the developer documentation doc/crypt.pdf
installinstalls the library and header files *7 *8
install_binsinstalls the binaries created by the bins target *7 *8
install_docsinstalls the documentation created by the docs target *7 *8
install_testinstalls the test-app created by the test target *7 *8
install_allinstalls everything (i.e. library, bins, docs and test) *8
uninstalluninstalls the library and header files

*4 also builds library

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

*7 also builds the necessary artifact(s) before installing it

*8 also have a look at the 'Installation' section of this file

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

Installation

There exist several install make-targets which are described in the table above.

These targets support the standard ways (c.f. [GNU], [FreeBSD]) to modify the installation path via the following set of variables:

DESTDIR
PREFIX
LIBPATH
INCPATH
DATAPATH
BINPATH

The entire set of the variables is only supported in makefile, makefile.shared and makefile.unix.

In case you have to use one of the other makefiles, check in the file which variables are supported.

Examples

You want to install the static library to the default paths

make install

You want to install the shared library to a special path and use it from this path

make -f makefile.shared PREFIX=/opt/special/path

Have a look at the developer documentation, [GNU] or [FreeBSD] to get a detailed explanation of all the variables.

CMake support

The project provides support for the CMake build system.

git clone https://github.com/libtom/libtomcrypt.git
mkdir -p libtomcrypt/build
cd libtomcrypt/build
cmake ..
make -j$(nproc)

More details around building with CMake can be found in the developer documentation.

shortlog
2024-02-26 Steffen JaeckelMerge pull request #636 from libtom/update-fortunadevelop
2024-02-26 Steffen JaeckelUpdate AES integration of fortuna
2024-02-26 Steffen JaeckelAdd `aes_enc_test()`
2024-02-26 Steffen JaeckelMerge pull request #640 from libtom/extend-tiger
2024-02-26 Steffen JaeckelAdd new make target `tvs`
2024-02-26 Steffen JaeckelUpdate docs
2024-02-26 Steffen JaeckelAdd support for Tiger2
2024-02-26 Steffen JaeckelAdd support for Tiger with more than 3 passes
2024-02-25 Steffen JaeckelFix potential memory leak
2023-10-09 Steffen JaeckelMerge pull request #612 from libtom/rsaaes_oaep_hashes
2023-10-09 Steffen JaeckelAdd possibility to use different hash algorithms in...
2023-10-08 Steffen JaeckelMerge pull request #633 from libtom/some-fixes
2023-10-05 Steffen JaeckelFix make incompatibility
2023-10-05 Steffen JaeckelAdd missing package name suffix to CMake/CPack
2023-10-05 Steffen JaeckelFix CMake with MSVC
2023-10-05 Steffen JaeckelFix compiler warning
...
tags
5 years ago v1.18.2 libtomcrypt v1.18.2
6 years ago v1.18.1 libtomcrypt v1.18.1
6 years ago v1.18.0 libtomcrypt v1.18.0
6 years ago v1.18.0-rc5 Release Candidate 5 of v1.18.0
6 years ago v1.18.0-rc4 Release Candidate 4 of v1.18.0
6 years ago v1.18.0-rc3 Release Candidate 3 of v1.18.0
6 years ago v1.18.0-rc2 Release Candidate 2 of v1.18.0
6 years ago v1.18.0-rc1 Release Candidate 1 of v1.18.0
13 years ago 1.17 added libtomcrypt-1.17
13 years ago 1.16 added libtomcrypt-1.16
13 years ago 1.15 added libtomcrypt-1.15
13 years ago 1.14 added libtomcrypt-1.14
13 years ago 1.13 added libtomcrypt-1.13
13 years ago 1.12 added libtomcrypt-1.12
13 years ago 1.11 added libtomcrypt-1.11
13 years ago 1.10 added libtomcrypt-1.10
...
heads
2 months ago add-pem-support
3 months ago fix-perl-cryptx-99
3 months ago develop
6 months ago appveyor/msvc2012
7 months ago fix-alignment
9 months ago fix-622
20 months ago regression-test-for-546
21 months ago amalgamation
3 years ago timing-benchmark
3 years ago pr/ecdsa-der-attempt1
3 years ago pr/wycheproof-fail-changed-seq-tag
3 years ago fix-b64-zero-length-array
3 years ago modes-use-ecb
4 years ago openssh-privkey
4 years ago remove-prng-registry
4 years ago travis-test
...