Lines Matching refs:bim
500 static comp modular_inverse(bigint *bim) in modular_inverse() argument
506 comp N = bim->comps[0]; in modular_inverse()
714 void bi_set_mod(BI_CTX *ctx, bigint *bim, int mod_offset) in bi_set_mod() argument
716 int k = bim->size; in bi_set_mod()
717 comp d = (comp)((long_comp)COMP_RADIX/(bim->comps[k-1]+1)); in bi_set_mod()
722 ctx->bi_mod[mod_offset] = bim; in bi_set_mod()
724 ctx->bi_normalised_mod[mod_offset] = bi_int_multiply(ctx, bim, d); in bi_set_mod()
1168 bigint *bim = ctx->bi_mod[mod_offset]; in bi_mont() local
1178 n = bim->size; in bi_mont()
1183 bi_int_multiply(ctx, bim, bixy->comps[i]*mod_inv), i)); in bi_mont()
1188 if (bi_compare(bixy, bim) >= 0) in bi_mont()
1190 bixy = bi_subtract(ctx, bixy, bim, NULL); in bi_mont()
1298 bigint *bim = ctx->bi_mod[mod_offset]; in bi_barrett() local
1299 int k = bim->size; in bi_barrett()
1302 check(bim); in bi_barrett()
1318 r2 = comp_mod(partial_multiply(ctx, q3, bim, k+1, 0), k+1); in bi_barrett()
1322 if (bi_compare(r, bim) >= 0) in bi_barrett()
1324 r = bi_subtract(ctx, r, bim, NULL); in bi_barrett()
1472 bigint *bi_mod_power2(BI_CTX *ctx, bigint *bi, bigint *bim, bigint *biexp) in bi_mod_power2() argument
1481 bi_set_mod(tmp_ctx, bi_clone(tmp_ctx, bim), BIGINT_M_OFFSET); in bi_mod_power2()
1491 bi_free(ctx, bim); in bi_mod_power2()