Example #1
0
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)
Example #2
0
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
Example #3
0
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
Example #4
0
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)
Example #5
0
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)
Example #6
0
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)