Skip to content
\n
\n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n
def from_public_point(
cls, point, curve=NIST192p, hashfunc=sha1, validate_point=True
):
\n
\n
\n
\nor:
\n
\n
\n

\n python-ecdsa/src/ecdsa/keys.py\n

\n

\n Lines 286 to 293\n in\n b3b27cd\n

\n
\n
\n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n
def from_string(
cls,
string,
curve=NIST192p,
hashfunc=sha1,
validate_point=True,
valid_encodings=None,
):
\n
\n
\n

\n
\n

and how to check that after the operation of multiplication I left the border of the curve?

\n
\n

if a point was on the curve before multiplication, then the result will be on the curve...

\n

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.

\n

On low level, you need to get the CurveFp() and call contains_point() for short Weierstrass curves:
\n

\n
\n

\n python-ecdsa/src/ecdsa/ellipticcurve.py\n

\n

\n Line 131\n in\n b3b27cd\n

\n
\n
\n \n\n \n \n \n \n
def contains_point(self, x, y):
\n
\n
\n
\nor the contains_point() of CurveEdTw() for twisted Edwards curves:
\n
\n
\n

\n python-ecdsa/src/ecdsa/ellipticcurve.py\n

\n

\n Line 197\n in\n b3b27cd\n

\n
\n
\n \n\n \n \n \n \n
def contains_point(self, x, y):
\n
\n
\n

","upvoteCount":1,"url":"https://github.com/tlsfuzzer/python-ecdsa/discussions/274#discussioncomment-1709093"}}}
Discussion options

You must be logged in to vote

All the public methods in VerifyingKey check if the public key lies on the curve, it's controlled by the validate_point option like:

def from_public_point(
cls, point, curve=NIST192p, hashfunc=sha1, validate_point=True
):

or:
def from_string(
cls,
string,
curve=NIST192p,
hashfunc=sha1,
validate_point=True,
valid_encodings=None,
):

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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tomato42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #271 on November 27, 2021 13:11.