Lines Matching refs:group
76 static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, in ec_GFp_simple_point2oct() argument
92 if (EC_POINT_is_at_infinity(group, point)) { in ec_GFp_simple_point2oct()
106 field_len = BN_num_bytes(&group->field); in ec_GFp_simple_point2oct()
132 if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)) { in ec_GFp_simple_point2oct()
179 static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, in ec_GFp_simple_oct2point() argument
212 return EC_POINT_set_to_infinity(group, point); in ec_GFp_simple_oct2point()
215 field_len = BN_num_bytes(&group->field); in ec_GFp_simple_oct2point()
241 if (BN_ucmp(x, &group->field) >= 0) { in ec_GFp_simple_oct2point()
247 if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) { in ec_GFp_simple_oct2point()
254 if (BN_ucmp(y, &group->field) >= 0) { in ec_GFp_simple_oct2point()
259 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { in ec_GFp_simple_oct2point()
265 if (!EC_POINT_is_on_curve(group, point, ctx)) { in ec_GFp_simple_oct2point()
278 int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, in EC_POINT_oct2point() argument
280 if (group->meth->oct2point == 0 && in EC_POINT_oct2point()
281 !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) { in EC_POINT_oct2point()
286 if (group->meth != point->meth) { in EC_POINT_oct2point()
290 if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) { in EC_POINT_oct2point()
291 return ec_GFp_simple_oct2point(group, point, buf, len, ctx); in EC_POINT_oct2point()
294 return group->meth->oct2point(group, point, buf, len, ctx); in EC_POINT_oct2point()
297 size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, in EC_POINT_point2oct() argument
300 if (group->meth->point2oct == 0 && in EC_POINT_point2oct()
301 !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) { in EC_POINT_point2oct()
306 if (group->meth != point->meth) { in EC_POINT_point2oct()
310 if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) { in EC_POINT_point2oct()
311 return ec_GFp_simple_point2oct(group, point, form, buf, len, ctx); in EC_POINT_point2oct()
314 return group->meth->point2oct(group, point, form, buf, len, ctx); in EC_POINT_point2oct()
317 int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, in ec_GFp_simple_set_compressed_coordinates() argument
349 if (!BN_nnmod(x, x_, &group->field, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
353 if (group->meth->field_decode == 0) { in ec_GFp_simple_set_compressed_coordinates()
355 if (!group->meth->field_sqr(group, tmp2, x_, ctx) || in ec_GFp_simple_set_compressed_coordinates()
356 !group->meth->field_mul(group, tmp1, tmp2, x_, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
360 if (!BN_mod_sqr(tmp2, x_, &group->field, ctx) || in ec_GFp_simple_set_compressed_coordinates()
361 !BN_mod_mul(tmp1, tmp2, x_, &group->field, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
367 if (group->a_is_minus3) { in ec_GFp_simple_set_compressed_coordinates()
368 if (!BN_mod_lshift1_quick(tmp2, x, &group->field) || in ec_GFp_simple_set_compressed_coordinates()
369 !BN_mod_add_quick(tmp2, tmp2, x, &group->field) || in ec_GFp_simple_set_compressed_coordinates()
370 !BN_mod_sub_quick(tmp1, tmp1, tmp2, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
374 if (group->meth->field_decode) { in ec_GFp_simple_set_compressed_coordinates()
375 if (!group->meth->field_decode(group, tmp2, &group->a, ctx) || in ec_GFp_simple_set_compressed_coordinates()
376 !BN_mod_mul(tmp2, tmp2, x, &group->field, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
381 if (!group->meth->field_mul(group, tmp2, &group->a, x, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
386 if (!BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
392 if (group->meth->field_decode) { in ec_GFp_simple_set_compressed_coordinates()
393 if (!group->meth->field_decode(group, tmp2, &group->b, ctx) || in ec_GFp_simple_set_compressed_coordinates()
394 !BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
398 if (!BN_mod_add_quick(tmp1, tmp1, &group->b, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
403 if (!BN_mod_sqrt(y, tmp1, &group->field, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
420 kron = BN_kronecker(x, &group->field, ctx); in ec_GFp_simple_set_compressed_coordinates()
435 if (!BN_usub(y, &group->field, y)) { in ec_GFp_simple_set_compressed_coordinates()
445 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
457 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, in EC_POINT_set_compressed_coordinates_GFp() argument
460 if (group->meth->point_set_compressed_coordinates == 0 && in EC_POINT_set_compressed_coordinates_GFp()
461 !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) { in EC_POINT_set_compressed_coordinates_GFp()
466 if (group->meth != point->meth) { in EC_POINT_set_compressed_coordinates_GFp()
471 if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) { in EC_POINT_set_compressed_coordinates_GFp()
472 return ec_GFp_simple_set_compressed_coordinates(group, point, x, y_bit, in EC_POINT_set_compressed_coordinates_GFp()
475 return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, in EC_POINT_set_compressed_coordinates_GFp()