exponentiation by squaring

ウィキペディアから