Lines Matching refs:group
55 * of the group of points on the elliptic curve. Input and output values
58 ECPoint_mul(const ECGroup *group, const mp_int *k, const mp_int *px,
64 ARGCHK((k != NULL) && (group != NULL), MP_BADARG);
67 /* want scalar to be less than or equal to group order */
68 if (mp_cmp(k, &group->order) > 0) {
70 MP_CHECKOK(mp_mod(k, &group->order, &kt));
80 if (group->base_point_mul) {
81 MP_CHECKOK(group->base_point_mul(&kt, rx, ry, group));
83 MP_CHECKOK(group->
84 point_mul(&kt, &group->genx, &group->geny, rx, ry,
85 group));
88 if (group->meth->field_enc) {
89 MP_CHECKOK(group->meth->field_enc(px, rx, group->meth));
90 MP_CHECKOK(group->meth->field_enc(py, ry, group->meth));
91 MP_CHECKOK(group->point_mul(&kt, rx, ry, rx, ry, group));
93 MP_CHECKOK(group->point_mul(&kt, px, py, rx, ry, group));
96 if (group->meth->field_dec) {
97 MP_CHECKOK(group->meth->field_dec(rx, rx, group->meth));
98 MP_CHECKOK(group->meth->field_dec(ry, ry, group->meth));
109 * k2 * P(x, y), where G is the generator (base point) of the group of
115 const ECGroup *group)
120 ARGCHK(group != NULL, MP_BADARG);
127 return ECPoint_mul(group, k2, px, py, rx, ry);
129 return ECPoint_mul(group, k1, NULL, NULL, rx, ry);
137 MP_CHECKOK(ECPoint_mul(group, k1, NULL, NULL, &sx, &sy));
138 MP_CHECKOK(ECPoint_mul(group, k2, px, py, rx, ry));
140 if (group->meth->field_enc) {
141 MP_CHECKOK(group->meth->field_enc(&sx, &sx, group->meth));
142 MP_CHECKOK(group->meth->field_enc(&sy, &sy, group->meth));
143 MP_CHECKOK(group->meth->field_enc(rx, rx, group->meth));
144 MP_CHECKOK(group->meth->field_enc(ry, ry, group->meth));
147 MP_CHECKOK(group->point_add(&sx, &sy, rx, ry, rx, ry, group));
149 if (group->meth->field_dec) {
150 MP_CHECKOK(group->meth->field_dec(rx, rx, group->meth));
151 MP_CHECKOK(group->meth->field_dec(ry, ry, group->meth));
161 * k2 * P(x, y), where G is the generator (base point) of the group of
170 const ECGroup *group)
178 ARGCHK(group != NULL, MP_BADARG);
185 return ECPoint_mul(group, k2, px, py, rx, ry);
187 return ECPoint_mul(group, k1, NULL, NULL, rx, ry);
211 if (group->meth->field_enc) {
212 MP_CHECKOK(group->meth->
213 field_enc(px, &precomp[1][0][0], group->meth));
214 MP_CHECKOK(group->meth->
215 field_enc(py, &precomp[1][0][1], group->meth));
220 MP_CHECKOK(mp_copy(&group->genx, &precomp[0][1][0]));
221 MP_CHECKOK(mp_copy(&group->geny, &precomp[0][1][1]));
225 MP_CHECKOK(mp_copy(&group->genx, &precomp[1][0][0]));
226 MP_CHECKOK(mp_copy(&group->geny, &precomp[1][0][1]));
227 if (group->meth->field_enc) {
228 MP_CHECKOK(group->meth->
229 field_enc(px, &precomp[0][1][0], group->meth));
230 MP_CHECKOK(group->meth->
231 field_enc(py, &precomp[0][1][1], group->meth));
240 MP_CHECKOK(group->
242 &precomp[2][0][0], &precomp[2][0][1], group));
243 MP_CHECKOK(group->
246 &precomp[3][0][0], &precomp[3][0][1], group));
249 MP_CHECKOK(group->
252 &precomp[i][1][0], &precomp[i][1][1], group));
255 MP_CHECKOK(group->
257 &precomp[0][2][0], &precomp[0][2][1], group));
259 MP_CHECKOK(group->
262 &precomp[i][2][0], &precomp[i][2][1], group));
265 MP_CHECKOK(group->
268 &precomp[0][3][0], &precomp[0][3][1], group));
270 MP_CHECKOK(group->
273 &precomp[i][3][0], &precomp[i][3][1], group));
290 MP_CHECKOK(group->point_dbl(rx, ry, rx, ry, group));
291 MP_CHECKOK(group->point_dbl(rx, ry, rx, ry, group));
293 MP_CHECKOK(group->
295 &precomp[ai][bi][1], rx, ry, group));
298 if (group->meth->field_dec) {
299 MP_CHECKOK(group->meth->field_dec(rx, rx, group->meth));
300 MP_CHECKOK(group->meth->field_dec(ry, ry, group->meth));
314 * k2 * P(x, y), where G is the generator (base point) of the group of
318 ECPoints_mul(const ECGroup *group, const mp_int *k1, const mp_int *k2,
328 ARGCHK(group != NULL, MP_BADARG);
330 /* want scalar to be less than or equal to group order */
332 if (mp_cmp(k1, &group->order) >= 0) {
334 MP_CHECKOK(mp_mod(k1, &group->order, &k1t));
343 if (mp_cmp(k2, &group->order) >= 0) {
345 MP_CHECKOK(mp_mod(k2, &group->order, &k2t));
355 if (group->points_mul) {
356 res = group->points_mul(k1p, k2p, px, py, rx, ry, group);
358 res = ec_pts_mul_simul_w2(k1p, k2p, px, py, rx, ry, group);