Arithmetic complexity of mod powers

33 Views Asked by At

Given $a,b,p\in\Bbb N$ what is the computational complexity of computing $a^{p^b}\bmod p$? Is it $O((\log a)(\log b)(\log p))$ arithmetic operations on $\log p$ sized words?

$p$ need not be prime.