private void addShiftedByBitsSafe(LongArray other, int otherDegree, int bits) { int otherLen = (otherDegree + 63) >>> 6; int words = bits >>> 6; int shift = bits & 0x3F; if (shift == 0) { add(m_ints, words, other.m_ints, 0, otherLen); return; } long carry = addShiftedUp(m_ints, words, other.m_ints, 0, otherLen, shift); if (carry != 0L) { m_ints[otherLen + words] ^= carry; } }
private void addShiftedByBitsSafe(LongArray other, int otherDegree, int bits) { int otherLen = (otherDegree + 63) >>> 6; int words = bits >>> 6; int shift = bits & 0x3F; if (shift == 0) { add(m_ints, words, other.m_ints, 0, otherLen); return; } long carry = addShiftedUp(m_ints, words, other.m_ints, 0, otherLen, shift); if (carry != 0L) { m_ints[otherLen + words] ^= carry; } }
private static void multiplyWord(long a, long[] b, int bLen, long[] c, int cOff) { if ((a & 1L) != 0L) { add(c, cOff, b, 0, bLen); } int k = 1; while ((a >>>= 1) != 0L) { if ((a & 1L) != 0L) { long carry = addShiftedUp(c, cOff, b, 0, bLen, k); if (carry != 0L) { c[cOff + bLen] ^= carry; } } ++k; } }
private static void multiplyWord(long a, long[] b, int bLen, long[] c, int cOff) { if ((a & 1L) != 0L) { add(c, cOff, b, 0, bLen); } int k = 1; while ((a >>>= 1) != 0L) { if ((a & 1L) != 0L) { long carry = addShiftedUp(c, cOff, b, 0, bLen, k); if (carry != 0L) { c[cOff + bLen] ^= carry; } } ++k; } }
while ((cOff -= cLen) != 0) addShiftedUp(c, cOff - cLen, c, cOff, cLen, 8);
while ((cOff -= cLen) != 0) addShiftedUp(c, cOff - cLen, c, cOff, cLen, 8);
while ((cOff -= cLen) != 0) addShiftedUp(c, cOff - cLen, c, cOff, cLen, 8);
while ((cOff -= cLen) != 0) addShiftedUp(c, cOff - cLen, c, cOff, cLen, 8);
addShiftedUp(c, ci[ciPos >>> 1], c, ci[ciPos], cLen, positions);
addShiftedUp(c, ci[ciPos >>> 1], c, ci[ciPos], cLen, positions);