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

Function xs_ec2_mul2

modules/crypt/arith/ec.c:140–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void
141xs_ec2_mul2(xsMachine *the)
142{
143 txECParam ec;
144 txECPoint r, p1, p2;
145 txBigInt *k1, *k2;
146 int i = 0;
147
148 xsmcVars(10);
149 get_ec_param(the, &ec, &i);
150 get_ecp(the, &p1, &xsArg(0), &i, &ec);
151 k1 = xsmcToBigInt(xsArg(1));
152 get_ecp(the, &p2, &xsArg(2), &i, &ec);
153 k2 = xsmcToBigInt(xsArg(3));
154 r.x = r.y = r.z = NULL;
155 // RI: r(x, y, z) will be fxBigInt_alloc'ed. Is it ok not to free?
156 fxBigInt_ec_mul2(the, &r, &p1, k1, &p2, k2, &ec);
157 fxBigInt_ec_norm(the, &r, &r, &ec);
158 set_ecp(the, &xsResult, &r, &ec);
159}

Callers

nothing calls this directly

Calls 5

get_ec_paramFunction · 0.85
get_ecpFunction · 0.85
fxBigInt_ec_mul2Function · 0.85
fxBigInt_ec_normFunction · 0.85
set_ecpFunction · 0.85

Tested by

no test coverage detected