def test_sign_verify(self, sk_ilp, vk_ilp): message = b'Hello World!' sk = SigningKey(sk_ilp['b58']) vk = VerifyingKey(vk_ilp['b58']) assert vk.verify(message, sk.sign(message)) is True assert vk.verify(message, sk.sign(message + b'dummy')) is False assert vk.verify(message + b'dummy', sk.sign(message)) is False vk = VerifyingKey(vk_ilp[2]['b64'], encoding='base64') assert vk.verify(message, sk.sign(message)) is False
def test_generate_sign_verify(self, vk_ilp): sk_b58, vk_b58 = ed25519_generate_key_pair() sk = SigningKey(sk_b58) vk = VerifyingKey(vk_b58) message = b'Hello World!' assert vk.verify(message, sk.sign(message)) is True assert vk.verify(message, sk.sign(message + b'dummy')) is False assert vk.verify(message + b'dummy', sk.sign(message)) is False vk = VerifyingKey(vk_ilp[2]['b64'], encoding='base64') assert vk.verify(message, sk.sign(message)) is False
def test_sign_verify(self, sk_ilp, vk_ilp): message = 'Hello World!' sk = SigningKey(sk_ilp['b58']) vk = VerifyingKey(vk_ilp['b58']) assert vk.verify(message, sk.sign(message)) is True assert vk.verify(message, sk.sign(message + 'dummy')) is False assert vk.verify(message + 'dummy', sk.sign(message)) is False vk = VerifyingKey( VerifyingKey.encode( base64_add_padding(vk_ilp[2]['b64']))) assert vk.verify(message, sk.sign(message)) is False