def test_twice_signature_verification(self): alice = Account() message = b"Test" signature = alice.sign(message) signing_key = alice.identity_keys["ed25519"] assert signature assert signing_key ed25519_verify(signing_key, message, signature) assert signature == alice.sign(message) ed25519_verify(signing_key, message, signature)
def test_signature_verification_twice(self): message = "It's a secret to everybody" alice = Account() signature = alice.sign(message) signing_key = alice.identity_keys["ed25519"] assert signature assert signing_key ed25519_verify(signing_key, message, signature) assert signature == alice.sign(message) ed25519_verify(signing_key, message, signature) assert signature == alice.sign(message)
def test_valid_signature(self, message): alice = Account() signature = alice.sign(message) signing_key = alice.identity_keys["ed25519"] assert signature assert signing_key ed25519_verify(signing_key, message, signature)
def test_invalid_signature(self, message): alice = Account() bob = Account() signature = alice.sign(message) signing_key = bob.identity_keys["ed25519"] assert signature assert signing_key with pytest.raises(OlmVerifyError): ed25519_verify(signing_key, message, signature)