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

Function fxBigInt_mod_dbl

modules/crypt/arith/xsBigIntEx.c:124–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124txBigInt *fxBigInt_mod_dbl(txMachine *the, txBigInt *r, txBigInt *a, int k, txBigInt *m, pool_t *pool)
125{
126 txBigInt *t = pool_get(the, m->size + 1, pool);
127
128 fxBigInt_copy(r, a);
129 while (--k >= 0) {
130 fxBigInt_ulsl1(the, t, r, 1);
131 while (fxBigInt_ucomp(t, m) >= 0)
132 fxBigInt_sub(the, t, t, m);
133 fxBigInt_copy(r, t);
134 }
135 pool_put(t, m->size + 1);
136 return r;
137}
138
139txBigInt *fxBigInt_mod_sub(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *b, txBigInt *m, pool_t *pool)
140{

Callers 2

ec_doubleFunction · 0.85
ec_addFunction · 0.85

Calls 6

pool_getFunction · 0.85
fxBigInt_copyFunction · 0.85
fxBigInt_ulsl1Function · 0.85
fxBigInt_ucompFunction · 0.85
fxBigInt_subFunction · 0.85
pool_putFunction · 0.85

Tested by

no test coverage detected