Skip to content

Commit 822ebdc

Browse files
committed
investigated potential issue, comment result
1 parent f525999 commit 822ebdc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/de/tilman_neumann/jml/factor/ecm/EllipticCurveMethod.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,8 +1698,14 @@ void ModInvBigNbr(int[] a, int[] b, int[] inv) {
16981698
if (i < 0 || B[i] < CalcAuxModInvMu[i]) { // If B < Mu
16991699
SubtractBigNbr32(CalcAuxModInvMu, B, CalcAuxModInvMu); // Mu <- Mu - B
17001700
}
1701-
// XXX Convert32To31Bits() does not work for negative inputs!
1701+
// It doesn't matter here that Convert32To31Bits() does not work for negative inputs, because CalcAuxModInvMu is always positive
17021702
Convert32To31Bits(CalcAuxModInvMu, inv, NumberLength);
1703+
if (DEBUG) {
1704+
BigInteger inv32 = BigIntToBigNbr(CalcAuxModInvMu);
1705+
Ensure.ensureGreater(inv32.signum(), 0);
1706+
BigInteger inv31 = BigIntToBigNbr(inv);
1707+
Ensure.ensureEquals(inv32, inv31);
1708+
}
17031709
}
17041710

17051711
BigInteger BigIntToBigNbr(int[] nbr) {

0 commit comments

Comments
 (0)