| 448 | } |
| 449 | |
| 450 | txBigInt *mont_out(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *m, txU4 u) |
| 451 | { |
| 452 | /* convert x' -> Mont(x', 1) = x'R^{-1} mod m -- same as Montgomery reduction */ |
| 453 | pool_t pool; // must be a small pool |
| 454 | if (r == NULL) |
| 455 | r = fxBigInt_alloc(the, m->size); |
| 456 | pool_init(&pool); |
| 457 | mont_reduction(the, r, a, m, u, &pool); |
| 458 | pool_dispose(the, &pool); |
| 459 | return r; |
| 460 | } |
| 461 | |
| 462 | static txBigInt *mont_mul(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *b, txBigInt *m, txU4 u, pool_t *pool) |
| 463 | { |
no test coverage detected