MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxBigInt_uadd

Function fxBigInt_uadd

xs/sources/xsBigInt.c:1469–1491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1467#endif
1468
1469txBigInt *fxBigInt_uadd(txMachine* the, txBigInt *rr, txBigInt *aa, txBigInt *bb)
1470{
1471 txBigInt *x, *y;
1472 int c;
1473
1474 if (aa->size < bb->size) {
1475 x = aa;
1476 y = bb;
1477 }
1478 else {
1479 x = bb;
1480 y = aa;
1481 }
1482 if (rr == NULL)
1483 rr = fxBigInt_alloc(the, y->size + 1);
1484 c = fxBigInt_uadd_prim(rr->data, x->data, y->data, x->size, y->size);
1485 /* CAUTION: rr may equals aa or bb. do not touch until here */
1486 rr->size = y->size;
1487 rr->sign = 0;
1488 if (c != 0)
1489 rr->data[rr->size++] = 1;
1490 return(rr);
1491}
1492
1493txBigInt *fxBigInt_usub(txMachine* the, txBigInt *rr, txBigInt *aa, txBigInt *bb)
1494{

Callers 14

mont_reductionFunction · 0.85
mont_mulFunction · 0.85
fxBigIntParseFunction · 0.85
fxBigIntParseBFunction · 0.85
fxBigIntParseOFunction · 0.85
fxBigIntParseXFunction · 0.85
fxBigInt_notFunction · 0.85
fxBigInt_andFunction · 0.85
fxBigInt_orFunction · 0.85
fxBigInt_xorFunction · 0.85
fxBigInt_lslFunction · 0.85
fxBigInt_lsrFunction · 0.85

Calls 2

fxBigInt_allocFunction · 0.85
fxBigInt_uadd_primFunction · 0.85

Tested by

no test coverage detected