Lines Matching refs:Ri
167 BIGNUM *Ri, *R; in BN_MONT_CTX_set() local
177 Ri = BN_CTX_get(ctx); in BN_MONT_CTX_set()
178 if (Ri == NULL) { in BN_MONT_CTX_set()
211 if (BN_mod_inverse(Ri, R, &tmod, ctx) == NULL) { in BN_MONT_CTX_set()
214 if (!BN_lshift(Ri, Ri, 2 * BN_BITS2)) { in BN_MONT_CTX_set()
217 if (!BN_is_zero(Ri)) { in BN_MONT_CTX_set()
218 if (!BN_sub_word(Ri, 1)) { in BN_MONT_CTX_set()
223 if (bn_expand(Ri, (int)sizeof(BN_ULONG) * 2) == NULL) { in BN_MONT_CTX_set()
227 Ri->neg = 0; in BN_MONT_CTX_set()
228 Ri->d[0] = BN_MASK2; in BN_MONT_CTX_set()
229 Ri->d[1] = BN_MASK2; in BN_MONT_CTX_set()
230 Ri->top = 2; in BN_MONT_CTX_set()
233 if (!BN_div(Ri, NULL, Ri, &tmod, ctx)) { in BN_MONT_CTX_set()
238 mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0; in BN_MONT_CTX_set()
239 mont->n0[1] = (Ri->top > 1) ? Ri->d[1] : 0; in BN_MONT_CTX_set()
250 if (BN_mod_inverse(Ri, R, &tmod, ctx) == NULL) { in BN_MONT_CTX_set()
253 if (!BN_lshift(Ri, Ri, BN_BITS2)) { in BN_MONT_CTX_set()
256 if (!BN_is_zero(Ri)) { in BN_MONT_CTX_set()
257 if (!BN_sub_word(Ri, 1)) { in BN_MONT_CTX_set()
262 if (!BN_set_word(Ri, BN_MASK2)) { in BN_MONT_CTX_set()
266 if (!BN_div(Ri, NULL, Ri, &tmod, ctx)) { in BN_MONT_CTX_set()
271 mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0; in BN_MONT_CTX_set()