Home | History | Annotate | Download | only in ecdsa

Lines Matching refs:order

96 	BIGNUM	 *k = NULL, *r = NULL, *order = NULL, *X = NULL;
120 order = BN_new();
122 if (!k || !r || !order || !X)
132 if (!EC_GROUP_get_order(group, order, ctx))
146 k, order,
158 if (!BN_rand_range(k, order))
171 if (!BN_add(k, k, order)) goto err;
172 if (BN_num_bits(k) <= BN_num_bits(order))
173 if (!BN_add(k, k, order)) goto err;
201 if (!BN_nnmod(r, X, order, ctx))
210 if (!BN_mod_inverse(k, k, order, ctx))
232 if (order != NULL)
233 BN_free(order);
246 BIGNUM *kinv=NULL, *s, *m=NULL,*tmp=NULL,*order=NULL;
272 if ((ctx = BN_CTX_new()) == NULL || (order = BN_new()) == NULL ||
279 if (!EC_GROUP_get_order(group, order, ctx))
284 i = BN_num_bits(order);
322 if (!BN_mod_mul(tmp, priv_key, ret->r, order, ctx))
327 if (!BN_mod_add_quick(s, tmp, m, order))
332 if (!BN_mod_mul(s, s, ckinv, order, ctx))
366 if (order)
367 BN_free(order);
378 BIGNUM *order, *u1, *u2, *m, *X;
398 order = BN_CTX_get(ctx);
409 if (!EC_GROUP_get_order(group, order, ctx))
416 BN_ucmp(sig->r, order) >= 0 || BN_is_zero(sig->s) ||
417 BN_is_negative(sig->s) || BN_ucmp(sig->s, order) >= 0)
423 /* calculate tmp1 = inv(S) mod order */
424 if (!BN_mod_inverse(u2, sig->s, order, ctx))
430 i = BN_num_bits(order);
447 /* u1 = m * tmp mod order */
448 if (!BN_mod_mul(u1, m, u2, order, ctx))
454 if (!BN_mod_mul(u2, sig->r, u2, order, ctx))
490 if (!BN_nnmod(u1, X, order, ctx))