Lines Matching refs:group

83 int ossl_ec_GFp_mont_group_init(EC_GROUP *group)
87 ok = ossl_ec_GFp_simple_group_init(group);
88 group->field_data1 = NULL;
89 group->field_data2 = NULL;
93 void ossl_ec_GFp_mont_group_finish(EC_GROUP *group)
95 BN_MONT_CTX_free(group->field_data1);
96 group->field_data1 = NULL;
97 BN_free(group->field_data2);
98 group->field_data2 = NULL;
99 ossl_ec_GFp_simple_group_finish(group);
102 void ossl_ec_GFp_mont_group_clear_finish(EC_GROUP *group)
104 BN_MONT_CTX_free(group->field_data1);
105 group->field_data1 = NULL;
106 BN_clear_free(group->field_data2);
107 group->field_data2 = NULL;
108 ossl_ec_GFp_simple_group_clear_finish(group);
142 int ossl_ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p,
151 BN_MONT_CTX_free(group->field_data1);
152 group->field_data1 = NULL;
153 BN_free(group->field_data2);
154 group->field_data2 = NULL;
157 ctx = new_ctx = BN_CTX_new_ex(group->libctx);
175 group->field_data1 = mont;
177 group->field_data2 = one;
180 ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
183 BN_MONT_CTX_free(group->field_data1);
184 group->field_data1 = NULL;
185 BN_free(group->field_data2);
186 group->field_data2 = NULL;
196 int ossl_ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
199 if (group->field_data1 == NULL) {
204 return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx);
207 int ossl_ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
210 if (group->field_data1 == NULL) {
215 return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx);
223 int ossl_ec_GFp_mont_field_inv(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
230 if (group->field_data1 == NULL)
234 && (ctx = new_ctx = BN_CTX_secure_new_ex(group->libctx)) == NULL)
244 if (!BN_sub(e, group->field, e))
250 if (!BN_mod_exp_mont(r, a, e, group->field, ctx, group->field_data1))
267 int ossl_ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r,
270 if (group->field_data1 == NULL) {
275 return BN_to_montgomery(r, a, (BN_MONT_CTX *)group->field_data1, ctx);
278 int ossl_ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r,
281 if (group->field_data1 == NULL) {
286 return BN_from_montgomery(r, a, group->field_data1, ctx);
289 int ossl_ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r,
292 if (group->field_data2 == NULL) {
297 if (!BN_copy(r, group->field_data2))