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])
def test_verify_success(self): base_key = BaseKey() data = os.urandom(200) signature = base_key.sign(data) assert base_key.verify(signature, data)
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)
def test_verify_failure(self): base_key = BaseKey() signature = base_key.sign(PUBLIC_KEY_COMPRESSED) assert not base_key.verify(signature, PUBLIC_KEY_UNCOMPRESSED)
def test_verify_success(self): base_key = BaseKey() signature = base_key.sign(PUBLIC_KEY_COMPRESSED) assert base_key.verify(signature, PUBLIC_KEY_COMPRESSED)
def test_sign(self): base_key = BaseKey() signature = base_key.sign(PUBLIC_KEY_COMPRESSED) public_key = base_key._pk.public_key() assert public_key.verify(signature, PUBLIC_KEY_COMPRESSED, ECDSA_SHA256)