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

Function mont_out

modules/crypt/arith/xsBigIntEx.c:450–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450txBigInt *mont_out(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *m, txU4 u)
451{
452 /* convert x' -> Mont(x', 1) = x'R^{-1} mod m -- same as Montgomery reduction */
453 pool_t pool; // must be a small pool
454 if (r == NULL)
455 r = fxBigInt_alloc(the, m->size);
456 pool_init(&pool);
457 mont_reduction(the, r, a, m, u, &pool);
458 pool_dispose(the, &pool);
459 return r;
460}
461
462static txBigInt *mont_mul(txMachine *the, txBigInt *r, txBigInt *a, txBigInt *b, txBigInt *m, txU4 u, pool_t *pool)
463{

Callers 4

fxBigInt_mont_exp_LRFunction · 0.85
fxBigInt_mont_exp_SWFunction · 0.85
fxBigInt_ec_normFunction · 0.85
set_ecpFunction · 0.85

Calls 4

fxBigInt_allocFunction · 0.85
pool_initFunction · 0.85
mont_reductionFunction · 0.85
pool_disposeFunction · 0.85

Tested by

no test coverage detected