Skip to content

Commit

Permalink
use PointJacobi for ECDH [test]
Browse files Browse the repository at this point in the history
this is a crude way to use the new features in python-ecdsa,
will need to be reworked later
  • Loading branch information
tomato42 committed Nov 16, 2019
1 parent 322f5ff commit 67c7764
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tlslite/utils/ecc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def decodeX962Point(data, curve=ecdsa.NIST256p):
bytelength = getPointByteSize(curve)
xCoord = bytesToNumber(parser.getFixBytes(bytelength))
yCoord = bytesToNumber(parser.getFixBytes(bytelength))
return ecdsa.ellipticcurve.Point(curve.curve, xCoord, yCoord)
assert curve.curve.contains_point(xCoord, yCoord)
return ecdsa.ellipticcurve.PointJacobi(curve.curve, xCoord, yCoord, 1)

def encodeX962Point(point):
"""Encode a point in X9.62 format"""
Expand Down

0 comments on commit 67c7764

Please sign in to comment.