| 847 | } |
| 848 | |
| 849 | void fxBigInt_ec_mul(txMachine *the, txECPoint *r, txECPoint *a, txBigInt *k, txECParam *ec) |
| 850 | { |
| 851 | int i; |
| 852 | pool_t pool; |
| 853 | |
| 854 | if (r->z == NULL) |
| 855 | r->z = fxBigInt_alloc(the, ec->m->size); |
| 856 | if (r->y == NULL) |
| 857 | r->y = fxBigInt_alloc(the, ec->m->size); |
| 858 | if (r->x == NULL) |
| 859 | r->x = fxBigInt_alloc(the, ec->m->size); |
| 860 | fxBigInt_copy(r->z, &gxBigIntZero); |
| 861 | |
| 862 | pool_init(&pool); |
| 863 | for (i = fxBigInt_bitsize(k); --i >= 0;) { |
| 864 | ec_double(the, r, r, ec, &pool); |
| 865 | if (fxBigInt_isset(k, i)) { |
| 866 | ec_add(the, r, r, a, ec, &pool); |
| 867 | } |
| 868 | } |
| 869 | pool_dispose(the, &pool); |
| 870 | } |
| 871 | |
| 872 | void fxBigInt_ec_mul2(txMachine *the, txECPoint *r, txECPoint *a1, txBigInt *k1, txECPoint *a2, txBigInt *k2, txECParam *ec) |
| 873 | { |
no test coverage detected