• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/openssl-1.0.0d/crypto/ec/

Lines Matching refs:group

119 static void timings(EC_GROUP *group, int type, BN_CTX *ctx)
130 fprintf(stdout, "Timings for %d-bit field, ", EC_GROUP_get_degree(group));
131 if (!EC_GROUP_get_order(group, s, ctx)) ABORT;
135 P = EC_POINT_new(group);
137 EC_POINT_copy(P, EC_GROUP_get0_generator(group));
155 if (!EC_POINT_mul(group, P, (type != TIMING_RAND_PT) ? r[i] : NULL,
202 EC_GROUP *group;
224 group = EC_GROUP_new(EC_GFp_mont_method()); /* applications should use EC_GROUP_new_curve_GFp
226 if (!group) ABORT;
228 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
232 tmp = EC_GROUP_new(EC_GROUP_method_of(group));
234 if (!EC_GROUP_copy(tmp, group)) ABORT;
235 EC_GROUP_free(group);
236 group = tmp;
239 if (!EC_GROUP_get_curve_GFp(group, p, a, b, ctx)) ABORT;
249 P = EC_POINT_new(group);
250 Q = EC_POINT_new(group);
251 R = EC_POINT_new(group);
254 if (!EC_POINT_set_to_infinity(group, P)) ABORT;
255 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
258 if (!EC_POINT_oct2point(group, Q, buf, 1, ctx)) ABORT;
260 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
261 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
269 if (!EC_POINT_set_compressed_coordinates_GFp(group, Q, x, 1, ctx)) ABORT;
270 if (!EC_POINT_is_on_curve(group, Q, ctx))
272 if (!EC_POINT_get_affine_coordinates_GFp(group, Q, x, y, ctx)) ABORT;
287 if (EC_POINT_is_at_infinity(group, P))
291 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
301 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
310 if (!EC_POINTs_make_affine(group, 2, points, ctx)) ABORT;
315 while (!EC_POINT_is_at_infinity(group, P));
317 if (!EC_POINT_add(group, P, Q, R, ctx)) ABORT;
318 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
320 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, sizeof buf, ctx);
322 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
323 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
327 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx);
329 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
330 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
334 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx);
336 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
337 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
341 if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) ABORT;
350 if (!EC_POINT_invert(group, P, ctx)) ABORT;
351 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
361 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
365 if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
366 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
368 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
370 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
381 if (EC_GROUP_get_degree(group) != 160) ABORT;
384 fprintf(stdout, "verify group order ...");
386 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
387 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
388 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
391 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
392 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
393 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
396 if (!(P_160 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
397 if (!EC_GROUP_copy(P_160, group)) ABORT;
406 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
409 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx)) ABORT;
410 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
412 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
414 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
425 if (EC_GROUP_get_degree(group) != 192) ABORT;
428 fprintf(stdout, "verify group order ...");
430 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
431 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
432 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
435 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
436 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
437 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
440 if (!(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
441 if (!EC_GROUP_copy(P_192, group)) ABORT;
450 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
453 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx)) ABORT;
454 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
456 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
458 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
469 if (EC_GROUP_get_degree(group) != 224) ABORT;
472 fprintf(stdout, "verify group order ...");
474 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
475 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
476 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
479 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
480 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
481 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
484 if (!(P_224 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
485 if (!EC_GROUP_copy(P_224, group)) ABORT;
494 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
497 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx)) ABORT;
498 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
501 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
503 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
514 if (EC_GROUP_get_degree(group) != 256) ABORT;
517 fprintf(stdout, "verify group order ...");
519 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
520 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
521 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
524 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
525 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
526 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
529 if (!(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
530 if (!EC_GROUP_copy(P_256, group)) ABORT;
542 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
546 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx)) ABORT;
547 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
550 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
552 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
564 if (EC_GROUP_get_degree(group) != 384) ABORT;
567 fprintf(stdout, "verify group order ...");
569 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
570 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
571 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
574 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
575 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
576 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
579 if (!(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
580 if (!EC_GROUP_copy(P_384, group)) ABORT;
595 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
600 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx)) ABORT;
601 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
605 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
607 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
620 if (EC_GROUP_get_degree(group) != 521) ABORT;
623 fprintf(stdout, "verify group order ...");
625 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
626 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
627 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
630 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
631 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
632 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
635 if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
636 if (!EC_GROUP_copy(P_521, group)) ABORT;
642 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
643 if (!EC_POINT_dbl(group, P, P, ctx)) ABORT;
644 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
645 if (!EC_POINT_invert(group, Q, ctx)) ABORT; /* P = -2Q */
647 if (!EC_POINT_add(group, R, P, Q, ctx)) ABORT;
648 if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT;
649 if (!EC_POINT_is_at_infinity(group, R)) ABORT; /* R = P + 2Q */
656 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
665 scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */
671 /* z is still the group order */
672 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
673 if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) ABORT;
674 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
675 if (0 != EC_POINT_cmp(group, R, Q, ctx)) ABORT;
686 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
687 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
703 if (!EC_POINTs_mul(group, P, NULL, 4, points, scalars, ctx)) ABORT;
704 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
737 EC_GROUP_free(group);
756 if (!EC_POINT_set_compressed_coordinates_GF2m(group, P, x, _y_bit, ctx)) ABORT; \
757 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \
760 if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \
761 if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \
774 if (!EC_POINT_set_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \
775 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \
778 if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \
790 if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT; \
793 if (EC_GROUP_get_degree(group) != _degree) ABORT; \
795 fprintf(stdout, "verify group order ..."); \
797 if (!EC_GROUP_get_order(group, z, ctx)) ABORT; \
798 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \
799 if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \
802 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; \
803 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \
804 if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \
806 if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \
807 if (!EC_GROUP_copy(_variable, group)) ABORT;
813 EC_GROUP *group;
836 group = EC_GROUP_new(EC_GF2m_simple_method()); /* applications should use EC_GROUP_new_curve_GF2m
838 if (!group) ABORT;
839 if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT;
843 tmp = EC_GROUP_new(EC_GROUP_method_of(group));
845 if (!EC_GROUP_copy(tmp, group)) ABORT;
846 EC_GROUP_free(group);
847 group = tmp;
850 if (!EC_GROUP_get_curve_GF2m(group, p, a, b, ctx)) ABORT;
860 P = EC_POINT_new(group);
861 Q = EC_POINT_new(group);
862 R = EC_POINT_new(group);
865 if (!EC_POINT_set_to_infinity(group, P)) ABORT;
866 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
869 if (!EC_POINT_oct2point(group, Q, buf, 1, ctx)) ABORT;
871 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
872 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
883 if (!EC_POINT_set_compressed_coordinates_GF2m(group, Q, x, 1, ctx)) ABORT;
886 if (!EC_POINT_set_affine_coordinates_GF2m(group, Q, x, y, ctx)) ABORT;
888 if (!EC_POINT_is_on_curve(group, Q, ctx))
892 if (!EC_POINT_get_affine_coordinates_GF2m(group, Q, x, y, ctx)) ABORT;
908 if (EC_POINT_is_at_infinity(group, P))
912 if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT;
922 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
924 while (!EC_POINT_is_at_infinity(group, P));
926 if (!EC_POINT_add(group, P, Q, R, ctx)) ABORT;
927 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
931 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, sizeof buf, ctx);
933 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
934 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
939 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx);
941 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
942 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
948 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx);
950 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
951 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
958 if (!EC_POINT_invert(group, P, ctx)) ABORT;
959 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
1125 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
1126 if (!EC_POINT_dbl(group, P, P, ctx)) ABORT;
1127 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
1128 if (!EC_POINT_invert(group, Q, ctx)) ABORT; /* P = -2Q */
1130 if (!EC_POINT_add(group, R, P, Q, ctx)) ABORT;
1131 if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT;
1132 if (!EC_POINT_is_at_infinity(group, R)) ABORT; /* R = P + 2Q */
1138 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
1146 scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */
1152 /* z is still the group order */
1153 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
1154 if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) ABORT;
1155 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
1156 if (0 != EC_POINT_cmp(group, R, Q, ctx)) ABORT;
1167 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
1168 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
1180 if (!EC_POINTs_mul(group, P, NULL, 3, points, scalars, ctx)) ABORT;
1181 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
1224 EC_GROUP_free(group);
1266 EC_GROUP *group = NULL;
1268 if ((group = EC_GROUP_new_by_curve_name(nid)) == NULL)
1276 if (!EC_GROUP_check(group, NULL))
1281 EC_GROUP_free(group);
1287 EC_GROUP_free(group);