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

Function fxBigInt_mod_add

modules/crypt/arith/xsBigIntEx.c:112–122  ·  view source on GitHub ↗

* modular arithmetics */

Source from the content-addressed store, hash-verified

110 * modular arithmetics
111 */
112txBigInt *fxBigInt_mod_add(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *b, txBigInt *m, pool_t *pool)
113{
114 txBigInt *c = pool_get(the, m->size + 1, pool);
115
116 fxBigInt_add(the, c, a, b);
117 while (fxBigInt_ucomp(c, m) >= 0)
118 fxBigInt_sub(the, c, c, m);
119 fxBigInt_copy(r, c);
120 pool_put(c, m->size + 1);
121 return r;
122}
123
124txBigInt *fxBigInt_mod_dbl(txMachine *the, txBigInt *r, txBigInt *a, int k, txBigInt *m, pool_t *pool)
125{

Callers 2

ec_doubleFunction · 0.85
ec_addFunction · 0.85

Calls 6

pool_getFunction · 0.85
fxBigInt_addFunction · 0.85
fxBigInt_ucompFunction · 0.85
fxBigInt_subFunction · 0.85
fxBigInt_copyFunction · 0.85
pool_putFunction · 0.85

Tested by

no test coverage detected