Lines Matching defs:ctx
45 int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
56 BN_RECP_CTX *recp, BN_CTX *ctx)
62 BN_CTX_start(ctx);
63 if ((a = BN_CTX_get(ctx)) == NULL)
67 if (!BN_sqr(a, x, ctx))
70 if (!BN_mul(a, x, y, ctx))
77 ret = BN_div_recp(NULL, r, ca, recp, ctx);
79 BN_CTX_end(ctx);
85 BN_RECP_CTX *recp, BN_CTX *ctx)
90 BN_CTX_start(ctx);
91 d = (dv != NULL) ? dv : BN_CTX_get(ctx);
92 r = (rem != NULL) ? rem : BN_CTX_get(ctx);
93 a = BN_CTX_get(ctx);
94 b = BN_CTX_get(ctx);
101 BN_CTX_end(ctx);
104 BN_CTX_end(ctx);
121 recp->shift = BN_reciprocal(&(recp->Nr), &(recp->N), i, ctx);
134 if (!BN_mul(b, a, &(recp->Nr), ctx))
140 if (!BN_mul(b, &(recp->N), d, ctx))
162 BN_CTX_end(ctx);
174 int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx)
179 BN_CTX_start(ctx);
180 if ((t = BN_CTX_get(ctx)) == NULL)
186 if (!BN_div(r, NULL, t, m, ctx))
192 BN_CTX_end(ctx);