Lines Matching refs:group
57 * of the group of points on the elliptic curve. Input and output values
60 ECPoint_mul(const ECGroup *group, const mp_int *k, const mp_int *px,
66 ARGCHK((k != NULL) && (group != NULL), MP_BADARG);
69 /* want scalar to be less than or equal to group order */
70 if (mp_cmp(k, &group->order) > 0) {
72 MP_CHECKOK(mp_mod(k, &group->order, &kt));
81 if (group->base_point_mul) {
82 MP_CHECKOK(group->base_point_mul(&kt, rx, ry, group));
84 MP_CHECKOK(group->
85 point_mul(&kt, &group->genx, &group->geny, rx, ry,
86 group));
89 if (group->meth->field_enc) {
90 MP_CHECKOK(group->meth->field_enc(px, rx, group->meth));
91 MP_CHECKOK(group->meth->field_enc(py, ry, group->meth));
92 MP_CHECKOK(group->point_mul(&kt, rx, ry, rx, ry, group));
94 MP_CHECKOK(group->point_mul(&kt, px, py, rx, ry, group));
97 if (group->meth->field_dec) {
98 MP_CHECKOK(group->meth->field_dec(rx, rx, group->meth));
99 MP_CHECKOK(group->meth->field_dec(ry, ry, group->meth));
110 * k2 * P(x, y), where G is the generator (base point) of the group of
116 const ECGroup *group)
121 ARGCHK(group != NULL, MP_BADARG);
128 return ECPoint_mul(group, k2, px, py, rx, ry);
130 return ECPoint_mul(group, k1, NULL, NULL, rx, ry);
138 MP_CHECKOK(ECPoint_mul(group, k1, NULL, NULL, &sx, &sy));
139 MP_CHECKOK(ECPoint_mul(group, k2, px, py, rx, ry));
141 if (group->meth->field_enc) {
142 MP_CHECKOK(group->meth->field_enc(&sx, &sx, group->meth));
143 MP_CHECKOK(group->meth->field_enc(&sy, &sy, group->meth));
144 MP_CHECKOK(group->meth->field_enc(rx, rx, group->meth));
145 MP_CHECKOK(group->meth->field_enc(ry, ry, group->meth));
148 MP_CHECKOK(group->point_add(&sx, &sy, rx, ry, rx, ry, group));
150 if (group->meth->field_dec) {
151 MP_CHECKOK(group->meth->field_dec(rx, rx, group->meth));
152 MP_CHECKOK(group->meth->field_dec(ry, ry, group->meth));
162 * k2 * P(x, y), where G is the generator (base point) of the group of
171 const ECGroup *group)
179 ARGCHK(group != NULL, MP_BADARG);
186 return ECPoint_mul(group, k2, px, py, rx, ry);
188 return ECPoint_mul(group, k1, NULL, NULL, rx, ry);
212 if (group->meth->field_enc) {
213 MP_CHECKOK(group->meth->
214 field_enc(px, &precomp[1][0][0], group->meth));
215 MP_CHECKOK(group->meth->
216 field_enc(py, &precomp[1][0][1], group->meth));
221 MP_CHECKOK(mp_copy(&group->genx, &precomp[0][1][0]));
222 MP_CHECKOK(mp_copy(&group->geny, &precomp[0][1][1]));
226 MP_CHECKOK(mp_copy(&group->genx, &precomp[1][0][0]));
227 MP_CHECKOK(mp_copy(&group->geny, &precomp[1][0][1]));
228 if (group->meth->field_enc) {
229 MP_CHECKOK(group->meth->
230 field_enc(px, &precomp[0][1][0], group->meth));
231 MP_CHECKOK(group->meth->
232 field_enc(py, &precomp[0][1][1], group->meth));
241 MP_CHECKOK(group->
243 &precomp[2][0][0], &precomp[2][0][1], group));
244 MP_CHECKOK(group->
247 &precomp[3][0][0], &precomp[3][0][1], group));
250 MP_CHECKOK(group->
253 &precomp[i][1][0], &precomp[i][1][1], group));
256 MP_CHECKOK(group->
258 &precomp[0][2][0], &precomp[0][2][1], group));
260 MP_CHECKOK(group->
263 &precomp[i][2][0], &precomp[i][2][1], group));
266 MP_CHECKOK(group->
269 &precomp[0][3][0], &precomp[0][3][1], group));
271 MP_CHECKOK(group->
274 &precomp[i][3][0], &precomp[i][3][1], group));
291 MP_CHECKOK(group->point_dbl(rx, ry, rx, ry, group));
292 MP_CHECKOK(group->point_dbl(rx, ry, rx, ry, group));
294 MP_CHECKOK(group->
296 &precomp[ai][bi][1], rx, ry, group));
299 if (group->meth->field_dec) {
300 MP_CHECKOK(group->meth->field_dec(rx, rx, group->meth));
301 MP_CHECKOK(group->meth->field_dec(ry, ry, group->meth));
315 * k2 * P(x, y), where G is the generator (base point) of the group of
319 ECPoints_mul(const ECGroup *group, const mp_int *k1, const mp_int *k2,
329 ARGCHK(group != NULL, MP_BADARG);
331 /* want scalar to be less than or equal to group order */
333 if (mp_cmp(k1, &group->order) >= 0) {
335 MP_CHECKOK(mp_mod(k1, &group->order, &k1t));
344 if (mp_cmp(k2, &group->order) >= 0) {
346 MP_CHECKOK(mp_mod(k2, &group->order, &k2t));
356 if (group->points_mul) {
357 res = group->points_mul(k1p, k2p, px, py, rx, ry, group);
359 res = ec_pts_mul_simul_w2(k1p, k2p, px, py, rx, ry, group);