Lines Matching refs:ctx
26 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
93 int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx)
108 if (!BN_BLINDING_create_param(b, NULL, NULL, ctx, NULL, NULL))
112 if (!bn_mul_mont_fixed_top(b->Ai, b->Ai, b->Ai, b->m_ctx, ctx)
113 || !bn_mul_mont_fixed_top(b->A, b->A, b->A, b->m_ctx, ctx))
116 if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx)
117 || !BN_mod_mul(b->A, b->A, b->A, b->mod, ctx))
129 int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx)
131 return BN_BLINDING_convert_ex(n, NULL, b, ctx);
134 int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
148 else if (!BN_BLINDING_update(b, ctx))
155 ret = BN_mod_mul_montgomery(n, n, b->A, b->m_ctx, ctx);
157 ret = BN_mod_mul(n, n, b->A, b->mod, ctx);
162 int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx)
164 return BN_BLINDING_invert_ex(n, NULL, b, ctx);
168 BN_CTX *ctx)
194 ret = bn_mul_mont_fixed_top(n, n, r, b->m_ctx, ctx);
197 ret = BN_mod_mul(n, n, r, b->mod, ctx);
235 const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
240 BN_CTX *ctx,
274 if (!BN_priv_rand_range_ex(ret->A, ret->mod, 0, ctx))
276 if (int_bn_mod_inverse(ret->Ai, ret->A, ret->mod, ctx, &rv))
292 if (!ret->bn_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx))
295 if (!BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx))
300 if (!bn_to_mont_fixed_top(ret->Ai, ret->Ai, ret->m_ctx, ctx)
301 || !bn_to_mont_fixed_top(ret->A, ret->A, ret->m_ctx, ctx))