Any advice on computing 2^n modulo m for MANY values of m, m is 64-bit, n is <10000 say

Pedro Gimeno gmpdiscuss at formauri.es
Sat Mar 21 17:24:07 UTC 2020


William Galway wrote on 2020-03-18 19:53:
>   I've been considering this computation off-and-on for many years, so my
> apologies if I'm repeating a previous post.
> 
> I'd like to calculate $2^n$ modulo $m$ with $n$ fixed

Out of curiosity, how much faster is mpz_powm vs just mpz_mod on the pre-calculated 2^n?


More information about the gmp-discuss mailing list