Integerring: Is there a smart and fast way to calculate the modulo of big numbers (of power > 128 ( basis 2)) stored as an array?

30 Views Asked by At

Is there a smart and fast way to calculate the modulo of big numbers (of power > 128 ( basis 2)) stored as an array ? Are there some tricks, or theorems I could look up to ?

I thought about expressing that number as power $a^b \mod\text{ big number}$ maybe creating the possibility to shorten the time complexity of the usual division modular algorithm. This power (powmod) can be fastly computed. But I suspect that the logarithm in integerrings isn't that fast ;)