• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/openssl-1.0.0q/crypto/ec/

Lines Matching refs:group

82 static int gf2m_Mdouble(const EC_GROUP *group, BIGNUM *x, BIGNUM *z, BN_CTX *ctx)
92 if (!group->meth->field_sqr(group, x, x, ctx)) goto err;
93 if (!group->meth->field_sqr(group, t1, z, ctx)) goto err;
94 if (!group->meth->field_mul(group, z, x, t1, ctx)) goto err;
95 if (!group->meth->field_sqr(group, x, x, ctx)) goto err;
96 if (!group->meth->field_sqr(group, t1, t1, ctx)) goto err;
97 if (!group->meth->field_mul(group, t1, &group->b, t1, ctx)) goto err;
113 static int gf2m_Madd(const EC_GROUP *group, const BIGNUM *x, BIGNUM *x1, BIGNUM *z1,
126 if (!group->meth->field_mul(group, x1, x1, z2, ctx)) goto err;
127 if (!group->meth->field_mul(group, z1, z1, x2, ctx)) goto err;
128 if (!group->meth->field_mul(group, t2, x1, z1, ctx)) goto err;
130 if (!group->meth->field_sqr(group, z1, z1, ctx)) goto err;
131 if (!group->meth->field_mul(group, x1, z1, t1, ctx)) goto err;
150 static int gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1,
179 if (!group->meth->field_mul(group, t3, z1, z2, ctx)) goto err;
181 if (!group->meth->field_mul(group, z1, z1, x, ctx)) goto err;
183 if (!group->meth->field_mul(group, z2, z2, x, ctx)) goto err;
184 if (!group->meth->field_mul(group, x1, z2, x1, ctx)) goto err;
187 if (!group->meth->field_mul(group, z2, z2, z1, ctx)) goto err;
188 if (!group->meth->field_sqr(group, t4, x, ctx)) goto err;
190 if (!group->meth->field_mul(group, t4, t4, t3, ctx)) goto err;
193 if (!group->meth->field_mul(group, t3, t3, x, ctx)) goto err;
194 if (!group->meth->field_div(group, t3, t5, t3, ctx)) goto err;
195 if (!group->meth->field_mul(group, t4, t3, t4, ctx)) goto err;
196 if (!group->meth->field_mul(group, x2, x1, t3, ctx)) goto err;
199 if (!group->meth->field_mul(group, z2, z2, t4, ctx)) goto err;
219 static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
234 EC_POINT_is_at_infinity(group, point))
236 return EC_POINT_set_to_infinity(group, r);
251 bn_wexpand(x1, group->field.top);
252 bn_wexpand(z1, group->field.top);
253 bn_wexpand(x2, group->field.top);
254 bn_wexpand(z2, group->field.top);
256 if (!BN_GF2m_mod_arr(x1, &point->X, group->poly)) goto err; /* x1 = x */
258 if (!group->meth->field_sqr(group, z2, x1, ctx)) goto err; /* z2 = x1^2 = x^2 */
259 if (!group->meth->field_sqr(group, x2, z2, ctx)) goto err;
260 if (!BN_GF2m_add(x2, x2, &group->b)) goto err; /* x2 = x^4 + b */
280 BN_consttime_swap(word & mask, x1, x2, group->field.top);
281 BN_consttime_swap(word & mask, z1, z2, group->field.top);
282 if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err;
283 if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err;
284 BN_consttime_swap(word & mask, x1, x2, group->field.top);
285 BN_consttime_swap(word & mask, z1, z2, group->field.top);
292 i = gf2m_Mxy(group, &point->X, &point->Y, x1, z1, x2, z2, ctx);
296 if (!EC_POINT_set_to_infinity(group, r)) goto err;
317 * scalar*group->generator + scalars[0]*points[0] + ... + scalars[num-1]*points[num-1]
320 int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
340 if ((scalar && (num > 1)) || (num > 2) || (num == 0 && EC_GROUP_have_precompute_mult(group)))
342 ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
346 if ((p = EC_POINT_new(group)) == NULL) goto err;
347 if ((acc = EC_POINT_new(group)) == NULL) goto err;
349 if (!EC_POINT_set_to_infinity(group, acc)) goto err;
353 if (!ec_GF2m_montgomery_point_multiply(group, p, scalar, group->generator, ctx)) goto err;
355 if (!group->meth->invert(group, p, ctx)) goto err;
356 if (!group->meth->add(group, acc, acc, p, ctx)) goto err;
361 if (!ec_GF2m_montgomery_point_multiply(group, p, scalars[i], points[i], ctx)) goto err;
363 if (!group->meth->invert(group, p, ctx)) goto err;
364 if (!group->meth->add(group, acc, acc, p, ctx)) goto err;
383 int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
385 return ec_wNAF_precompute_mult(group, ctx);
388 int ec_GF2m_have_precompute_mult(const EC_GROUP *group)
390 return ec_wNAF_have_precompute_mult(group);