Lines Matching defs:point
222 int ossl_ec_GF2m_simple_point_init(EC_POINT *point)
224 point->X = BN_new();
225 point->Y = BN_new();
226 point->Z = BN_new();
228 if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
229 BN_free(point->X);
230 BN_free(point->Y);
231 BN_free(point->Z);
238 void ossl_ec_GF2m_simple_point_finish(EC_POINT *point)
240 BN_free(point->X);
241 BN_free(point->Y);
242 BN_free(point->Z);
246 void ossl_ec_GF2m_simple_point_clear_finish(EC_POINT *point)
248 BN_clear_free(point->X);
249 BN_clear_free(point->Y);
250 BN_clear_free(point->Z);
251 point->Z_is_one = 0;
273 * Set an EC_POINT to the point at infinity. A point at infinity is
277 EC_POINT *point)
279 point->Z_is_one = 0;
280 BN_zero(point->Z);
289 EC_POINT *point,
300 if (!BN_copy(point->X, x))
302 BN_set_negative(point->X, 0);
303 if (!BN_copy(point->Y, y))
305 BN_set_negative(point->Y, 0);
306 if (!BN_copy(point->Z, BN_value_one()))
308 BN_set_negative(point->Z, 0);
309 point->Z_is_one = 1;
321 const EC_POINT *point,
327 if (EC_POINT_is_at_infinity(group, point)) {
332 if (BN_cmp(point->Z, BN_value_one())) {
337 if (!BN_copy(x, point->X))
342 if (!BN_copy(y, point->Y))
483 int ossl_ec_GF2m_simple_invert(const EC_GROUP *group, EC_POINT *point,
486 if (EC_POINT_is_at_infinity(group, point) || BN_is_zero(point->Y))
487 /* point is its own inverse */
491 || !group->meth->make_affine(group, point, ctx))
493 return BN_GF2m_add(point->Y, point->X, point->Y);
496 /* Indicates whether the given point is the point at infinity. */
498 const EC_POINT *point)
500 return BN_is_zero(point->Z);
504 * Determines whether the given EC_POINT is an actual point on the curve defined
505 * in the EC_GROUP. A point is valid if it satisfies the Weierstrass equation:
508 int ossl_ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
520 if (EC_POINT_is_at_infinity(group, point))
527 if (!point->Z_is_one)
550 if (!BN_GF2m_add(lh, point->X, group->a))
552 if (!field_mul(group, lh, lh, point->X, ctx))
554 if (!BN_GF2m_add(lh, lh, point->Y))
556 if (!field_mul(group, lh, lh, point->X, ctx))
560 if (!field_sqr(group, y2, point->Y, ctx))
632 int ossl_ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
641 if (point->Z_is_one || EC_POINT_is_at_infinity(group, point))
658 if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
660 if (!BN_copy(point->X, x))
662 if (!BN_copy(point->Y, y))
664 if (!BN_one(point->Z))
666 point->Z_is_one = 1;
880 * Fixed point mul: scalar != NULL && num == 0;
882 * Variable point mul: scalar == NULL && num == 1;
895 /* Fixed point multiplication */
899 /* Variable point multiplication */
903 * Double point multiplication: