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

Function get_ecp

modules/crypt/arith/ec.c:71–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static void get_ecp(xsMachine *the, txECPoint *p, xsSlot *slot, int *i, txECParam *ec)
72{
73 xsmcGet(xsVar(*i), *slot, xsID_x);
74 p->x = xsmcToBigInt(xsVar(*i));
75 (*i)++;
76 xsmcGet(xsVar(*i), *slot, xsID_y);
77 p->y = xsmcToBigInt(xsVar(*i));
78 (*i)++;
79 xsmcGet(xsVar(*i), *slot, xsID_z);
80 p->z = xsmcToBigInt(xsVar(*i));
81 (*i)++;
82 p->x = mont_in(the, NULL, p->x, ec->m);
83 p->y = mont_in(the, NULL, p->y, ec->m);
84 p->z = mont_in(the, NULL, p->z, ec->m);
85 // RI: those (x, y, z) are fxBigInt_alloc'ed. Is it ok not to free?
86}
87
88static void set_ecp(xsMachine *the, xsSlot *slot, txECPoint *p, txECParam *ec)
89{

Callers 3

xs_ec2_addFunction · 0.85
xs_ec2_mulFunction · 0.85
xs_ec2_mul2Function · 0.85

Calls 1

mont_inFunction · 0.85

Tested by

no test coverage detected