Lines Matching refs:ctx
37 BN_CTX *ctx);
77 BN_CTX *ctx = NULL;
102 ctx = BN_CTX_new_ex(dsa->libctx);
103 if (ctx == NULL)
105 m = BN_CTX_get(ctx);
106 blind = BN_CTX_get(ctx);
107 blindm = BN_CTX_get(ctx);
108 tmp = BN_CTX_get(ctx);
113 if (!dsa_sign_setup(dsa, ctx, &kinv, &ret->r, dgst, dlen))
142 BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY, 0, ctx))
150 if (!BN_mod_mul(tmp, blind, dsa->priv_key, dsa->params.q, ctx))
152 if (!BN_mod_mul(tmp, tmp, ret->r, dsa->params.q, ctx))
156 if (!BN_mod_mul(blindm, blind, m, dsa->params.q, ctx))
164 if (!BN_mod_mul(ret->s, ret->s, kinv, dsa->params.q, ctx))
168 if (BN_mod_inverse(blind, blind, dsa->params.q, ctx) == NULL)
170 if (!BN_mod_mul(ret->s, ret->s, blind, dsa->params.q, ctx))
193 BN_CTX_free(ctx);
213 BN_CTX *ctx = NULL;
245 if ((ctx = BN_CTX_new_ex(NULL)) == NULL)
248 ctx = ctx_in;
266 dlen, ctx))
268 } else if (!BN_priv_rand_range_ex(k, dsa->params.q, 0, ctx))
277 dsa->lock, dsa->params.p, ctx))
304 ctx, dsa->method_mont_p))
307 if (!BN_mod_exp_mont(r, dsa->params.g, k, dsa->params.p, ctx,
312 if (!BN_mod(r, r, dsa->params.q, ctx))
316 if ((kinv = dsa_mod_inverse_fermat(k, dsa->params.q, ctx)) == NULL)
326 if (ctx != ctx_in)
327 BN_CTX_free(ctx);
336 BN_CTX *ctx;
363 ctx = BN_CTX_new_ex(NULL); /* verify does not need a libctx */
364 if (u1 == NULL || u2 == NULL || t1 == NULL || ctx == NULL)
383 if ((BN_mod_inverse(u2, s, dsa->params.q, ctx)) == NULL)
398 if (!BN_mod_mul(u1, u1, u2, dsa->params.q, ctx))
402 if (!BN_mod_mul(u2, r, u2, dsa->params.q, ctx))
407 dsa->lock, dsa->params.p, ctx);
414 dsa->params.p, ctx, mont))
418 dsa->params.p, ctx, mont))
423 if (!BN_mod(u1, t1, dsa->params.q, ctx))
434 BN_CTX_free(ctx);
463 BN_CTX *ctx)
471 BN_CTX_start(ctx);
472 if ((e = BN_CTX_get(ctx)) != NULL
475 && BN_mod_exp_mont(r, k, e, q, ctx, NULL))
479 BN_CTX_end(ctx);