}
#endif
-/* target[len] = x, target = target % mod */
+/* target[len] = x, target = target % mod
+ * assumes that target < (mod << MP_T_BITS)! */
static void
mpdomod(int len, mp_t *target, mp2_t x, mp_t *mod)
{
int i, j;
- /* assumes that x does not overflow, i.e. target is not much bigger than mod! */
for (i = len - 1; i >= 0; i--)
{
x = (x << MP_T_BITS) | target[i];
mpdomod(len, target, x, mod);
}
-/* target = target * 2 ^ MP_T_BITS */
+/* target = target << MP_T_BITS */
static void
mpshift(int len, mp_t *target, mp_t *mod)
{