| \n | def from_public_point( | \n
| \n | cls, point, curve=NIST192p, hashfunc=sha1, validate_point=True | \n
| \n | ): | \n
\n python-ecdsa/src/ecdsa/keys.py\n
\n\n Lines 286 to 293\n in\n b3b27cd\n
\n| \n | def from_string( | \n
| \n | cls, | \n
| \n | string, | \n
| \n | curve=NIST192p, | \n
| \n | hashfunc=sha1, | \n
| \n | validate_point=True, | \n
| \n | valid_encodings=None, | \n
| \n | ): | \n
\n\nand how to check that after the operation of multiplication I left the border of the curve?
\n
if a point was on the curve before multiplication, then the result will be on the curve...
\nYou 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.
\nOn low level, you need to get the CurveFp() and call contains_point() for short Weierstrass curves:
\n
\n python-ecdsa/src/ecdsa/ellipticcurve.py\n
\n\n Line 131\n in\n b3b27cd\n
\n| \n | def contains_point(self, x, y): | \n
contains_point() of CurveEdTw() for twisted Edwards curves:\n python-ecdsa/src/ecdsa/ellipticcurve.py\n
\n\n Line 197\n in\n b3b27cd\n
\n| \n | def contains_point(self, x, y): | \n
-
|
hello, tell me how to check that the public keys lie on the curve.? |
Beta Was this translation helpful? Give feedback.
-
|
All the public methods in VerifyingKey check if the public key lies on the curve, it's controlled by the 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 python-ecdsa/src/ecdsa/ellipticcurve.py Line 131 in b3b27cd or the contains_point() of CurveEdTw() for twisted Edwards curves:python-ecdsa/src/ecdsa/ellipticcurve.py Line 197 in b3b27cd |
Beta Was this translation helpful? Give feedback.
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…