Modular exponentiation mpn_powm and special prime modulus

Torbjörn Granlund tg at
Mon Jan 19 17:46:03 UTC 2015

Miele Andrea <andrea.miele at> writes:

  I was wondering if modular exponentiation functions like mpn_powm can
  take advantage of a prime modulus p such that p = -1 mod 2^64 or mod
  2^32 which allows to save some (single digit) multiplications in the
  Montgomery multiplication algorithm.
GMP does not special case Mersenne numbers (prime or non-prime) in its
modular powering code.

Please encrypt, key id 0xC8601622

More information about the gmp-discuss mailing list