• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/openssl/crypto/ec/

Lines Matching refs:group

86 static void timings(EC_GROUP *group, int multi, BN_CTX *ctx)
97 if (!EC_GROUP_get_curve_GFp(group, s, NULL, NULL, ctx)) ABORT;
99 if (!EC_GROUP_get_order(group, s, ctx)) ABORT;
103 P = EC_POINT_new(group);
105 EC_POINT_copy(P, EC_GROUP_get0_generator(group));
117 if (!EC_POINT_mul(group, P, s, multi ? P : NULL, multi ? s0 : NULL, ctx)) ABORT;
154 EC_GROUP *group;
190 group = EC_GROUP_new(EC_GFp_mont_method()); /* applications should use EC_GROUP_new_curve_GFp
192 if (!group) ABORT;
194 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
198 tmp = EC_GROUP_new(EC_GROUP_method_of(group));
200 if (!EC_GROUP_copy(tmp, group));
201 EC_GROUP_free(group);
202 group = tmp;
205 if (!EC_GROUP_get_curve_GFp(group, p, a, b, ctx)) ABORT;
215 P = EC_POINT_new(group);
216 Q = EC_POINT_new(group);
217 R = EC_POINT_new(group);
220 if (!EC_POINT_set_to_infinity(group, P)) ABORT;
221 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
224 if (!EC_POINT_oct2point(group, Q, buf, 1, ctx)) ABORT;
226 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
227 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
235 if (!EC_POINT_set_compressed_coordinates_GFp(group, Q, x, 1, ctx)) ABORT;
236 if (!EC_POINT_is_on_curve(group, Q, ctx))
238 if (!EC_POINT_get_affine_coordinates_GFp(group, Q, x, y, ctx)) ABORT;
253 if (EC_POINT_is_at_infinity(group, P))
257 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
267 if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT;
276 if (!EC_POINTs_make_affine(group, 2, points, ctx)) ABORT;
281 while (!EC_POINT_is_at_infinity(group, P));
283 if (!EC_POINT_add(group, P, Q, R, ctx)) ABORT;
284 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
286 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, sizeof buf, ctx);
288 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
289 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
293 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx);
295 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
296 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
300 len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx);
302 if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT;
303 if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT;
307 if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) ABORT;
316 if (!EC_POINT_invert(group, P, ctx)) ABORT;
317 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
326 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
329 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx)) ABORT;
330 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
332 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
334 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
344 fprintf(stdout, "verify group order ...");
346 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
347 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
348 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
351 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
352 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
353 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
356 if (!(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
357 if (!EC_GROUP_copy(P_192, group)) ABORT;
366 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
369 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx)) ABORT;
370 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
372 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
374 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) 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_224 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
397 if (!EC_GROUP_copy(P_224, 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;
413 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
415 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
425 fprintf(stdout, "verify group order ...");
427 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
428 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
429 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
432 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
433 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
434 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
437 if (!(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
438 if (!EC_GROUP_copy(P_256, group)) ABORT;
450 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
454 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx)) ABORT;
455 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 fprintf(stdout, "verify group order ...");
473 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
474 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
475 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
478 if (!EC_GROUP_precompute_mult(group, ctx)) ABORT;
479 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
480 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
483 if (!(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
484 if (!EC_GROUP_copy(P_384, group)) ABORT;
499 if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx)) ABORT;
504 if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx)) ABORT;
505 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
509 if (!EC_GROUP_set_generator(group, P, z, BN_value_one())) ABORT;
511 if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx)) ABORT;
523 fprintf(stdout, "verify group order ...");
525 if (!EC_GROUP_get_order(group, z, ctx)) ABORT;
526 if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT;
527 if (!EC_POINT_is_at_infinity(group, Q)) ABORT;
530 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_521 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT;
536 if (!EC_GROUP_copy(P_521, group)) ABORT;
542 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
543 if (!EC_POINT_dbl(group, P, P, ctx)) ABORT;
544 if (!EC_POINT_is_on_curve(group, P, ctx)) ABORT;
545 if (!EC_POINT_invert(group, Q, ctx)) ABORT; /* P = -2Q */
547 if (!EC_POINT_add(group, R, P, Q, ctx)) ABORT;
548 if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT;
549 if (!EC_POINT_is_at_infinity(group, R)) ABORT; /* R = P + 2Q */
555 if (EC_POINT_is_at_infinity(group, Q)) ABORT;
563 scalars[0] = y; /* (group order + 1)/2, so y*Q + y*Q = Q */
569 /* z is still the group order */
570 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
571 if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) ABORT;
572 if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT;
573 if (0 != EC_POINT_cmp(group, R, Q, ctx)) ABORT;
584 if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
585 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
597 if (!EC_POINTs_mul(group, P, NULL, 3, points, scalars, ctx)) ABORT;
598 if (!EC_POINT_is_at_infinity(group, P)) ABORT;
621 EC_GROUP_free(group);