• Home
  • Raw
  • Download

Lines Matching refs:point

347 int ec_GFp_simple_point_init(EC_POINT *point)  in ec_GFp_simple_point_init()  argument
349 BN_init(&point->X); in ec_GFp_simple_point_init()
350 BN_init(&point->Y); in ec_GFp_simple_point_init()
351 BN_init(&point->Z); in ec_GFp_simple_point_init()
352 point->Z_is_one = 0; in ec_GFp_simple_point_init()
358 void ec_GFp_simple_point_finish(EC_POINT *point) in ec_GFp_simple_point_finish() argument
360 BN_free(&point->X); in ec_GFp_simple_point_finish()
361 BN_free(&point->Y); in ec_GFp_simple_point_finish()
362 BN_free(&point->Z); in ec_GFp_simple_point_finish()
366 void ec_GFp_simple_point_clear_finish(EC_POINT *point) in ec_GFp_simple_point_clear_finish() argument
368 BN_clear_free(&point->X); in ec_GFp_simple_point_clear_finish()
369 BN_clear_free(&point->Y); in ec_GFp_simple_point_clear_finish()
370 BN_clear_free(&point->Z); in ec_GFp_simple_point_clear_finish()
371 point->Z_is_one = 0; in ec_GFp_simple_point_clear_finish()
386 int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *group, EC_POINT *point) in ec_GFp_simple_point_set_to_infinity() argument
388 point->Z_is_one = 0; in ec_GFp_simple_point_set_to_infinity()
389 BN_zero(&point->Z); in ec_GFp_simple_point_set_to_infinity()
394 int ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, in ec_GFp_simple_set_Jprojective_coordinates_GFp() argument
409 if (!BN_nnmod(&point->X, x, &group->field, ctx)) goto err; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
412 if (!group->meth->field_encode(group, &point->X, &point->X, ctx)) goto err; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
418 if (!BN_nnmod(&point->Y, y, &group->field, ctx)) goto err; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
421 if (!group->meth->field_encode(group, &point->Y, &point->Y, ctx)) goto err; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
429 if (!BN_nnmod(&point->Z, z, &group->field, ctx)) goto err; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
430 Z_is_one = BN_is_one(&point->Z); in ec_GFp_simple_set_Jprojective_coordinates_GFp()
435 if (!group->meth->field_set_to_one(group, &point->Z, ctx)) goto err; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
439 if (!group->meth->field_encode(group, &point->Z, &point->Z, ctx)) goto err; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
442 point->Z_is_one = Z_is_one; in ec_GFp_simple_set_Jprojective_coordinates_GFp()
454 int ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point, in ec_GFp_simple_get_Jprojective_coordinates_GFp() argument
471 if (!group->meth->field_decode(group, x, &point->X, ctx)) goto err; in ec_GFp_simple_get_Jprojective_coordinates_GFp()
475 if (!group->meth->field_decode(group, y, &point->Y, ctx)) goto err; in ec_GFp_simple_get_Jprojective_coordinates_GFp()
479 if (!group->meth->field_decode(group, z, &point->Z, ctx)) goto err; in ec_GFp_simple_get_Jprojective_coordinates_GFp()
486 if (!BN_copy(x, &point->X)) goto err; in ec_GFp_simple_get_Jprojective_coordinates_GFp()
490 if (!BN_copy(y, &point->Y)) goto err; in ec_GFp_simple_get_Jprojective_coordinates_GFp()
494 if (!BN_copy(z, &point->Z)) goto err; in ec_GFp_simple_get_Jprojective_coordinates_GFp()
507 int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point, in ec_GFp_simple_point_set_affine_coordinates() argument
517 return EC_POINT_set_Jprojective_coordinates_GFp(group, point, x, y, BN_value_one(), ctx); in ec_GFp_simple_point_set_affine_coordinates()
521 int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, in ec_GFp_simple_point_get_affine_coordinates() argument
529 if (EC_POINT_is_at_infinity(group, point)) in ec_GFp_simple_point_get_affine_coordinates()
553 if (!group->meth->field_decode(group, Z, &point->Z, ctx)) goto err; in ec_GFp_simple_point_get_affine_coordinates()
558 Z_ = &point->Z; in ec_GFp_simple_point_get_affine_coordinates()
567 if (!group->meth->field_decode(group, x, &point->X, ctx)) goto err; in ec_GFp_simple_point_get_affine_coordinates()
571 if (!group->meth->field_decode(group, y, &point->Y, ctx)) goto err; in ec_GFp_simple_point_get_affine_coordinates()
578 if (!BN_copy(x, &point->X)) goto err; in ec_GFp_simple_point_get_affine_coordinates()
582 if (!BN_copy(y, &point->Y)) goto err; in ec_GFp_simple_point_get_affine_coordinates()
607 if (!group->meth->field_mul(group, x, &point->X, Z_2, ctx)) goto err; in ec_GFp_simple_point_get_affine_coordinates()
623 if (!group->meth->field_mul(group, y, &point->Y, Z_3, ctx)) goto err; in ec_GFp_simple_point_get_affine_coordinates()
637 int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point, in ec_GFp_simple_set_compressed_coordinates() argument
754 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; in ec_GFp_simple_set_compressed_coordinates()
766 size_t ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_… in ec_GFp_simple_point2oct() argument
783 if (EC_POINT_is_at_infinity(group, point)) in ec_GFp_simple_point2oct()
825 if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; in ec_GFp_simple_point2oct()
892 int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, in ec_GFp_simple_oct2point() argument
931 return EC_POINT_set_to_infinity(group, point); in ec_GFp_simple_oct2point()
964 if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) goto err; in ec_GFp_simple_oct2point()
983 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; in ec_GFp_simple_oct2point()
986 if (!EC_POINT_is_on_curve(group, point, ctx)) /* test required by X9.62 */ in ec_GFp_simple_oct2point()
1283 int ec_GFp_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) in ec_GFp_simple_invert() argument
1285 if (EC_POINT_is_at_infinity(group, point) || BN_is_zero(&point->Y)) in ec_GFp_simple_invert()
1289 return BN_usub(&point->Y, &group->field, &point->Y); in ec_GFp_simple_invert()
1293 int ec_GFp_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) in ec_GFp_simple_is_at_infinity() argument
1295 return BN_is_zero(&point->Z); in ec_GFp_simple_is_at_infinity()
1299 int ec_GFp_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx) in ec_GFp_simple_is_on_curve() argument
1308 if (EC_POINT_is_at_infinity(group, point)) in ec_GFp_simple_is_on_curve()
1339 if (!field_sqr(group, rh, &point->X, ctx)) goto err; in ec_GFp_simple_is_on_curve()
1341 if (!point->Z_is_one) in ec_GFp_simple_is_on_curve()
1343 if (!field_sqr(group, tmp, &point->Z, ctx)) goto err; in ec_GFp_simple_is_on_curve()
1353 if (!field_mul(group, rh, rh, &point->X, ctx)) goto err; in ec_GFp_simple_is_on_curve()
1359 if (!field_mul(group, rh, rh, &point->X, ctx)) goto err; in ec_GFp_simple_is_on_curve()
1372 if (!field_mul(group, rh, rh, &point->X, ctx)) goto err; in ec_GFp_simple_is_on_curve()
1378 if (!field_sqr(group, tmp, &point->Y, ctx)) goto err; in ec_GFp_simple_is_on_curve()
1501 int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) in ec_GFp_simple_make_affine() argument
1507 if (point->Z_is_one || EC_POINT_is_at_infinity(group, point)) in ec_GFp_simple_make_affine()
1522 if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; in ec_GFp_simple_make_affine()
1523 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; in ec_GFp_simple_make_affine()
1524 if (!point->Z_is_one) in ec_GFp_simple_make_affine()