Пример #1
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
Пример #2
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)
Пример #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
Пример #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)
Пример #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)
Пример #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)
Пример #7
0
def test_key_gen():
    """ Tests the key generation of ECDSA"""
    from Lab01Code import ecdsa_key_gen
    G, priv, pub = ecdsa_key_gen()
Пример #8
0
def test_key_gen():
    """ Tests the key generation of ECDSA"""
    from Lab01Code import ecdsa_key_gen
    G, priv, pub = ecdsa_key_gen()