Skip to content

Commit e933ed1

Browse files
authored
fix: Value Error in examples/keys_private_ecdsa.py script (#353)
* fix: invalid dre hex representation in keys_private_ecdsa.py Signed-off-by: Manish Dait <[email protected]> * updated CHANGELOG.md Signed-off-by: Manish Dait <[email protected]> * fix changelog.md Signed-off-by: Manish Dait <[email protected]> --------- Signed-off-by: Manish Dait <[email protected]>
1 parent 934baf1 commit e933ed1

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
4343
- Type annotations in TokenRelationship class (kyc_status and freeze_status)
4444
- Test assertions in test_executable.py using pytest match parameter
4545
- Moved and renamed README_upstream.md to docs/sdk_developers/rebasing.md
46-
47-
### Fixed
46+
- Invalid DRE Hex representation in examples/keys_private_ecdsa.py
4847
- Windows malformed path using uv run generate_proto.py using as_posix()
4948
- Changed README MIT license to Apache
5049

examples/keys_private_ecdsa.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def example_generate_ecdsa() -> None:
1414
# 1) Generate ECDSA
1515
privkey = PrivateKey.generate("ecdsa")
1616
print("Generated ECDSA PrivateKey (hex) =", privkey)
17-
17+
1818
# 2) Get the public key
1919
pubkey = privkey.public_key()
2020
print("Derived public key =", pubkey)
@@ -66,7 +66,7 @@ def example_load_ecdsa_from_hex() -> None:
6666
print("=== ECDSA: Load from Hex ===")
6767
# 32-byte scalar in hex. Must not be zero; example:
6868
ecdsa_hex = "abcdef0000000000000000000000000000000000000000000000000000000001"
69-
69+
7070
# 1) Generate ECDSA
7171
privkey = PrivateKey.from_string_ecdsa(ecdsa_hex)
7272
print("Loaded ECDSA PrivateKey from hex =", privkey)
@@ -93,10 +93,10 @@ def example_load_ecdsa_der() -> None:
9393
# Example TraditionalOpenSSL DER-encoded key (for scalar=1).
9494
# (Truncated for demonstration)
9595
der_hex = (
96-
"304e02010104"
97-
"200100000000000000000000000000000000000000000000000000000000000000"
98-
"a00706052b8104000aa1440342000479be667ef9dcbbac55a06295ce870b07029bfcdb"
99-
"2dce28d959f2815b16f8179842a2f1423fc2440aeddc92f8cd3dfff65d61b2334fa1dafc519e6b9f3"
96+
"30740201010"
97+
"4200000000000000000000000000000000000000000000000000000000000000001"
98+
"a00706052b8104000aa1440342000479be667ef9dcbbac55a06295ce870b07029bfc"
99+
"db2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
100100
)
101101

102102
# 1) Generate DER

0 commit comments

Comments
 (0)