• Home
  • Raw
  • Download

Lines Matching refs:mod

478 			const u64 *mod, unsigned int ndigits)  in vli_mod_add()  argument
487 if (carry || vli_cmp(result, mod, ndigits) >= 0) in vli_mod_add()
488 vli_sub(result, result, mod, ndigits); in vli_mod_add()
495 const u64 *mod, unsigned int ndigits) in vli_mod_sub() argument
504 vli_add(result, result, mod, ndigits); in vli_mod_sub()
517 const u64 *mod, unsigned int ndigits) in vli_mmod_special() argument
519 u64 c = -mod[0]; in vli_mmod_special()
529 vli_set(t, mod, ndigits); in vli_mmod_special()
551 const u64 *mod, unsigned int ndigits) in vli_mmod_special2() argument
553 u64 c2 = mod[0] * 2; in vli_mmod_special2()
560 vli_set(m, mod, ndigits); in vli_mmod_special2()
575 vli_uadd(qc, qc, mod[0], ndigits * 2); in vli_mmod_special2()
599 static void vli_mmod_slow(u64 *result, u64 *product, const u64 *mod, in vli_mmod_slow() argument
608 int shift = (ndigits * 2 * 64) - vli_num_bits(mod, ndigits); in vli_mmod_slow()
615 mod_m[word_shift + i] = (mod[i] << bit_shift) | carry; in vli_mmod_slow()
616 carry = mod[i] >> (64 - bit_shift); in vli_mmod_slow()
619 vli_set(mod_m + word_shift, mod, ndigits); in vli_mmod_slow()
649 static void vli_mmod_barrett(u64 *result, u64 *product, const u64 *mod, in vli_mmod_barrett() argument
654 const u64 *mu = mod + ndigits; in vli_mmod_barrett()
659 vli_mult(r, mod, q + ndigits, ndigits); in vli_mmod_barrett()
662 vli_cmp(r, mod, ndigits) != -1) { in vli_mmod_barrett()
665 carry = vli_sub(r, r, mod, ndigits); in vli_mmod_barrett()
824 const u64 *mod, unsigned int ndigits) in vli_mod_mult_slow() argument
829 vli_mmod_slow(result, product, mod, ndigits); in vli_mod_mult_slow()
858 void vli_mod_inv(u64 *result, const u64 *input, const u64 *mod, in vli_mod_inv() argument
872 vli_set(b, mod, ndigits); in vli_mod_inv()
884 carry = vli_add(u, u, mod, ndigits); in vli_mod_inv()
893 carry = vli_add(v, v, mod, ndigits); in vli_mod_inv()
903 vli_add(u, u, mod, ndigits); in vli_mod_inv()
907 carry = vli_add(u, u, mod, ndigits); in vli_mod_inv()
917 vli_add(v, v, mod, ndigits); in vli_mod_inv()
921 carry = vli_add(v, v, mod, ndigits); in vli_mod_inv()