| 1313 | } |
| 1314 | |
| 1315 | txBigInt *fxBigInt_ulsr1(txMachine* the, txBigInt *r, txBigInt *a, txU4 sw) |
| 1316 | { |
| 1317 | int wsz, bsz; |
| 1318 | int i, n; |
| 1319 | |
| 1320 | wsz = sw / mxBigIntWordSize; |
| 1321 | bsz = sw % mxBigIntWordSize; |
| 1322 | n = a->size - wsz; |
| 1323 | if (n <= 0) { |
| 1324 | if (r == NULL) r = fxBigInt_alloc(the, 1); |
| 1325 | r->size = 1; |
| 1326 | r->data[0] = 0; |
| 1327 | return(r); |
| 1328 | } |
| 1329 | /* 'r' can be the same as 'a' */ |
| 1330 | if (r == NULL) |
| 1331 | r = fxBigInt_alloc(the, n); |
| 1332 | if (bsz == 0) { |
| 1333 | c_memmove(r->data, &a->data[wsz], n * sizeof(txU4)); |
| 1334 | r->size = n; |
| 1335 | } |
| 1336 | else { |
| 1337 | for (i = 0; i < n - 1; i++) |
| 1338 | r->data[i] = (a->data[i + wsz] >> bsz) | (a->data[i + wsz + 1] << (mxBigIntWordSize - bsz)); |
| 1339 | r->data[i] = a->data[i + wsz] >> bsz; |
| 1340 | r->size = (n > 1 && r->data[n - 1] == 0) ? n - 1: n; |
| 1341 | } |
| 1342 | return(r); |
| 1343 | } |
| 1344 | |
| 1345 | txBigInt *fxBigInt_nop(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b) |
| 1346 | { |
no test coverage detected