Lines Matching refs:group
38 const EC_GROUP *group; /* parent EC_GROUP object */
51 static EC_PRE_COMP *ec_pre_comp_new(const EC_GROUP *group)
55 if (!group)
64 ret->group = group;
117 * This functions computes a single point multiplication over the EC group,
128 * constant time bets are off (where n is the cardinality of the EC group).
130 * This function expects `group->order` and `group->cardinality` to be well
141 * input parameters `group`, `r`, `scalar` and `ctx` are not NULL.
145 int ossl_ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
158 if (point != NULL && EC_POINT_is_at_infinity(group, point))
159 return EC_POINT_set_to_infinity(group, r);
161 if (BN_is_zero(group->order)) {
165 if (BN_is_zero(group->cofactor)) {
172 if (((p = EC_POINT_new(group)) == NULL)
173 || ((s = EC_POINT_new(group)) == NULL)) {
179 if (!EC_POINT_copy(p, group->generator)) {
202 if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) {
255 group_top = bn_get_top(group->field);
270 if (!p->Z_is_one && (group->meth->make_affine == NULL
271 || !group->meth->make_affine(group, p, ctx))) {
277 if (!ec_point_ladder_pre(group, r, s, p, ctx)) {
357 if (!ec_point_ladder_step(group, r, s, p, ctx)) {
372 if (!ec_point_ladder_post(group, r, s, p, ctx)) {
410 int ossl_ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
438 if (!BN_is_zero(group->order) && !BN_is_zero(group->cofactor)) {
444 if ((scalar != group->order) && (scalar != NULL) && (num == 0)) {
453 return ossl_ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
455 if ((scalar == NULL) && (num == 1) && (scalars[0] != group->order)) {
463 return ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0],
469 generator = EC_GROUP_get0_generator(group);
477 pre_comp = group->pre_comp.ec;
479 && (EC_POINT_cmp(group, generator, pre_comp->points[0], ctx) ==
675 *v = EC_POINT_new(group);
686 if ((tmp = EC_POINT_new(group)) == NULL)
706 if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx))
710 (group, val_sub[i][j], val_sub[i][j - 1], tmp, ctx))
716 if (group->meth->points_make_affine == NULL
717 || !group->meth->points_make_affine(group, num_val, val, ctx))
724 if (!EC_POINT_dbl(group, r, r, ctx))
741 if (!EC_POINT_invert(group, r, ctx))
759 * group.
761 if (!ossl_ec_point_blind_coordinates(group, r, ctx)) {
769 (group, r, r, val_sub[i][digit >> 1], ctx))
778 if (!EC_POINT_set_to_infinity(group, r))
782 if (!EC_POINT_invert(group, r, ctx))
830 int ossl_ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
845 EC_pre_comp_free(group);
846 if ((pre_comp = ec_pre_comp_new(group)) == NULL)
849 generator = EC_GROUP_get0_generator(group);
865 order = EC_GROUP_get0_order(group);
904 if ((var[i] = EC_POINT_new(group)) == NULL) {
910 if ((tmp_point = EC_POINT_new(group)) == NULL
911 || (base = EC_POINT_new(group)) == NULL) {
923 if (!EC_POINT_dbl(group, tmp_point, base, ctx))
933 if (!EC_POINT_add(group, *var, tmp_point, *(var - 1), ctx))
948 if (!EC_POINT_dbl(group, base, tmp_point, ctx))
951 if (!EC_POINT_dbl(group, base, base, ctx))
957 if (group->meth->points_make_affine == NULL
958 || !group->meth->points_make_affine(group, num, points, ctx))
961 pre_comp->group = group;
968 SETPRECOMP(group, ec, pre_comp);
991 int ossl_ec_wNAF_have_precompute_mult(const EC_GROUP *group)
993 return HAVEPRECOMP(group, ec);