Break large exponent calculation into smaller calculations? I am implementing SRP on an embedded platform. It has crypto acceleration and I am using its built in modular exponentiation function, however it doesn't seem to be able to handle an exponent over 32 bytes long. I have an exponent i need to use which is 64 bytes long.  

Is there a way to break this exponentiation into smaller exponentiations that the modular exponentiation function can handle?
One method uses the factorisation the exponent: If $a=bc$ then $x^a \equiv x^{bc}\equiv (x^b)^c \mod m,$
i.e. first compute $y=x^b\mod  m$ and then $y^c \mod m$. 

This method will work,  if the largest factor of the exponent has at most 32 bytes.

Otherwise you can always use the square-and-multiply exponentitation
method (see https://en.wikipedia.org/wiki/Modular_exponentiation or https://en.wikipedia.org/wiki/Modular_exponentiation or  https://en.wikipedia.org/wiki/Exponentiation_by_squaring)
looping over the single bits of the exponent.