The pell equation solver sometimes outputs wrong solutions, for example:
def test_pell_equation(d, m):
gen, sols = pell_solve(d, m)
assert gen[0]**2 - d*gen[1]**2 == 1
for sol in sols:
assert sol[0]**2 - d*sol[1]**2 == m
test_pell_equation(34, 4)
fails.
A comparison with reference Karabina, Teske (2017): "On prime-order elliptic curves with embedding degrees k = 3, 4 and 6" shows, that a sqrt() is missing.
This pull requests proposes a bugfix and also includes a test for confirming the issue.
The pell equation solver sometimes outputs wrong solutions, for example:
fails.
A comparison with reference Karabina, Teske (2017): "On prime-order elliptic curves with embedding degrees k = 3, 4 and 6" shows, that a sqrt() is missing.
This pull requests proposes a bugfix and also includes a test for confirming the issue.