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))
171 if (!BN_nnmod(r, X, order, ctx))
180 if (!BN_mod_inverse(k, k, order, ctx))
202 if (order != NULL)
203 BN_free(order);
216 BIGNUM *kinv=NULL, *s, *m=NULL,*tmp=NULL,*order=NULL;
242 if ((ctx = BN_CTX_new()) == NULL || (order = BN_new()) == NULL ||
249 if (!EC_GROUP_get_order(group, order, ctx))
254 i = BN_num_bits(order);
292 if (!BN_mod_mul(tmp, priv_key, ret->r, order, ctx))
297 if (!BN_mod_add_quick(s, tmp, m, order))
302 if (!BN_mod_mul(s, s, ckinv, order, ctx))
336 if (order)
337 BN_free(order);
348 BIGNUM *order, *u1, *u2, *m, *X;
368 order = BN_CTX_get(ctx);
379 if (!EC_GROUP_get_order(group, order, ctx))
386 BN_ucmp(sig->r, order) >= 0 || BN_is_zero(sig->s) ||
387 BN_is_negative(sig->s) || BN_ucmp(sig->s, order) >= 0)
393 /* calculate tmp1 = inv(S) mod order */
394 if (!BN_mod_inverse(u2, sig->s, order, ctx))
400 i = BN_num_bits(order);
417 /* u1 = m * tmp mod order */
418 if (!BN_mod_mul(u1, m, u2, order, ctx))
424 if (!BN_mod_mul(u2, sig->r, u2, order, ctx))
459 if (!BN_nnmod(u1, X, order, ctx))