answered 6 years ago
Using pow(a, b, c) instead of a.powermod(b, c) should work.
pow(a, b, c)
a.powermod(b, c)