Extension to GMP library that allows fast fixed-basis exponentiations, simultaneous exponentiation, and randomly choosing safe-primes.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.macros.m4
.travis.yml
.version.m4
AUTHORS
COPYING
COPYING.LESSER
COPYING_HEADERS
ChangeLog
Makefile.am
Makefile.build
NEWS
README.md
README_DEV.md
array_alloc.c
array_alloc_init.c
array_clear_dealloc.c
array_urandomb.c
configure.ac
doxygen.cfg
extract_GMP_CFLAGS.c
fpowm.c
fpowm_clear.c
fpowm_init.c
fpowm_init_precomp.c
fpowm_precomp.c
gen_trialdiv.py
gmpmee-info.src
gmpmee.c
gmpmee.h
millerrabin_clear.c
millerrabin_init.c
millerrabin_next_cand.c
millerrabin_next_rs.c
millerrabin_once.c
millerrabin_reps_rs.c
millerrabin_rs.c
millerrabin_safe_clear.c
millerrabin_safe_init.c
millerrabin_safe_next_cand.c
millerrabin_safe_next_rs.c
millerrabin_safe_reps_rs.c
millerrabin_safe_rs.c
millerrabin_safe_trial.c
millerrabin_trial.c
optimize.py
probab_prime_p_next.c
probab_safe_prime_p.c
probab_safe_prime_p_next.c
spowm.c
spowm_block_batch.c
spowm_clear.c
spowm_init.c
spowm_naive.c
spowm_precomp.c
spowm_table.c

README.md

GMP Modular Exponentiation Extension (GMPMEE)

Overview

This is a minor extension of the Gnu Multiprecision Library (GNU MP). It adds simultaneous modular exponentiation and fixed base modular exponentiation functionality to the set of integer functions (the mpz-functions), as well as special purpose primality testing routines.

GMP does contain primality testing routines, but these do not use cryptographically strong randomness and they do not allow fast testing or sieving for safe-primality.

Note that no attempt is made to make this secure against side-channel attacks, since there is no need for this type of protection in the applications for which this library was implemented.

For a detailed account of such algorithms, a good source is Handbook of Applied Cryptography, Menezes, Oorshot, and Vanstone, which is available for free.

The following assumes that you are using a distribution. Developers should also read README_DEV.md.

Building

If you are using a distribution, then you simply use

    ./configure
    make

to build the library and an executable gmpmee that allows testing and benchmarking some of the routines.

Installing

Use

    make install

to install the library libgmpmee.{la,a,so} and the corresponding header file gmpmee.h in the standard locations. See INSTALL for details on other ways to invoke ./configure, e.g., to use a user-local installation.

You may need to run sudo /sbin/ldconfig on some platforms which have flawed implementations of the cache that stores locations of libraries.

Usage

If you have done a standard install you may use the library by including gmpmee.h and adding the flags -lgmp -lgmpmee. We could for example compile a program foo.c using the library as

    gcc foo.c -o foo -lgmpmee -lgmp

If you have done a non-standard installation you may need to update some environment variables.

API Documentation

You may use

    make api

to build also some documentation using Doxygen (this assumes you have installed doxygen). The API is not installed anywhere. You can copy it to any location.

Reporting Bugs

Minor bugs should be reported in the repository system as issues or bugs. Security critical bugs, vulnerabilities, etc should be reported directly to Verificatum Project. We will make best effort to disclose the information in a responsible way before the finder gets proper credit.