Lines Matching refs:P

42     EC_POINT *P = NULL, *Q = NULL, *R = NULL, *S = NULL;  in group_order_tests()  local
52 || !TEST_ptr(P = EC_POINT_new(group)) in group_order_tests()
66 || !TEST_true(EC_POINT_copy(P, G)) in group_order_tests()
69 || !TEST_int_eq(0, EC_POINT_cmp(group, Q, P, ctx)) in group_order_tests()
73 || !TEST_int_eq(0, EC_POINT_cmp(group, Q, P, ctx))) in group_order_tests()
87 || !TEST_true(EC_POINT_mul(group, P, n1, NULL, NULL, ctx)) in group_order_tests()
88 || (i == 1 && !TEST_int_eq(0, EC_POINT_cmp(group, P, G, ctx))) in group_order_tests()
92 || !TEST_true(EC_POINT_mul(group, Q, NULL, P, n1, ctx)) in group_order_tests()
93 || !TEST_int_eq(0, EC_POINT_cmp(group, Q, P, ctx)) in group_order_tests()
97 || !TEST_true(EC_POINT_mul(group, Q, NULL, P, n2, ctx)) in group_order_tests()
98 || !TEST_int_eq(0, EC_POINT_cmp(group, Q, P, ctx)) in group_order_tests()
102 || !TEST_true(EC_POINT_mul(group, Q, NULL, P, n2, ctx)) in group_order_tests()
103 || !TEST_int_eq(0, EC_POINT_cmp(group, Q, P, ctx))) in group_order_tests()
108 if (!TEST_true(EC_POINT_mul(group, Q, NULL, P, n2, ctx)) in group_order_tests()
110 || !TEST_true(EC_POINT_add(group, Q, Q, P, ctx)) in group_order_tests()
112 || !TEST_false(EC_POINT_is_at_infinity(group, P))) in group_order_tests()
118 points[0] = points[1] = P; in group_order_tests()
128 points[1] = P; /* => -P */ in group_order_tests()
134 points[4] = P; /* => P */ in group_order_tests()
137 if (!TEST_true(EC_POINTs_mul(group, P, NULL, 6, points, scalars, ctx)) in group_order_tests()
138 || !TEST_true(EC_POINT_is_at_infinity(group, P))) in group_order_tests()
148 EC_POINT_free(P); in group_order_tests()
164 EC_POINT *P = NULL, *Q = NULL, *R = NULL; in prime_field_tests() local
192 if (!TEST_ptr(P = EC_POINT_new(group)) in prime_field_tests()
195 || !TEST_true(EC_POINT_set_to_infinity(group, P)) in prime_field_tests()
196 || !TEST_true(EC_POINT_is_at_infinity(group, P)) in prime_field_tests()
198 || !TEST_true(EC_POINT_add(group, P, P, Q, ctx)) in prime_field_tests()
199 || !TEST_true(EC_POINT_is_at_infinity(group, P)) in prime_field_tests()
223 if (EC_POINT_is_at_infinity(group, P)) { in prime_field_tests()
226 if (!TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, in prime_field_tests()
234 if (!TEST_true(EC_POINT_copy(R, P)) in prime_field_tests()
235 || !TEST_true(EC_POINT_add(group, P, P, Q, ctx))) in prime_field_tests()
238 } while (!EC_POINT_is_at_infinity(group, P)); in prime_field_tests()
240 if (!TEST_true(EC_POINT_add(group, P, Q, R, ctx)) in prime_field_tests()
241 || !TEST_true(EC_POINT_is_at_infinity(group, P))) in prime_field_tests()
248 || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) in prime_field_tests()
249 || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) in prime_field_tests()
257 || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) in prime_field_tests()
258 || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) in prime_field_tests()
266 || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) in prime_field_tests()
267 || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) in prime_field_tests()
272 if (!TEST_true(EC_POINT_invert(group, P, ctx)) in prime_field_tests()
273 || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx)) in prime_field_tests()
297 || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, in prime_field_tests()
299 || !TEST_true(EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) in prime_field_tests()
300 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in prime_field_tests()
303 || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) in prime_field_tests()
304 || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) in prime_field_tests()
328 || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, 1, ctx)) in prime_field_tests()
329 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in prime_field_tests()
332 || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) in prime_field_tests()
333 || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) in prime_field_tests()
348 || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, in prime_field_tests()
365 || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, 0, ctx)) in prime_field_tests()
366 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in prime_field_tests()
369 || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) in prime_field_tests()
370 || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) in prime_field_tests()
385 || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, in prime_field_tests()
403 || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, 1, ctx)) in prime_field_tests()
404 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in prime_field_tests()
407 || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) in prime_field_tests()
408 || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) in prime_field_tests()
423 || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, in prime_field_tests()
445 || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, 1, ctx)) in prime_field_tests()
446 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in prime_field_tests()
450 || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) in prime_field_tests()
451 || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) in prime_field_tests()
467 || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, in prime_field_tests()
495 || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, 0, ctx)) in prime_field_tests()
496 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in prime_field_tests()
502 || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) in prime_field_tests()
503 || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) in prime_field_tests()
521 || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, in prime_field_tests()
529 || !TEST_true(EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) in prime_field_tests()
530 || !TEST_true(EC_POINT_copy(Q, P)) in prime_field_tests()
532 || !TEST_true(EC_POINT_dbl(group, P, P, ctx)) in prime_field_tests()
533 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in prime_field_tests()
535 || !TEST_true(EC_POINT_add(group, R, P, Q, ctx)) in prime_field_tests()
558 if (!TEST_true(EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) in prime_field_tests()
560 || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx)) in prime_field_tests()
569 if (!TEST_true(EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) in prime_field_tests()
570 || !TEST_true(EC_POINT_is_at_infinity(group, P)) in prime_field_tests()
584 if (!TEST_true(EC_POINTs_mul(group, P, NULL, 4, points, scalars, ctx)) in prime_field_tests()
585 || !TEST_true(EC_POINT_is_at_infinity(group, P))) in prime_field_tests()
596 EC_POINT_free(P); in prime_field_tests()
786 EC_POINT *P = NULL, *Q = NULL, *R = NULL; in char2_curve_test() local
805 || !TEST_ptr(P = EC_POINT_new(group)) in char2_curve_test()
819 if (!TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, ctx)) in char2_curve_test()
820 || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, in char2_curve_test()
823 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in char2_curve_test()
826 || !TEST_true(EC_GROUP_set_generator(group, P, z, cof)) in char2_curve_test()
827 || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) in char2_curve_test()
841 if (!TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, ctx)) in char2_curve_test()
842 || !TEST_true(EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) in char2_curve_test()
843 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in char2_curve_test()
846 || !TEST_true(EC_GROUP_set_generator(group, P, z, cof))) in char2_curve_test()
859 if (!TEST_true(EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) in char2_curve_test()
860 || !TEST_true(EC_POINT_copy(Q, P)) in char2_curve_test()
862 || !TEST_true(EC_POINT_dbl(group, P, P, ctx)) in char2_curve_test()
863 || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) in char2_curve_test()
865 || !TEST_true(EC_POINT_add(group, R, P, Q, ctx)) in char2_curve_test()
885 if (!TEST_true(EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) in char2_curve_test()
887 || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx)) in char2_curve_test()
898 if (!TEST_true(EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) in char2_curve_test()
899 || !TEST_true(EC_POINT_is_at_infinity(group, P))) in char2_curve_test()
910 if (!TEST_true(EC_POINTs_mul(group, P, NULL, 3, points, scalars, ctx)) in char2_curve_test()
911 || !TEST_true(EC_POINT_is_at_infinity(group, P))) in char2_curve_test()
927 EC_POINT_free(P); in char2_curve_test()
939 EC_POINT *P = NULL, *Q = NULL, *R = NULL; in char2_field_tests() local
964 if (!TEST_ptr(P = EC_POINT_new(group)) in char2_field_tests()
967 || !TEST_true(EC_POINT_set_to_infinity(group, P)) in char2_field_tests()
968 || !TEST_true(EC_POINT_is_at_infinity(group, P))) in char2_field_tests()
973 || !TEST_true(EC_POINT_add(group, P, P, Q, ctx)) in char2_field_tests()
974 || !TEST_true(EC_POINT_is_at_infinity(group, P)) in char2_field_tests()
1008 if (EC_POINT_is_at_infinity(group, P)) in char2_field_tests()
1011 if (!TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, in char2_field_tests()
1019 if (!TEST_true(EC_POINT_copy(R, P)) in char2_field_tests()
1020 || !TEST_true(EC_POINT_add(group, P, P, Q, ctx))) in char2_field_tests()
1023 while (!EC_POINT_is_at_infinity(group, P)); in char2_field_tests()
1025 if (!TEST_true(EC_POINT_add(group, P, Q, R, ctx)) in char2_field_tests()
1026 || !TEST_true(EC_POINT_is_at_infinity(group, P))) in char2_field_tests()
1034 || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) in char2_field_tests()
1035 || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) in char2_field_tests()
1044 || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) in char2_field_tests()
1045 || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) in char2_field_tests()
1056 || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) in char2_field_tests()
1057 || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) in char2_field_tests()
1063 if (!TEST_true(EC_POINT_invert(group, P, ctx)) in char2_field_tests()
1064 || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx))) in char2_field_tests()
1076 EC_POINT_free(P); in char2_field_tests()
1319 EC_POINT *G = NULL, *P = NULL, *Q = NULL, *Q_CHECK = NULL; in nistp_single_test() local
1342 || !TEST_ptr(P = EC_POINT_new(NISTP)) in nistp_single_test()
1376 || !TEST_true(EC_POINT_dbl(NISTP, P, G, ctx)) in nistp_single_test()
1377 || !TEST_true(EC_GROUP_set_generator(NISTP, P, order, BN_value_one())) in nistp_single_test()
1388 EC_POINT_mul(NISTP, Q, NULL, P, m, ctx); in nistp_single_test()
1404 EC_POINT_mul(NISTP, Q, NULL, P, m, ctx); in nistp_single_test()
1422 || !TEST_true(EC_POINT_copy(P, G)) in nistp_single_test()
1423 || !TEST_true(EC_POINT_invert(NISTP, P, ctx)) in nistp_single_test()
1424 || !TEST_true(EC_POINT_mul(NISTP, Q, m, P, n, ctx)) in nistp_single_test()
1432 EC_POINT_free(P); in nistp_single_test()
2410 int ec_point_hex2point_test_helper(const EC_GROUP *group, const EC_POINT *P, in ec_point_hex2point_test_helper() argument
2418 if (P == NULL) { in ec_point_hex2point_test_helper()
2423 P = Pinf; in ec_point_hex2point_test_helper()
2426 if (!TEST_ptr(hex = EC_POINT_point2hex(group, P, form, bnctx)) in ec_point_hex2point_test_helper()
2428 || !TEST_int_eq(0, EC_POINT_cmp(group, Q, P, bnctx))) in ec_point_hex2point_test_helper()
2459 EC_POINT *P = NULL; in ec_point_hex2point_test() local
2467 || !TEST_ptr(P = EC_POINT_dup(G, group))) in ec_point_hex2point_test()
2470 if (!TEST_true(ec_point_hex2point_test_helper(group, P, in ec_point_hex2point_test()
2476 || !TEST_true(ec_point_hex2point_test_helper(group, P, in ec_point_hex2point_test()
2482 || !TEST_true(ec_point_hex2point_test_helper(group, P, in ec_point_hex2point_test()
2493 EC_POINT_free(P); in ec_point_hex2point_test()