Lines Matching refs:group
77 static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, in ec_GFp_simple_point2oct() argument
93 if (EC_POINT_is_at_infinity(group, point)) { in ec_GFp_simple_point2oct()
99 field_len = BN_num_bytes(&group->field); in ec_GFp_simple_point2oct()
125 if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)) { in ec_GFp_simple_point2oct()
172 static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, in ec_GFp_simple_oct2point() argument
196 field_len = BN_num_bytes(&group->field); in ec_GFp_simple_oct2point()
222 if (BN_ucmp(x, &group->field) >= 0) { in ec_GFp_simple_oct2point()
228 if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) { in ec_GFp_simple_oct2point()
235 if (BN_ucmp(y, &group->field) >= 0) { in ec_GFp_simple_oct2point()
240 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { in ec_GFp_simple_oct2point()
253 int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, in EC_POINT_oct2point() argument
255 if (group->meth != point->meth) { in EC_POINT_oct2point()
259 return ec_GFp_simple_oct2point(group, point, buf, len, ctx); in EC_POINT_oct2point()
262 size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, in EC_POINT_point2oct() argument
265 if (group->meth != point->meth) { in EC_POINT_point2oct()
269 return ec_GFp_simple_point2oct(group, point, form, buf, len, ctx); in EC_POINT_point2oct()
272 int EC_POINT_point2cbb(CBB *out, const EC_GROUP *group, const EC_POINT *point, in EC_POINT_point2cbb() argument
274 size_t len = EC_POINT_point2oct(group, point, form, NULL, 0, ctx); in EC_POINT_point2cbb()
280 EC_POINT_point2oct(group, point, form, p, len, ctx) == len; in EC_POINT_point2cbb()
283 int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, in ec_GFp_simple_set_compressed_coordinates() argument
286 if (BN_is_negative(x) || BN_cmp(x, &group->field) >= 0) { in ec_GFp_simple_set_compressed_coordinates()
319 if (group->meth->field_decode == 0) { in ec_GFp_simple_set_compressed_coordinates()
321 if (!group->meth->field_sqr(group, tmp2, x, ctx) || in ec_GFp_simple_set_compressed_coordinates()
322 !group->meth->field_mul(group, tmp1, tmp2, x, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
326 if (!BN_mod_sqr(tmp2, x, &group->field, ctx) || in ec_GFp_simple_set_compressed_coordinates()
327 !BN_mod_mul(tmp1, tmp2, x, &group->field, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
333 if (group->a_is_minus3) { in ec_GFp_simple_set_compressed_coordinates()
334 if (!BN_mod_lshift1_quick(tmp2, x, &group->field) || in ec_GFp_simple_set_compressed_coordinates()
335 !BN_mod_add_quick(tmp2, tmp2, x, &group->field) || in ec_GFp_simple_set_compressed_coordinates()
336 !BN_mod_sub_quick(tmp1, tmp1, tmp2, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
340 if (group->meth->field_decode) { in ec_GFp_simple_set_compressed_coordinates()
341 if (!group->meth->field_decode(group, tmp2, &group->a, ctx) || in ec_GFp_simple_set_compressed_coordinates()
342 !BN_mod_mul(tmp2, tmp2, x, &group->field, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
347 if (!group->meth->field_mul(group, tmp2, &group->a, x, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
352 if (!BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
358 if (group->meth->field_decode) { in ec_GFp_simple_set_compressed_coordinates()
359 if (!group->meth->field_decode(group, tmp2, &group->b, ctx) || in ec_GFp_simple_set_compressed_coordinates()
360 !BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
364 if (!BN_mod_add_quick(tmp1, tmp1, &group->b, &group->field)) { in ec_GFp_simple_set_compressed_coordinates()
369 if (!BN_mod_sqrt(y, tmp1, &group->field, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
387 if (!BN_usub(y, &group->field, y)) { in ec_GFp_simple_set_compressed_coordinates()
396 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { in ec_GFp_simple_set_compressed_coordinates()
408 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, in EC_POINT_set_compressed_coordinates_GFp() argument
411 if (group->meth != point->meth) { in EC_POINT_set_compressed_coordinates_GFp()
415 return ec_GFp_simple_set_compressed_coordinates(group, point, x, y_bit, ctx); in EC_POINT_set_compressed_coordinates_GFp()