Added ECDH tests.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-02-14 11:25:02 +01:00
parent 79d86a335c
commit 407110def4
3 changed files with 58 additions and 1 deletions

View File

@@ -335,9 +335,13 @@ class Device:
data += c.finalize()
p1 = self.get_first_free_id()
resp = self.send(cla=0x80, command=0x74, p1=p1, p2=0x93, data=data)
_ = self.send(cla=0x80, command=0x74, p1=p1, p2=0x93, data=data)
return p1
def exchange(self, keyid, pubkey):
resp = self.send(cla=0x80, command=0x62, p1=keyid, p2=Algorithm.ALGO_EC_DH.value, data=pubkey.public_bytes(Encoding.X962, PublicFormat.UncompressedPoint))
return resp
@pytest.fixture(scope="session")
def device():