Lines Matching defs:ctx
92 BN_CTX *ctx = NULL;
115 if ((ctx = ctx_in) == NULL) {
116 if ((ctx = BN_CTX_new_ex(eckey->libctx)) == NULL) {
149 dgst, dlen, ctx)) {
154 if (!BN_priv_rand_range_ex(k, order, 0, ctx)) {
162 if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx)) {
167 if (!EC_POINT_get_affine_coordinates(group, tmp_point, X, NULL, ctx)) {
172 if (!BN_nnmod(r, X, order, ctx)) {
179 if (!ossl_ec_group_do_inverse_ord(group, k, k, ctx)) {
196 if (ctx != ctx_in)
197 BN_CTX_free(ctx);
217 BN_CTX *ctx = NULL;
252 if ((ctx = BN_CTX_new_ex(eckey->libctx)) == NULL
276 if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) {
296 if (!bn_to_mont_fixed_top(s, ret->r, group->mont_data, ctx)
297 || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) {
309 if (!bn_to_mont_fixed_top(s, s, group->mont_data, ctx)
310 || !BN_mod_mul_montgomery(s, s, ckinv, group->mont_data, ctx)) {
341 BN_CTX_free(ctx);
382 BN_CTX *ctx;
401 ctx = BN_CTX_new_ex(eckey->libctx);
402 if (ctx == NULL) {
406 BN_CTX_start(ctx);
407 u1 = BN_CTX_get(ctx);
408 u2 = BN_CTX_get(ctx);
409 m = BN_CTX_get(ctx);
410 X = BN_CTX_get(ctx);
430 if (!ossl_ec_group_do_inverse_ord(group, u2, sig->s, ctx)) {
451 if (!BN_mod_mul(u1, m, u2, order, ctx)) {
456 if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) {
465 if (!EC_POINT_mul(group, point, u1, pub_key, u2, ctx)) {
470 if (!EC_POINT_get_affine_coordinates(group, point, X, NULL, ctx)) {
475 if (!BN_nnmod(u1, X, order, ctx)) {
482 BN_CTX_end(ctx);
483 BN_CTX_free(ctx);