Lines Matching defs:order

58         ret->order = BN_new();
59 if (ret->order == NULL)
72 BN_free(ret->order);
132 BN_free(group->order);
153 BN_clear_free(group->order);
237 if (!BN_copy(dest->order, src->order))
303 * Try computing cofactor from the generator order (n) and field cardinality (q).
324 if (BN_num_bits(group->order) <= (BN_num_bits(group->field) + 1) / 2 + 3) {
349 if (!BN_rshift1(group->cofactor, group->order) /* n/2 */
354 || !BN_div(group->cofactor, NULL, group->cofactor, group->order, ctx))
364 const BIGNUM *order, const BIGNUM *cofactor)
379 * - require order >= 1
380 * - enforce upper bound due to Hasse thm: order can be no more than one bit
383 if (order == NULL || BN_is_zero(order) || BN_is_negative(order)
384 || BN_num_bits(order) > BN_num_bits(group->field) + 1) {
407 if (!BN_copy(group->order, order))
420 * Some groups have an order with
424 if (BN_is_odd(group->order)) {
443 int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
445 if (group->order == NULL)
447 if (!BN_copy(order, group->order))
450 return !BN_is_zero(order);
455 return group->order;
685 /* return an error if either order is NULL */
1182 * ec_precompute_mont_data sets |group->mont_data| from |group->order| and
1200 if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) {
1228 if (group->order == NULL)
1230 return BN_num_bits(group->order);
1258 * order must be prime and use Fermats Little Theorem instead.
1262 if (!BN_sub(e, group->order, e))
1268 if (!BN_mod_exp_mont(r, x, e, group->order, ctx, group->mont_data))
1283 * - When group->order is even, this function returns an error.
1284 * - When group->order is otherwise composite, the correctness
1286 * - When x is outside the range [1, group->order), the correctness
1289 * range [1, group->order).
1410 const BIGNUM *order = EC_GROUP_get0_order(group);
1415 || !EC_GROUP_set_generator(dup, point, order, NULL))
1547 BIGNUM *p = NULL, *a = NULL, *b = NULL, *order = NULL, *cofactor = NULL;
1593 order = BN_CTX_get(bnctx);
1594 if (order == NULL) {
1696 /* order */
1698 if (!OSSL_PARAM_get_BN(ptmp, &order)
1699 || (BN_is_negative(order) || BN_is_zero(order))
1700 || (BN_num_bits(order) > (int)field_bits + 1)) { /* Hasse bound */
1715 /* set the generator, order and cofactor (if present) */
1716 if (!EC_GROUP_set_generator(group, point, order, cofactor)) {