def test_produce_signature(): """ Tests signature function """ msg = u"Test" * 1000 from Lab01Code import ecdsa_key_gen, ecdsa_sign G, priv, pub = ecdsa_key_gen() sig = ecdsa_sign(G, priv, msg) assert True
def test_check_signature(): """ Tests signature and verification function """ msg = u"Test" * 1000 G, priv, pub = ecdsa_key_gen() sig = ecdsa_sign(G, priv, msg) assert ecdsa_verify(G, pub, msg, sig)
def test_check_fail(): """ Ensures verification fails when it should """ msg = u"Test" * 1000 msg2 = u"Text" * 1000 G, priv, pub = ecdsa_key_gen() sig = ecdsa_sign(G, priv, msg) assert not ecdsa_verify(G, pub, msg2, sig)
def test_key_gen(): """ Tests the key generation of ECDSA""" from Lab01Code import ecdsa_key_gen G, priv, pub = ecdsa_key_gen()