Skip to content

Commit

Permalink
Update factor_qs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
teschlg committed Jan 14, 2025
1 parent 9c1c55d commit ded12ba
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kryptools/factor_qs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def factor_qs(n: int, verbose: int = 0) -> int | None:
ls = legendre_symbol(n, p)
if ls == 0: # we already found a factor;-)
if verbose > 1:
print("\nFound a small prime factor.")
if n == p:
return n
print("\nFactor base contains a factor.")
return p
if ls == 1: # we only take primes such that n is quadratic residue
factorbase.append(p)
Expand Down

0 comments on commit ded12ba

Please sign in to comment.