LibTomMath is a free open source portable number theoretic multiple-precision

integer library written entirely in C. The library is designed to provide a
simple to work with API to fairly efficient routines from various branches of
number theory.

OK sthen@
This commit is contained in:
czarkoff 2015-05-27 16:30:37 +00:00
parent 1fb6cd6451
commit a7d8c1a473
4 changed files with 94 additions and 0 deletions

43
math/libtommath/Makefile Normal file
View File

@ -0,0 +1,43 @@
# $OpenBSD: Makefile,v 1.1.1.1 2015/05/27 16:30:37 czarkoff Exp $
COMMENT = number theoretic multiple-precision integer library
V = 0.42.0
DISTNAME = libtommath-$V
CATEGORIES = math
HOMEPAGE = http://libtom.net/
MAINTAINER = Dmitrij D. Czarkoff <czarkoff@gmail.com>
GH_ACCOUNT = libtom
GH_PROJECT = libtommath
GH_TAGNAME = v${V}
# Public Domain
PERMIT_PACKAGE_CDROM = Yes
BUILD_DEPENDS = print/texlive/base
MAKE_FLAGS = IGNORE_SPEED=Yes
FAKE_FLAGS = DESTDIR=${WRKINST}${PREFIX} \
LIBPATH=/lib \
INCPATH=/include
USE_GMAKE = Yes
MAKE_FILE = makefile
WRKDIST = ${WRKDIR}/${PKGNAME}
ALL_TARGET = default docs manual
TEST_TARGET = mtest
TEST_IS_INTERACTIVE = Yes
DOCPATH=${PREFIX}/share/doc/libtommath
post-test:
@echo "\n\n\tThe test will run until interrupted (eg. by Control-C).\n"
${WRKBUILD}/mtest/mtest | ${WRKBUILD}/test
post-install:
${INSTALL_DATA_DIR} ${DOCPATH}
${INSTALL_DATA} ${WRKDIST}/bn.pdf ${DOCPATH}/manual.pdf
${INSTALL_DATA} ${WRKDIST}/tommath.pdf ${DOCPATH}/tommath.pdf
.include <bsd.port.mk>

2
math/libtommath/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (libtommath-0.42.0.tar.gz) = UkY1a6GMG27fSnvINqPSI4QrhpFM26bdjBEr/FniJ8g=
SIZE (libtommath-0.42.0.tar.gz) = 1732144

41
math/libtommath/pkg/DESCR Normal file
View File

@ -0,0 +1,41 @@
LibTomMath is a free open source portable number theoretic multiple-precision
integer library written entirely in C. The library is designed to provide a
simple to work with API to fairly efficient routines from various branches of
number theory:
* Simple Algebraic
- Addition
- Subtraction
- Multiplication
- Squaring
- Division
* Digit Manipulation
- Shift left/right whole digits (mult by 2b by moving digits)
- Fast multiplication/division by 2 and 2k for k>1
- Binary AND, OR and XOR gates
* Modular Reductions
- Barrett Reduction (fast for any p)
- Montgomery Reduction (faster for any odd p)
- DR Reduction (faster for any restricted p see manual)
- 2k Reduction (fast reduction modulo 2p - k for k < MP_MASK and for
k > MP_MASK)
- The exptmod logic can use any of the five reduction algorithms when
appropriate with a single function call.
* Number Theoretic
- Greatest Common Divisor
- Least Common Multiple
- Jacobi Symbol Computation (falls back to Legendre for prime moduli)
- Multiplicative Inverse
- Extended Euclidean Algorithm
- Modular Exponentiation
- Fermat and Miller-Rabin Primality Tests, utility function such as is_prime
and next_prime
* Miscellaneous
- Root finding over Z
- Pseudo-random integers
- Signed and Unsigned comparisons
* Optimizations
- Fast Comba based Multiplier, Squaring and Montgomery routines.
- Montgomery, Diminished Radix and Barrett based modular exponentiation.
- Karatsuba and Toom-Cook multiplication algorithms.
- Many pointer aliasing optimiztions throughout the entire library.

View File

@ -0,0 +1,8 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2015/05/27 16:30:37 czarkoff Exp $
include/tommath.h
include/tommath_class.h
include/tommath_superclass.h
lib/libtommath.a
share/doc/libtommath/
share/doc/libtommath/manual.pdf
share/doc/libtommath/tommath.pdf