Skip to content

Commit

Permalink
make argument check log more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
TilmanNeumann committed Jan 3, 2025
1 parent 6ba39a4 commit f54d8b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public String getName() {
@Override
public BigInteger findSingleFactor(BigInteger N) {
if (N.bitLength() > 31) { // this check should be negligible in terms of performance
throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but PollardRho31 only supports arguments <= 31 bit");
throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but " + getName() + " only supports arguments <= 31 bit");
}
int factorInt = findSingleFactor(N.intValue());
return BigInteger.valueOf(factorInt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String getName() {
@Override
public BigInteger findSingleFactor(BigInteger N) {
if (N.bitLength() > 31) { // this check should be negligible in terms of performance
throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but PollardRho31 only supports arguments <= 31 bit");
throw new IllegalArgumentException("N = " + N + " has " + N.bitLength() + " bit, but " + getName() + " only supports arguments <= 31 bit");
}
int factorInt = findSingleFactor(N.intValue());
return BigInteger.valueOf(factorInt);
Expand Down

0 comments on commit f54d8b3

Please sign in to comment.