74 #ifndef OPENSSL_NO_EC2M
92 if (t1 == NULL)
goto err;
99 if (!group->
meth->
field_mul(group, t1, &group->
b, t1, ctx))
goto err;
125 if (t2 == NULL)
goto err;
128 if (!group->
meth->
field_mul(group, x1, x1, z2, ctx))
goto err;
129 if (!group->
meth->
field_mul(group, z1, z1, x2, ctx))
goto err;
130 if (!group->
meth->
field_mul(group, t2, x1, z1, ctx))
goto err;
133 if (!group->
meth->
field_mul(group, x1, z1, t1, ctx))
goto err;
177 if (t5 == NULL)
goto err;
179 if (!
BN_one(t5))
goto err;
181 if (!group->
meth->
field_mul(group, t3, z1, z2, ctx))
goto err;
183 if (!group->
meth->
field_mul(group, z1, z1, x, ctx))
goto err;
185 if (!group->
meth->
field_mul(group, z2, z2, x, ctx))
goto err;
186 if (!group->
meth->
field_mul(group, x1, z2, x1, ctx))
goto err;
189 if (!group->
meth->
field_mul(group, z2, z2, z1, ctx))
goto err;
192 if (!group->
meth->
field_mul(group, t4, t4, t3, ctx))
goto err;
195 if (!group->
meth->
field_mul(group, t3, t3, x, ctx))
goto err;
196 if (!group->
meth->
field_div(group, t3, t5, t3, ctx))
goto err;
197 if (!group->
meth->
field_mul(group, t4, t3, t4, ctx))
goto err;
198 if (!group->
meth->
field_mul(group, x2, x1, t3, ctx))
goto err;
201 if (!group->
meth->
field_mul(group, z2, z2, t4, ctx))
goto err;
220 BIGNUM *x1, *x2, *z1, *z2;
231 if ((scalar == NULL) ||
BN_is_zero(scalar) || (point == NULL) ||
244 if (z1 == NULL)
goto err;
250 if (!
BN_one(z1))
goto err;
259 while (!(word & mask)) mask >>= 1;
275 if (!gf2m_Madd(group, &point->
X, x1, z1, x2, z2, ctx))
goto err;
276 if (!gf2m_Mdouble(group, x2, z2, ctx))
goto err;
280 if (!gf2m_Madd(group, &point->
X, x2, z2, x1, z1, ctx))
goto err;
281 if (!gf2m_Mdouble(group, x1, z1, ctx))
goto err;
289 i = gf2m_Mxy(group, &point->
X, &point->
Y, x1, z1, x2, z2, ctx);
290 if (i == 0)
goto err;
339 ret =
ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
350 if (!ec_GF2m_montgomery_point_multiply(group, p, scalar, group->
generator, ctx))
goto err;
352 if (!group->
meth->
invert(group, p, ctx))
goto err;
353 if (!group->
meth->
add(group, acc, acc, p, ctx))
goto err;
356 for (i = 0; i <
num; i++)
358 if (!ec_GF2m_montgomery_point_multiply(group, p, scalars[i], points[i], ctx))
goto err;
360 if (!group->
meth->
invert(group, p, ctx))
goto err;
361 if (!group->
meth->
add(group, acc, acc, p, ctx))
goto err;