bluescarni / mppp

Multiprecision for modern C++
Mozilla Public License 2.0
305 stars 26 forks source link

No powm or invert? #201

Open thehans opened 5 years ago

thehans commented 5 years ago

I just stumbled across this project and was interested to test it out and compare performance with GMP. I am writing software to factor Mersenne numbers, and my use case deals mostly with 1 to 2 limb(64bit) values, so mppp being optimized for small values sounded ideal. But I make heavy use of modular exponentiation (mpz_powm), plus a few calls to mpz_invert.

Searching through the documentation I didn't immediately see any reference to either. Are these planned to be added eventually?

bluescarni commented 5 years ago

Hi @thehans,

those functions are not in mppp because I haven't had much use for them so far. It should not be an issue to add them for the next release.

bluescarni commented 4 years ago

@thehans just a quick update. I haven't had much time to look into this feature in the last couple of months, so I think it is unlikely it will end up in mp++ 0.18 (which I would like to release relatively soon for other reasons).

I did some preliminary work in #205 with the implementation of (modular) squaring but I really need to go and study in some detail what GMP is doing before coming up with a subpar solution. This is an area of multiprecision arithmetics which I hadn't really much looked into before, and I really need to study the topic a bit more.