From d6e712a075fd8ae552b931afdb926ffbee1f1092 Mon Sep 17 00:00:00 2001 From: Viktor Dragomiretskyy Date: Sat, 1 Aug 2020 22:07:57 +1200 Subject: [PATCH] Infer a point on a curve from the private part. --- validitysensor/tls.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/validitysensor/tls.py b/validitysensor/tls.py index d61b161..f21a3fb 100644 --- a/validitysensor/tls.py +++ b/validitysensor/tls.py @@ -520,11 +520,11 @@ class Tls(): self.trace('y=0x%x' % y) self.trace('d=0x%x' % d) - # Someone has reported that x and y are 0 after pairing with the latest windows driver, - # for compatibility we could derive x and y with a following call: - #ec.derive_private_key(d, ec.SECP256R1(), backend=crypto_backend) + # Someone has reported that x and y are 0 after pairing with the latest windows driver. + #pub_key = ec.EllipticCurvePublicNumbers(x, y, ec.SECP256R1()) + #self.priv_key = ec.EllipticCurvePrivateNumbers(d, pub_key).private_key(crypto_backend) + + self.priv_key = ec.derive_private_key(d, ec.SECP256R1(), backend=crypto_backend) - pub_key = ec.EllipticCurvePublicNumbers(x, y, ec.SECP256R1()) - self.priv_key = ec.EllipticCurvePrivateNumbers(d, pub_key).private_key(crypto_backend) tls = Tls(usb)