| 1265 | } |
| 1266 | |
| 1267 | txBigInt *fxBigInt_ulsl1(txMachine* the, txBigInt *r, txBigInt *a, txU4 sw) |
| 1268 | { |
| 1269 | txU4 wsz, bsz; |
| 1270 | int n; |
| 1271 | |
| 1272 | wsz = sw / mxBigIntWordSize; |
| 1273 | bsz = sw % mxBigIntWordSize; |
| 1274 | n = a->size + wsz + ((bsz == 0) ? 0 : 1); |
| 1275 | if (r == NULL) |
| 1276 | r = fxBigInt_alloc(the, n); |
| 1277 | if (bsz == 0) { |
| 1278 | c_memmove(&r->data[wsz], a->data, a->size * sizeof(txU4)); |
| 1279 | c_memset(r->data, 0, wsz * sizeof(txU4)); |
| 1280 | r->size = a->size + wsz; |
| 1281 | } |
| 1282 | else { |
| 1283 | r->data[a->size + wsz] = a->data[a->size - 1] >> (mxBigIntWordSize - bsz); |
| 1284 | for (n = a->size; --n >= 1;) |
| 1285 | r->data[n + wsz] = (a->data[n] << bsz) | (a->data[n - 1] >> (mxBigIntWordSize - bsz)); |
| 1286 | r->data[wsz] = a->data[0] << bsz; |
| 1287 | /* clear the remaining part */ |
| 1288 | for (n = wsz; --n >= 0;) |
| 1289 | r->data[n] = 0; |
| 1290 | /* adjust r */ |
| 1291 | r->size = a->size + wsz + (r->data[a->size + wsz] == 0 ? 0: 1); |
| 1292 | } |
| 1293 | return(r); |
| 1294 | } |
| 1295 | |
| 1296 | txBigInt *fxBigInt_lsr(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b) |
| 1297 | { |
no test coverage detected