Lines Matching refs:order
93 BIGNUM *k = NULL, *r = NULL, *order = NULL, *X = NULL;
117 order = BN_new();
119 if (!k || !r || !order || !X)
129 if (!EC_GROUP_get_order(group, order, ctx))
139 if (!BN_rand_range(k, order))
151 if (!BN_add(k, k, order)) goto err;
152 if (BN_num_bits(k) <= BN_num_bits(order))
153 if (!BN_add(k, k, order)) goto err;
181 if (!BN_nnmod(r, X, order, ctx))
190 if (!BN_mod_inverse(k, k, order, ctx))
212 if (order != NULL)
213 BN_free(order);
226 BIGNUM *kinv=NULL, *s, *m=NULL,*tmp=NULL,*order=NULL;
252 if ((ctx = BN_CTX_new()) == NULL || (order = BN_new()) == NULL ||
259 if (!EC_GROUP_get_order(group, order, ctx))
264 i = BN_num_bits(order);
302 if (!BN_mod_mul(tmp, priv_key, ret->r, order, ctx))
307 if (!BN_mod_add_quick(s, tmp, m, order))
312 if (!BN_mod_mul(s, s, ckinv, order, ctx))
346 if (order)
347 BN_free(order);
358 BIGNUM *order, *u1, *u2, *m, *X;
378 order = BN_CTX_get(ctx);
389 if (!EC_GROUP_get_order(group, order, ctx))
396 BN_ucmp(sig->r, order) >= 0 || BN_is_zero(sig->s) ||
397 BN_is_negative(sig->s) || BN_ucmp(sig->s, order) >= 0)
403 /* calculate tmp1 = inv(S) mod order */
404 if (!BN_mod_inverse(u2, sig->s, order, ctx))
410 i = BN_num_bits(order);
427 /* u1 = m * tmp mod order */
428 if (!BN_mod_mul(u1, m, u2, order, ctx))
434 if (!BN_mod_mul(u2, sig->r, u2, order, ctx))
470 if (!BN_nnmod(u1, X, order, ctx))