What complexity does the GMP function mpz_powm have?
There are many ways to implement modular exponentiation. Does it use "Right-to-left binary method" which runs in O(log e)?
I would like to use it for large exponents, which doesn't scale for O(e).
I just implemented my own based on another implementation in github. It's a simple implementation with similar run-time and which I also know is O(log e), and allowing me to log and stop where it freezes. This confirms the official implementation is as fast as I hoped, which sadly turned out to be not fast enough for my purposes.