* Montgomery method */
| 395 | * Montgomery method |
| 396 | */ |
| 397 | txU4 mont_init(txBigInt *m) |
| 398 | { |
| 399 | txU4 a = m->data[0]; |
| 400 | txU4 x, s, d; |
| 401 | int n; |
| 402 | |
| 403 | x = 1; |
| 404 | for (n = mxBigIntWordSize - 1, s = 2; --n >= 0; s <<= 1) { |
| 405 | d = a * x; |
| 406 | if (d & s) |
| 407 | x += s; |
| 408 | } |
| 409 | return ~x + 1; |
| 410 | } |
| 411 | |
| 412 | txBigInt *mont_reduction(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *m, txU4 u, pool_t *pool) |
| 413 | { |
no outgoing calls
no test coverage detected