This is some old code for bignum modular arithmetic using gnu mp. It's supposed to work, so far as it goes, or at least so far as described in the little manual for it (), but is not being actively worked. See redc1 for some similar single-word code.

The best feature is a sub-quadratic version of Peter L. Montgomery's REDC algorithm, though it only becomes sub-quadratic above about perhaps 3500 bits. Function pointers do a dispatch to code specific to the modulus, so special moduli like 2^N-1 can be handled with a generic set of functions, and some parts of algorithm selection can be done at initialization.

Download version 2 here:

mpm-2.tar.gz (82k)

The .asc is a Gnu PG ascii armoured signatures, generated from my key.

This page Copyright 2007, 2009, 2011, 2013, 2014, 2015, 2016 Kevin Ryde, except for the GPLv3 logo which is Copyright Free Software Foundation and used here in accordance with its terms.

(Back to the sitemap.)