From 0a9f8d23a376b29da1c5c83590513883974d7d3e Mon Sep 17 00:00:00 2001 From: Wolfgang Deutsch Date: Tue, 16 Mar 2021 08:55:44 +0100 Subject: [PATCH] Update ed25519.py Don't hash data passed to nacl library in Ed25519PublicKey.verify --- libp2p/crypto/ed25519.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libp2p/crypto/ed25519.py b/libp2p/crypto/ed25519.py index 11a1668..00c7658 100644 --- a/libp2p/crypto/ed25519.py +++ b/libp2p/crypto/ed25519.py @@ -24,9 +24,8 @@ class Ed25519PublicKey(PublicKey): def verify(self, data: bytes, signature: bytes) -> bool: verify_key = VerifyKey(self.to_bytes()) - h = SHA256.new(data) try: - verify_key.verify(h, signature) + verify_key.verify(data, signature) except BadSignatureError: return False return True