• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/openssl-0.9.8e/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;
436 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
438 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
439 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
442 if (!(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
443 if (!EC_GROUP_copy(P_192, group)) ABORT;
452 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
455 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx)) ABORT;
456 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
458 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
460 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
471 if (EC_GROUP_get_degree(group) != 224) ABORT;
474 fprintf(stdout, "verify group order ...");
476 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
477 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
478 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
482 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
484 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
485 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
488 if (!(P_224 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
489 if (!EC_GROUP_copy(P_224, group)) ABORT;
498 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
501 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx)) ABORT;
502 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
505 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
507 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
518 if (EC_GROUP_get_degree(group) != 256) ABORT;
521 fprintf(stdout, "verify group order ...");
523 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
524 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
525 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
529 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
531 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
532 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
535 if (!(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
536 if (!EC_GROUP_copy(P_256, group)) ABORT;
548 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
552 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx)) ABORT;
553 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
556 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
558 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
570 if (EC_GROUP_get_degree(group) != 384) ABORT;
573 fprintf(stdout, "verify group order ...");
575 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
576 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
577 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
581 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
583 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
584 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
587 if (!(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
588 if (!EC_GROUP_copy(P_384, group)) ABORT;
603 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
608 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx)) ABORT;
609 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
613 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
615 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
628 if (EC_GROUP_get_degree(group) != 521) ABORT;
631 fprintf(stdout, "verify group order ...");
633 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
634 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
635 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
639 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
641 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
642 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
645 if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
646 if (!EC_GROUP_copy(P_521, group)) ABORT;
652 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
653 if (!EC_POINT_dbl(group, P, P, ctx)) ABORT;
654 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
655 if (!EC_POINT_invert(group, Q, ctx)) ABORT; /* P = -2Q */
657 if (!EC_POINT_add(group, R, P, Q, ctx)) ABORT;
658 if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT;
659 if (!EC_POINT_is_at_infinity(group, R)) ABORT; /* R = P + 2Q */
665 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
673 scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */
679 /* z is still the group order */
680 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
681 if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) ABORT;
682 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
683 if (0 != EC_POINT_cmp(group, R, Q, ctx)) ABORT;
694 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
695 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
707 if (!EC_POINTs_mul(group, P, NULL, 3, points, scalars, ctx)) ABORT;
708 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
739 EC_GROUP_free(group);
758 if (!EC_POINT_set_compressed_coordinates_GF2m(group, P, x, _y_bit, ctx)) ABORT; \
759 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \
762 if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \
763 if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \
776 if (!EC_POINT_set_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; \
777 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT; \
780 if (!EC_GROUP_set_generator(group, P, z, cof)) ABORT; \
792 if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT; \
795 if (EC_GROUP_get_degree(group) != _degree) ABORT; \
797 fprintf(stdout, "verify group order ..."); \
799 if (!EC_GROUP_get_order(group, z, ctx)) ABORT; \
800 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \
801 if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \
804 /* if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; */ \
805 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \
806 if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \
808 if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \
809 if (!EC_GROUP_copy(_variable, group)) ABORT;
815 EC_GROUP *group;
838 group = EC_GROUP_new(EC_GF2m_simple_method()); /* applications should use EC_GROUP_new_curve_GF2m
840 if (!group) ABORT;
841 if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT;
845 tmp = EC_GROUP_new(EC_GROUP_method_of(group));
847 if (!EC_GROUP_copy(tmp, group)) ABORT;
848 EC_GROUP_free(group);
849 group = tmp;
852 if (!EC_GROUP_get_curve_GF2m(group, p, a, b, ctx)) ABORT;
862 P = EC_POINT_new(group);
863 Q = EC_POINT_new(group);
864 R = EC_POINT_new(group);
867 if (!EC_POINT_set_to_infinity(group, P)) ABORT;
868 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
871 if (!EC_POINT_oct2point(group, Q, buf, 1, ctx)) ABORT;
873 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
874 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
885 if (!EC_POINT_set_compressed_coordinates_GF2m(group, Q, x, 1, ctx)) ABORT;
888 if (!EC_POINT_set_affine_coordinates_GF2m(group, Q, x, y, ctx)) ABORT;
890 if (!EC_POINT_is_on_curve(group, Q, ctx))
894 if (!EC_POINT_get_affine_coordinates_GF2m(group, Q, x, y, ctx)) ABORT;
910 if (EC_POINT_is_at_infinity(group, P))
914 if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT;
924 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
926 while (!EC_POINT_is_at_infinity(group, P));
928 if (!EC_POINT_add(group, P, Q, R, ctx)) ABORT;
929 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
933 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, sizeof buf, ctx);
935 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
936 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
941 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx);
943 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
944 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
950 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx);
952 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
953 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
960 if (!EC_POINT_invert(group, P, ctx)) ABORT;
961 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
1127 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
1128 if (!EC_POINT_dbl(group, P, P, ctx)) ABORT;
1129 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
1130 if (!EC_POINT_invert(group, Q, ctx)) ABORT; /* P = -2Q */
1132 if (!EC_POINT_add(group, R, P, Q, ctx)) ABORT;
1133 if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT;
1134 if (!EC_POINT_is_at_infinity(group, R)) ABORT; /* R = P + 2Q */
1140 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
1148 scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */
1154 /* z is still the group order */
1155 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
1156 if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) ABORT;
1157 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
1158 if (0 != EC_POINT_cmp(group, R, Q, ctx)) ABORT;
1169 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
1170 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
1182 if (!EC_POINTs_mul(group, P, NULL, 3, points, scalars, ctx)) ABORT;
1183 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
1226 EC_GROUP_free(group);
1268 EC_GROUP *group = NULL;
1270 if ((group = EC_GROUP_new_by_curve_name(nid)) == NULL)
1278 if (!EC_GROUP_check(group, NULL))
1283 EC_GROUP_free(group);
1289 EC_GROUP_free(group);