* modular arithmetics */
| 110 | * modular arithmetics |
| 111 | */ |
| 112 | txBigInt *fxBigInt_mod_add(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *b, txBigInt *m, pool_t *pool) |
| 113 | { |
| 114 | txBigInt *c = pool_get(the, m->size + 1, pool); |
| 115 | |
| 116 | fxBigInt_add(the, c, a, b); |
| 117 | while (fxBigInt_ucomp(c, m) >= 0) |
| 118 | fxBigInt_sub(the, c, c, m); |
| 119 | fxBigInt_copy(r, c); |
| 120 | pool_put(c, m->size + 1); |
| 121 | return r; |
| 122 | } |
| 123 | |
| 124 | txBigInt *fxBigInt_mod_dbl(txMachine *the, txBigInt *r, txBigInt *a, int k, txBigInt *m, pool_t *pool) |
| 125 | { |
no test coverage detected