예제 #1
0
 def test_verify_success(self):
     base_key = BaseKey()
     data = os.urandom(200)
     signature = base_key.sign(data)
     assert base_key.verify(signature, data)
예제 #2
0
 def test_verify_failure(self):
     base_key = BaseKey()
     data = os.urandom(200)
     signature = base_key.sign(data)
     assert not base_key.verify(signature, data[::-1])
예제 #3
0
 def test_sign(self):
     base_key = BaseKey()
     data = os.urandom(200)
     signature = base_key.sign(data)
     assert verify_sig(signature, data, base_key.public_key)