Lines Matching defs:mod
1214 * Returns the modInverse of this mod p. This and p are not affected by
1236 // Calculate 1/a mod oddMod
1239 // Calculate 1/a mod evenMod
1261 * Calculate the multiplicative inverse of this mod 2^k.
1293 * Returns the multiplicative inverse of val mod 2^32. Assumes val is odd.
1306 * Calculate the multiplicative inverse of 2^k mod mod, where mod is odd.
1308 static MutableBigInteger modInverseBP2(MutableBigInteger mod, int k) {
1309 // Copy the mod to protect original
1310 return fixup(new MutableBigInteger(1), new MutableBigInteger(mod), k);
1314 * Calculate the multiplicative inverse of this mod mod, where mod is odd.
1315 * This and mod are not changed by the calculation.
1322 private MutableBigInteger modInverse(MutableBigInteger mod) {
1323 MutableBigInteger p = new MutableBigInteger(mod);
1342 // If gcd(f, g) != 1, number is not invertible modulo mod
1352 // If f == g (mod 4)
1357 } else { // If f != g (mod 4)
1377 * Calculates X such that X = C * 2^(-k) (mod P)
1383 // Set r to the multiplicative inverse of p mod 2^32
1387 // V = R * c (mod 2^j)
1397 // V = R * c (mod 2^j)
1416 * mod a modulus that is a power of 2. The modulus is 2^k.
1421 MutableBigInteger mod = new MutableBigInteger(b);
1473 mod.subtract(t1);
1474 return mod;