You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
check that the public keys lie on the curve.? #271
hello, tell me how to check that the public keys lie on the curve.?
and how to check that after the operation of multiplication I left the border of the curve?
and how to check that after the operation of multiplication I left the border of the curve?
if a point was on the curve before multiplication, then the result will be on the curve...
You can double check that on high level, by exporting the point to a byte string and then create a new VerifyingKey instance, that will verify if it is on curve still.
On low level, you need to get the CurveFp() and call contains_point() for short Weierstrass curves:
Activity
tomato42 commentedon Nov 27, 2021
All the public methods in VerifyingKey check if the public key lies on the curve, it's controlled by the
validate_pointoption like:python-ecdsa/src/ecdsa/keys.py
Lines 202 to 204 in b3b27cd
or:
python-ecdsa/src/ecdsa/keys.py
Lines 286 to 293 in b3b27cd
if a point was on the curve before multiplication, then the result will be on the curve...
You can double check that on high level, by exporting the point to a byte string and then create a new VerifyingKey instance, that will verify if it is on curve still.
On low level, you need to get the
CurveFp()and callcontains_point()for short Weierstrass curves:python-ecdsa/src/ecdsa/ellipticcurve.py
Line 131 in b3b27cd
or the
contains_point()ofCurveEdTw()for twisted Edwards curves:python-ecdsa/src/ecdsa/ellipticcurve.py
Line 197 in b3b27cd