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

Function fxBigInt_ec_mul

modules/crypt/arith/xsBigIntEx.c:849–870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

847}
848
849void fxBigInt_ec_mul(txMachine *the, txECPoint *r, txECPoint *a, txBigInt *k, txECParam *ec)
850{
851 int i;
852 pool_t pool;
853
854 if (r->z == NULL)
855 r->z = fxBigInt_alloc(the, ec->m->size);
856 if (r->y == NULL)
857 r->y = fxBigInt_alloc(the, ec->m->size);
858 if (r->x == NULL)
859 r->x = fxBigInt_alloc(the, ec->m->size);
860 fxBigInt_copy(r->z, &gxBigIntZero);
861
862 pool_init(&pool);
863 for (i = fxBigInt_bitsize(k); --i >= 0;) {
864 ec_double(the, r, r, ec, &pool);
865 if (fxBigInt_isset(k, i)) {
866 ec_add(the, r, r, a, ec, &pool);
867 }
868 }
869 pool_dispose(the, &pool);
870}
871
872void fxBigInt_ec_mul2(txMachine *the, txECPoint *r, txECPoint *a1, txBigInt *k1, txECPoint *a2, txBigInt *k2, txECParam *ec)
873{

Callers 1

xs_ec2_mulFunction · 0.85

Calls 8

fxBigInt_allocFunction · 0.85
fxBigInt_copyFunction · 0.85
pool_initFunction · 0.85
fxBigInt_bitsizeFunction · 0.85
ec_doubleFunction · 0.85
fxBigInt_issetFunction · 0.85
ec_addFunction · 0.85
pool_disposeFunction · 0.85

Tested by

no test coverage detected