| 1588 | } |
| 1589 | |
| 1590 | txBigInt *fxBigInt_umul1(txMachine* the, txBigInt *r, txBigInt *a, txU4 b) |
| 1591 | { |
| 1592 | int i, n; |
| 1593 | txU4 c = 0; |
| 1594 | txU4 *ap, *rp; |
| 1595 | txU8 wa, wr; |
| 1596 | |
| 1597 | if (r == NULL) |
| 1598 | r = fxBigInt_alloc(the, a->size + 1); |
| 1599 | ap = a->data; |
| 1600 | rp = r->data; |
| 1601 | n = a->size; |
| 1602 | for (i = 0; i < n; i++) { |
| 1603 | wa = (txU8)ap[i]; |
| 1604 | wr = wa * b + c; |
| 1605 | c = mxBigIntHighWord(wr); |
| 1606 | rp[i] = mxBigIntLowWord(wr); |
| 1607 | } |
| 1608 | if (c != 0) |
| 1609 | rp[i] = c; |
| 1610 | else { |
| 1611 | /* remove leading 0s */ |
| 1612 | while (--i > 0 && rp[i] == 0) |
| 1613 | ; |
| 1614 | } |
| 1615 | r->size = i + 1; |
| 1616 | return(r); |
| 1617 | } |
| 1618 | |
| 1619 | txBigInt *fxBigInt_exp(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b) |
| 1620 | { |
no test coverage detected