Lines Matching refs:ctx
77 BN_CTX *ctx = NULL;
82 ctx = BN_CTX_new();
83 if (ctx == NULL)
85 BN_CTX_start(ctx);
86 t1 = BN_CTX_get(ctx);
89 t2 = BN_CTX_get(ctx);
100 if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
105 if (!BN_is_prime_ex(dh->q, BN_prime_checks, ctx, NULL))
108 if (!BN_div(t1, t2, dh->p, dh->q, ctx))
134 if (!BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL))
139 if (!BN_is_prime_ex(t1, BN_prime_checks, ctx, NULL))
144 if (ctx != NULL) {
145 BN_CTX_end(ctx);
146 BN_CTX_free(ctx);
155 BN_CTX *ctx = NULL;
158 ctx = BN_CTX_new();
159 if (ctx == NULL)
161 BN_CTX_start(ctx);
162 tmp = BN_CTX_get(ctx);
174 if (!BN_mod_exp(tmp, pub_key, dh->q, dh->p, ctx))
182 if (ctx != NULL) {
183 BN_CTX_end(ctx);
184 BN_CTX_free(ctx);