1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 01:18:28 +00:00

add asserts to debuglink tests

This commit is contained in:
Pavol Rusnak 2014-02-07 01:47:55 +01:00
parent 49cecb563d
commit 17e28c0e10
2 changed files with 4 additions and 4 deletions

View File

@ -11,15 +11,15 @@ class TestDebugLink(common.TrezorTest):
def test_layout(self):
layout = self.client.debuglink.read_layout()
print binascii.hexlify(layout)
self.assertEqual(len(layout), 1024)
def test_mnemonic(self):
mnemonic = self.client.debuglink.read_mnemonic()
print mnemonic
self.assertEqual(mnemonic, self.mnemonic1)
def test_node(self):
node = self.client.debuglink.read_node()
print node
self.assertIsNotNone(node)
if __name__ == '__main__':
unittest.main()

View File

@ -30,7 +30,7 @@ def sec_to_public_pair(pubkey):
curve = generator.curve()
p = curve.p()
alpha = (pow(x, 3, p) + curve.a() * x + curve.b()) % p
beta = ecdsa.number_theory.square_root_mod_prime(alpha, p)
beta = ecdsa.numbertheory.square_root_mod_prime(alpha, p)
if is_even == bool(beta & 1):
return (x, p - beta)
return (x, beta)