Lines Matching refs:group

122 int ec_GFp_mont_group_init(EC_GROUP *group)
126 ok = ec_GFp_simple_group_init(group);
127 group->field_data1 = NULL;
128 group->field_data2 = NULL;
133 void ec_GFp_mont_group_finish(EC_GROUP *group)
135 if (group->field_data1 != NULL)
137 BN_MONT_CTX_free(group->field_data1);
138 group->field_data1 = NULL;
140 if (group->field_data2 != NULL)
142 BN_free(group->field_data2);
143 group->field_data2 = NULL;
145 ec_GFp_simple_group_finish(group);
149 void ec_GFp_mont_group_clear_finish(EC_GROUP *group)
151 if (group->field_data1 != NULL)
153 BN_MONT_CTX_free(group->field_data1);
154 group->field_data1 = NULL;
156 if (group->field_data2 != NULL)
158 BN_clear_free(group->field_data2);
159 group->field_data2 = NULL;
161 ec_GFp_simple_group_clear_finish(group);
204 int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
211 if (group->field_data1 != NULL)
213 BN_MONT_CTX_free(group->field_data1);
214 group->field_data1 = NULL;
216 if (group->field_data2 != NULL)
218 BN_free(group->field_data2);
219 group->field_data2 = NULL;
240 group->field_data1 = mont;
242 group->field_data2 = one;
245 ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
249 BN_MONT_CTX_free(group->field_data1);
250 group->field_data1 = NULL;
251 BN_free(group->field_data2);
252 group->field_data2 = NULL;
264 int ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
266 if (group->field_data1 == NULL)
272 return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx);
276 int ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
278 if (group->field_data1 == NULL)
284 return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx);
288 int ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
290 if (group->field_data1 == NULL)
296 return BN_to_montgomery(r, a, (BN_MONT_CTX *)group->field_data1, ctx);
300 int ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
302 if (group->field_data1 == NULL)
308 return BN_from_montgomery(r, a, group->field_data1, ctx);
312 int ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r, BN_CTX *ctx)
314 if (group->field_data2 == NULL)
320 if (!BN_copy(r, group->field_data2)) return 0;