+ mp_rscan(&sc, e);
+ if (!MP_RSTEP(&sc))
+ goto exit;
+ while (!MP_RBIT(&sc))
+ MP_RSTEP(&sc);
+
+ /* --- Do the main body of the work --- */
+
+ for (;;) {
+ sq++;
+ while (sq) {
+ mp *y;
+ y = mp_sqr(spare, x);
+ y = mpbarrett_reduce(mb, y, y);
+ spare = x; x = y;
+ sq--;
+ }
+ {
+ mp *y = mp_mul(spare, x, a);
+ y = mpbarrett_reduce(mb, y, y);
+ spare = x; x = y;
+ }