Lines Matching refs:ctx
13 BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
61 BN_CTX_start(ctx);
63 A = BN_CTX_get(ctx);
64 b = BN_CTX_get(ctx);
65 q = BN_CTX_get(ctx);
66 t = BN_CTX_get(ctx);
67 x = BN_CTX_get(ctx);
68 y = BN_CTX_get(ctx);
78 if (!BN_nnmod(A, a, p, ctx))
101 if (!BN_mod_exp(ret, A, q, p, ctx))
144 if (!BN_mod_exp(b, t, q, p, ctx))
148 if (!BN_mod_sqr(y, b, p, ctx))
152 if (!BN_mod_mul(t, t, y, p, ctx))
158 if (!BN_mod_mul(x, A, b, p, ctx))
160 if (!BN_mod_mul(x, x, t, p, ctx))
186 if (!BN_priv_rand_ex(y, BN_num_bits(p), 0, 0, 0, ctx))
198 r = BN_kronecker(y, q, ctx); /* here 'q' is |p| */
227 if (!BN_mod_exp(y, y, q, p, ctx))
259 if (!BN_nnmod(t, A, p, ctx))
269 if (!BN_mod_exp(x, A, t, p, ctx))
280 if (!BN_mod_sqr(b, x, p, ctx))
282 if (!BN_mod_mul(b, b, A, p, ctx))
286 if (!BN_mod_mul(x, x, A, p, ctx))
310 if (!BN_mod_sqr(t, b, p, ctx))
314 if (!BN_mod_mul(t, t, t, p, ctx))
330 if (!BN_mod_sqr(t, t, p, ctx))
333 if (!BN_mod_mul(y, t, t, p, ctx))
335 if (!BN_mod_mul(x, x, t, p, ctx))
337 if (!BN_mod_mul(b, b, y, p, ctx))
349 if (!BN_mod_sqr(x, ret, p, ctx))
365 BN_CTX_end(ctx);