Skip to content

Commit

Permalink
wip: unsupported curve error
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol committed Jan 15, 2024
1 parent 0939ba6 commit 1ca4da7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ func NewEthereumAddress(p ecdsa.PublicKey) ([]byte, error) {
if p.X == nil || p.Y == nil {
return nil, errors.New("invalid public key")
}
pubBytes, _ := p.ECDH()
pubHash, err := LegacyKeccak256(pubBytes.Bytes()[1:])
pk, err := p.ECDH()
if err != nil {
return nil, fmt.Errorf("to ECDH: %w", err)
}
pubBytes := pk.Bytes()
pubHash, err := LegacyKeccak256(pubBytes[1:])
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1ca4da7

Please sign in to comment.