File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 2
2
import warnings
3
3
from cryptography .hazmat .primitives .asymmetric import ec , ed25519
4
4
from cryptography .hazmat .primitives import serialization , hashes
5
+ from cryptography .hazmat .primitives .asymmetric import utils as asym_utils
5
6
from cryptography .exceptions import InvalidSignature
6
7
from hiero_sdk_python .hapi .services .basic_types_pb2 import Key
7
8
from hiero_sdk_python .crypto .public_key import PublicKey
9
+ from hiero_sdk_python .utils .crypto_utils import keccak256
8
10
9
11
pytestmark = pytest .mark .unit
10
12
@@ -529,7 +531,8 @@ def test_verify_ecdsa_success(ecdsa_keypair):
529
531
pk = PublicKey (pub )
530
532
531
533
msg = b"some message"
532
- signature = priv .sign (msg , ec .ECDSA (hashes .SHA256 ()))
534
+ msg_hash = keccak256 (msg )
535
+ signature = priv .sign (msg_hash , ec .ECDSA (asym_utils .Prehashed (hashes .SHA256 ())))
533
536
# If the signature is correct, verify() returns None and raises no error.
534
537
pk .verify (signature , msg )
535
538
You can’t perform that action at this time.
0 commit comments