Lines Matching refs:group

120 int ec_GFp_mont_group_init(EC_GROUP *group) {
123 ok = ec_GFp_simple_group_init(group);
124 group->field_data1 = NULL;
125 group->field_data2 = NULL;
129 void ec_GFp_mont_group_finish(EC_GROUP *group) {
130 if (group->field_data1 != NULL) {
131 BN_MONT_CTX_free(group->field_data1);
132 group->field_data1 = NULL;
134 if (group->field_data2 != NULL) {
135 BN_free(group->field_data2);
136 group->field_data2 = NULL;
138 ec_GFp_simple_group_finish(group);
141 void ec_GFp_mont_group_clear_finish(EC_GROUP *group) {
142 if (group->field_data1 != NULL) {
143 BN_MONT_CTX_free(group->field_data1);
144 group->field_data1 = NULL;
146 if (group->field_data2 != NULL) {
147 BN_clear_free(group->field_data2);
148 group->field_data2 = NULL;
150 ec_GFp_simple_group_clear_finish(group);
189 int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p,
196 if (group->field_data1 != NULL) {
197 BN_MONT_CTX_free(group->field_data1);
198 group->field_data1 = NULL;
200 if (group->field_data2 != NULL) {
201 BN_free(group->field_data2);
202 group->field_data2 = NULL;
224 group->field_data1 = mont;
226 group->field_data2 = one;
229 ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
232 BN_MONT_CTX_free(group->field_data1);
233 group->field_data1 = NULL;
234 BN_free(group->field_data2);
235 group->field_data2 = NULL;
246 int ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
248 if (group->field_data1 == NULL) {
253 return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx);
256 int ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
258 if (group->field_data1 == NULL) {
263 return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx);
266 int ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
268 if (group->field_data1 == NULL) {
273 return BN_to_montgomery(r, a, (BN_MONT_CTX *)group->field_data1, ctx);
276 int ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
278 if (group->field_data1 == NULL) {
283 return BN_from_montgomery(r, a, group->field_data1, ctx);
286 int ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r,
288 if (group->field_data2 == NULL) {
293 if (!BN_copy(r, group->field_data2))