-
-
Notifications
You must be signed in to change notification settings - Fork 2
Remove ecdsa dependency, use cryptography only II #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e0b0f49 to
ecd81f3
Compare
a9c7320 to
16c914e
Compare
| def test_secp256r1_derivation_retry(): | ||
| # Test retry in public key to public key derivation | ||
| # https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-derivation-retry-for-nist256p1 | ||
| chaincode, pubkey = SLIP10.from_seed( | ||
| bytes.fromhex(SEED_1), curve_name="secp256r1" | ||
| ).get_extended_pubkey_from_path("m/28578'") | ||
| chaincode, pubkey = SLIP10( | ||
| chaincode, pubkey=pubkey, curve_name="secp256r1" | ||
| ).get_extended_pubkey_from_path("m/33941") | ||
| assert ( | ||
| chaincode.hex() | ||
| == "9e87fe95031f14736774cd82f25fd885065cb7c358c1edf813c72af535e83071" | ||
| ) | ||
| assert ( | ||
| pubkey.hex() | ||
| == "0235bfee614c0d5b2cae260000bb1d0d84b270099ad790022c1ae0b2e782efe120" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, although ideally we should have a test that takes the path in each test vector, converts it to a list _deriv_path_str_to_list(path) and counts how many indices at the end are non-hardened. Then it should derive the node up to the last hardened index using get_child_from_path() and from there derive using only public keys. Basically the above test but automated. (Doesn't need to be done in this PR.)
b649486 to
0b8fb05
Compare
This replaces #2. Unlike that, I've tried to use the cryptography package as much as possible.