I see what you want to say:
Instead (x*x*x*x*x*x*...*x) mod y it is possible do not calculate
the whole huge product of x, and one should take modulo after every mult,
((((x*x) mod y) *x) mod y) * x) mod y ...
That is good guess. But are consequental mults a single way of powering ???
Do you know anything about really fast power algorithm (ordinary or modular) ?
