Lines Matching defs:px
61 /* Converts a point P(px, py) from affine coordinates to Jacobian
66 ec_GFp_pt_aff2jac(const mp_int *px, const mp_int *py, mp_int *rx,
71 if (ec_GFp_pt_is_inf_aff(px, py) == MP_YES) {
74 MP_CHECKOK(mp_copy(px, rx));
85 /* Converts a point P(px, py, pz) from Jacobian projective coordinates to
90 ec_GFp_pt_jac2aff(const mp_int *px, const mp_int *py, const mp_int *pz,
99 MP_CHECKOK(mp_init(&z1, FLAG(px)));
100 MP_CHECKOK(mp_init(&z2, FLAG(px)));
101 MP_CHECKOK(mp_init(&z3, FLAG(px)));
104 if (ec_GFp_pt_is_inf_jac(px, py, pz) == MP_YES) {
109 /* transform (px, py, pz) into (px / pz^2, py / pz^3) */
111 MP_CHECKOK(mp_copy(px, rx));
117 MP_CHECKOK(group->meth->field_mul(px, &z2, rx, group->meth));
128 /* Checks if point P(px, py, pz) is at infinity. Uses Jacobian
131 ec_GFp_pt_is_inf_jac(const mp_int *px, const mp_int *py, const mp_int *pz)
136 /* Sets P(px, py, pz) to be the point at infinity. Uses Jacobian
139 ec_GFp_pt_set_inf_jac(mp_int *px, mp_int *py, mp_int *pz)
145 /* Computes R = P + Q where R is (rx, ry, rz), P is (px, py, pz) and Q is
153 ec_GFp_pt_add_jac_aff(const mp_int *px, const mp_int *py, const mp_int *pz,
166 MP_CHECKOK(mp_init(&A, FLAG(px)));
167 MP_CHECKOK(mp_init(&B, FLAG(px)));
168 MP_CHECKOK(mp_init(&C, FLAG(px)));
169 MP_CHECKOK(mp_init(&D, FLAG(px)));
170 MP_CHECKOK(mp_init(&C2, FLAG(px)));
171 MP_CHECKOK(mp_init(&C3, FLAG(px)));
175 if (ec_GFp_pt_is_inf_jac(px, py, pz) == MP_YES) {
180 MP_CHECKOK(mp_copy(px, rx));
192 /* C = A - px, D = B - py */
193 MP_CHECKOK(group->meth->field_sub(&A, px, &C, group->meth));
203 /* C = px * C^2 */
204 MP_CHECKOK(group->meth->field_mul(px, &C2, &C, group->meth));
208 /* rx = D^2 - (C^3 + 2 * (px * C^2)) */
216 /* ry = D * (px * C^2 - rx) - py * C^3 */
242 ec_GFp_pt_dbl_jac(const mp_int *px, const mp_int *py, const mp_int *pz,
252 MP_CHECKOK(mp_init(&t0, FLAG(px)));
253 MP_CHECKOK(mp_init(&t1, FLAG(px)));
254 MP_CHECKOK(mp_init(&M, FLAG(px)));
255 MP_CHECKOK(mp_init(&S, FLAG(px)));
257 if (ec_GFp_pt_is_inf_jac(px, py, pz) == MP_YES) {
263 /* M = 3 * px^2 + a */
264 MP_CHECKOK(group->meth->field_sqr(px, &t0, group->meth));
269 } else if (mp_cmp_int(&group->curvea, -3, FLAG(px)) == 0) {
270 /* M = 3 * (px + pz^2) * (px - pz^2) */
272 MP_CHECKOK(group->meth->field_add(px, &M, &t0, group->meth));
273 MP_CHECKOK(group->meth->field_sub(px, &M, &t1, group->meth));
278 /* M = 3 * (px^2) + a * (pz^4) */
279 MP_CHECKOK(group->meth->field_sqr(px, &t0, group->meth));
300 /* S = 4 * px * py^2 = px * (2 * py)^2 */
301 MP_CHECKOK(group->meth->field_mul(px, &t0, &S, group->meth));
328 /* Computes R = nP where R is (rx, ry) and P is (px, py). The parameters
335 ec_GFp_pt_mul_jac(const mp_int *n, const mp_int *px, const mp_int *py,
349 ARGCHK((n != NULL) && (px != NULL) && (py != NULL), MP_BADARG);
360 MP_CHECKOK(mp_copy(px, &precomp[1][0]));
416 ec_GFp_pts_mul_jac(const mp_int *k1, const mp_int *k2, const mp_int *px,
437 && ((k2 == NULL) || (px == NULL)
442 return ECPoint_mul(group, k2, px, py, rx, ry);
443 } else if ((k2 == NULL) || (px == NULL) || (py == NULL)) {
462 field_enc(px, &precomp[1][0][0], group->meth));
466 MP_CHECKOK(mp_copy(px, &precomp[1][0][0]));
478 field_enc(px, &precomp[0][1][0], group->meth));
482 MP_CHECKOK(mp_copy(px, &precomp[0][1][0]));