Lines Matching defs:px
58 /* Checks if point P(px, py) is at infinity. Uses affine coordinates. */
60 ec_GFp_pt_is_inf_aff(const mp_int *px, const mp_int *py)
63 if ((mp_cmp_z(px) == 0) && (mp_cmp_z(py) == 0)) {
71 /* Sets P(px, py) to be the point at infinity. Uses affine coordinates. */
73 ec_GFp_pt_set_inf_aff(mp_int *px, mp_int *py)
75 mp_zero(px);
85 ec_GFp_pt_add_aff(const mp_int *px, const mp_int *py, const mp_int *qx,
96 MP_CHECKOK(mp_init(&lambda, FLAG(px)));
97 MP_CHECKOK(mp_init(&temp, FLAG(px)));
98 MP_CHECKOK(mp_init(&tempx, FLAG(px)));
99 MP_CHECKOK(mp_init(&tempy, FLAG(px)));
101 if (ec_GFp_pt_is_inf_aff(px, py) == 0) {
109 MP_CHECKOK(mp_copy(px, rx));
114 /* if px != qx, then lambda = (py-qy) / (px-qx) */
115 if (mp_cmp(px, qx) != 0) {
117 MP_CHECKOK(group->meth->field_sub(px, qx, &tempx, group->meth));
146 /* rx = lambda^2 - px - qx */
148 MP_CHECKOK(group->meth->field_sub(&tempx, px, &tempx, group->meth));
171 ec_GFp_pt_sub_aff(const mp_int *px, const mp_int *py, const mp_int *qx,
179 MP_CHECKOK(mp_init(&nqy, FLAG(px)));
182 res = group->point_add(px, py, qx, &nqy, rx, ry, group);
192 ec_GFp_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx,
195 return ec_GFp_pt_add_aff(px, py, px, py, rx, ry, group);
205 ec_GFp_pt_mul_aff(const mp_int *n, const mp_int *px, const mp_int *py,
233 MP_CHECKOK(mp_copy(px, &qx));
298 ec_GFp_validate_point(const mp_int *px, const mp_int *py, const ECGroup *group)
308 MP_CHECKOK(mp_init(&accl, FLAG(px)));
309 MP_CHECKOK(mp_init(&accr, FLAG(px)));
310 MP_CHECKOK(mp_init(&tmp, FLAG(px)));
311 MP_CHECKOK(mp_init(&pxt, FLAG(px)));
312 MP_CHECKOK(mp_init(&pyt, FLAG(px)));
315 if (ec_GFp_pt_is_inf_aff(px, py) == MP_YES) {
322 if ((MP_SIGN(px) == MP_NEG) || (mp_cmp(px, &group->meth->irr) >= 0) ||
329 group->meth->field_enc(px, &pxt, group->meth);
332 mp_copy(px, &pxt);
352 MP_CHECKOK( ECPoint_mul(group, &group->order, px, py, &pxt, &pyt) );