Lines Matching refs:mod
516 const u64 *mod, unsigned int ndigits) in vli_mod_add() argument
525 if (carry || vli_cmp(result, mod, ndigits) >= 0) in vli_mod_add()
526 vli_sub(result, result, mod, ndigits); in vli_mod_add()
533 const u64 *mod, unsigned int ndigits) in vli_mod_sub() argument
542 vli_add(result, result, mod, ndigits); in vli_mod_sub()
555 const u64 *mod, unsigned int ndigits) in vli_mmod_special() argument
557 u64 c = -mod[0]; in vli_mmod_special()
567 vli_set(t, mod, ndigits); in vli_mmod_special()
589 const u64 *mod, unsigned int ndigits) in vli_mmod_special2() argument
591 u64 c2 = mod[0] * 2; in vli_mmod_special2()
598 vli_set(m, mod, ndigits); in vli_mmod_special2()
613 vli_uadd(qc, qc, mod[0], ndigits * 2); in vli_mmod_special2()
637 static void vli_mmod_slow(u64 *result, u64 *product, const u64 *mod, in vli_mmod_slow() argument
646 int shift = (ndigits * 2 * 64) - vli_num_bits(mod, ndigits); in vli_mmod_slow()
653 mod_m[word_shift + i] = (mod[i] << bit_shift) | carry; in vli_mmod_slow()
654 carry = mod[i] >> (64 - bit_shift); in vli_mmod_slow()
657 vli_set(mod_m + word_shift, mod, ndigits); in vli_mmod_slow()
687 static void vli_mmod_barrett(u64 *result, u64 *product, const u64 *mod, in vli_mmod_barrett() argument
692 const u64 *mu = mod + ndigits; in vli_mmod_barrett()
697 vli_mult(r, mod, q + ndigits, ndigits); in vli_mmod_barrett()
700 vli_cmp(r, mod, ndigits) != -1) { in vli_mmod_barrett()
703 carry = vli_sub(r, r, mod, ndigits); in vli_mmod_barrett()
1005 const u64 *mod, unsigned int ndigits) in vli_mod_mult_slow() argument
1010 vli_mmod_slow(result, product, mod, ndigits); in vli_mod_mult_slow()
1039 void vli_mod_inv(u64 *result, const u64 *input, const u64 *mod, in vli_mod_inv() argument
1053 vli_set(b, mod, ndigits); in vli_mod_inv()
1065 carry = vli_add(u, u, mod, ndigits); in vli_mod_inv()
1074 carry = vli_add(v, v, mod, ndigits); in vli_mod_inv()
1084 vli_add(u, u, mod, ndigits); in vli_mod_inv()
1088 carry = vli_add(u, u, mod, ndigits); in vli_mod_inv()
1098 vli_add(v, v, mod, ndigits); in vli_mod_inv()
1102 carry = vli_add(v, v, mod, ndigits); in vli_mod_inv()