Update ed25519.py
Don't hash data passed to nacl library in Ed25519PublicKey.verify
This commit is contained in:
parent
2efc072ad9
commit
0a9f8d23a3
|
@ -24,9 +24,8 @@ class Ed25519PublicKey(PublicKey):
|
||||||
|
|
||||||
def verify(self, data: bytes, signature: bytes) -> bool:
|
def verify(self, data: bytes, signature: bytes) -> bool:
|
||||||
verify_key = VerifyKey(self.to_bytes())
|
verify_key = VerifyKey(self.to_bytes())
|
||||||
h = SHA256.new(data)
|
|
||||||
try:
|
try:
|
||||||
verify_key.verify(h, signature)
|
verify_key.verify(data, signature)
|
||||||
except BadSignatureError:
|
except BadSignatureError:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user