Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError when multiplying the generator with the order of the curve #54

Closed
ghost opened this issue Jun 27, 2020 · 2 comments
Closed

Comments

@ghost
Copy link

ghost commented Jun 27, 2020

Multiplying the generator with the order of the curve gives a ValueError:

$ python -c 'from fastecdsa.curve import secp256k1; secp256k1.q * secp256k1.G'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/bbralf/brainbot-com/venv/lib64/python3.8/site-packages/fastecdsa/point.py", line 163, in __rmul__
    return self.__mul__(scalar)
  File "/home/bbralf/brainbot-com/venv/lib64/python3.8/site-packages/fastecdsa/point.py", line 150, in __mul__
    return Point(int(x), int(y), self.curve)
  File "/home/bbralf/brainbot-com/venv/lib64/python3.8/site-packages/fastecdsa/point.py", line 33, in __init__
    raise ValueError(
ValueError: coordinates are not on curve <secp256k1>
        x=0
        y=0
AntonKueltz added a commit that referenced this issue Jun 30, 2020
AntonKueltz added a commit that referenced this issue Jun 30, 2020
@AntonKueltz
Copy link
Owner

Good catch, v2.1.2 broke this when it fixed the C extension's handling of the point at infinity. (The joys of Weierstrass curves, this is why the Montgomery curves like Curve25519 are better for implementors and more resistant to side channels). Fixed in commit a591b79 (version v2.1.3).

~ pip install fastecdsa==2.1.3
Collecting fastecdsa==2.1.3
  Using cached fastecdsa-2.1.3-cp38-cp38-macosx_10_14_x86_64.whl (53 kB)
Installing collected packages: fastecdsa
Successfully installed fastecdsa-2.1.3
➜  ~ python -c 'from fastecdsa.curve import secp256k1; secp256k1.q * secp256k1.G'~

@ghost
Copy link
Author

ghost commented Jun 30, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant