| 137 | } |
| 138 | |
| 139 | txBigInt *fxBigInt_mod_sub(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *b, txBigInt *m, pool_t *pool) |
| 140 | { |
| 141 | txBigInt *c = pool_get(the, m->size + 1, pool); |
| 142 | |
| 143 | fxBigInt_sub(the, c, a, b); |
| 144 | if (c->sign) { |
| 145 | while (c->sign) |
| 146 | fxBigInt_add(the, c, c, m); |
| 147 | } |
| 148 | else { |
| 149 | while (fxBigInt_ucomp(c, m) >= 0) |
| 150 | fxBigInt_sub(the, c, c, m); |
| 151 | } |
| 152 | fxBigInt_copy(r, c); |
| 153 | pool_put(c, m->size + 1); |
| 154 | return r; |
| 155 | } |
| 156 | |
| 157 | txBigInt *fxBigInt_mod_inv(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *m, pool_t *pool) |
| 158 | { |
no test coverage detected