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

Function fxBigInt_mod

xs/sources/xsBigInt.c:1735–1749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1733}
1734
1735txBigInt *fxBigInt_mod(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b)
1736{
1737 txBigInt *q;
1738 mxBigInt_meter(((a->size - b->size) * (a->size + b->size)));
1739 if (r == NULL)
1740 r = fxBigInt_alloc(the, a->sign ? b->size : MIN(a->size, b->size));
1741 q = fxBigInt_udiv(the, NULL, a, b, &r);
1742 if (a->sign) {
1743 if (!fxBigInt_iszero(r))
1744 r = fxBigInt_sub(the, r, b, r);
1745 }
1746 fxBigInt_free(the, q);
1747 mxBigInt_meter(r->size);
1748 return(r);
1749}
1750
1751txBigInt *fxBigInt_rem(txMachine* the, txBigInt *r, txBigInt *a, txBigInt *b)
1752{

Callers 8

fxBigInt_mod_modFunction · 0.85
fxBigInt_mod_mulFunction · 0.85
fxBigInt_mod_squareFunction · 0.85
fxBigInt_mod_exp_LRFunction · 0.85
mont_inFunction · 0.85
mont_exp_initFunction · 0.85
fxBigInt_mont_exp_LRFunction · 0.85
fxBigInt_mont_exp_SWFunction · 0.85

Calls 5

fxBigInt_allocFunction · 0.85
fxBigInt_udivFunction · 0.85
fxBigInt_iszeroFunction · 0.85
fxBigInt_subFunction · 0.85
fxBigInt_freeFunction · 0.85

Tested by

no test coverage detected