-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove depricated elliptic.Marshal function
- Loading branch information
1 parent
272ca6c
commit f8dee19
Showing
3 changed files
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,11 @@ func encryptKey(k *ecdsa.PrivateKey, password string, edg keystore.EDG) ([]byte, | |
} | ||
addr = a | ||
case elliptic.P256(): | ||
This comment has been minimized.
Sorry, something went wrong.
gacevicljubisa
Author
Contributor
|
||
addr = elliptic.Marshal(elliptic.P256(), k.PublicKey.X, k.PublicKey.Y) | ||
privKey, err := k.ECDH() | ||
if err != nil { | ||
return nil, fmt.Errorf("generate key: %w", err) | ||
} | ||
addr = privKey.PublicKey().Bytes() | ||
default: | ||
return nil, fmt.Errorf("unsupported curve: %v", k.PublicKey.Curve) | ||
} | ||
|
Reason for this is that in
go-ethereum/crypto
package is using next code to obtain bytes from ecdsa.PublicKey:This is the PR used for this changes in
go-ethereum
ethereum/go-ethereum#28946