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

Function get_ec_param

modules/crypt/arith/ec.c:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51extern txBigInt gxBigIntOne;
52
53static void get_ec_param(xsMachine *the, txECParam *ec, int *i)
54{
55 xsmcGet(xsVar(*i), xsThis, xsID_m);
56 ec->m = xsmcToBigInt(xsVar(*i));
57 (*i)++;
58 xsmcGet(xsVar(*i), xsThis, xsID_a);
59 ec->a = xsmcToBigInt(xsVar(*i));
60 (*i)++;
61 xsmcGet(xsVar(*i), xsThis, xsID_b);
62 ec->b = xsmcToBigInt(xsVar(*i));
63 (*i)++;
64 ec->u = mont_init(ec->m);
65 ec->a = mont_in(the, NULL, ec->a, ec->m);
66 ec->b = mont_in(the, NULL, ec->b, ec->m);
67 ec->one = mont_in(the, NULL, &gxBigIntOne, ec->m);
68 // RI: (a, b, one) are fxBigInt_alloc'ed. Is it no to free?
69}
70
71static void get_ecp(xsMachine *the, txECPoint *p, xsSlot *slot, int *i, txECParam *ec)
72{

Callers 3

xs_ec2_addFunction · 0.85
xs_ec2_mulFunction · 0.85
xs_ec2_mul2Function · 0.85

Calls 2

mont_initFunction · 0.85
mont_inFunction · 0.85

Tested by

no test coverage detected