I am trying to compute a^b^c mod p for some positive integers a,b,c,p. One possible (and obvious) way is to use fast modular exponentiation which will run in O(log(b^c))=clog(b)
. While I don't mind the efficiency here, the obvious downfall of this method is that you need an explicit binary representation of b^c
which in itself is already exponential.
So the question for me is, if I can not represent b^c
as a binary representation, is there a way I can compute a^b^c
mod p from the binary representations of a,b, and c
?