Skip to content

Commit

Permalink
fix: remove direct import of cgo-library
Browse files Browse the repository at this point in the history
  • Loading branch information
fanbsb committed Sep 13, 2023
1 parent 4b10a2f commit 414535e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions p2p/discover/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (

"github.com/FusionFoundation/efsn/v5/common"
"github.com/FusionFoundation/efsn/v5/crypto"
"github.com/FusionFoundation/efsn/v5/crypto/secp256k1"
)

const NodeIDBits = 512
Expand Down Expand Up @@ -334,7 +333,7 @@ func (id NodeID) Pubkey() (*ecdsa.PublicKey, error) {
// recoverNodeID computes the public key used to sign the
// given hash from the signature.
func recoverNodeID(hash, sig []byte) (id NodeID, err error) {
pubkey, err := secp256k1.RecoverPubkey(hash, sig)
pubkey, err := crypto.Ecrecover(hash, sig)
if err != nil {
return id, err
}
Expand Down
3 changes: 1 addition & 2 deletions p2p/rlpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (

"github.com/FusionFoundation/efsn/v5/crypto"
"github.com/FusionFoundation/efsn/v5/crypto/ecies"
"github.com/FusionFoundation/efsn/v5/crypto/secp256k1"
"github.com/FusionFoundation/efsn/v5/p2p/discover"
"github.com/FusionFoundation/efsn/v5/rlp"
"github.com/golang/snappy"
Expand Down Expand Up @@ -407,7 +406,7 @@ func (h *encHandshake) handleAuthMsg(msg *authMsgV4, prv *ecdsa.PrivateKey) erro
return err
}
signedMsg := xor(token, h.initNonce)
remoteRandomPub, err := secp256k1.RecoverPubkey(signedMsg, msg.Signature[:])
remoteRandomPub, err := crypto.Ecrecover(signedMsg, msg.Signature[:])
if err != nil {
return err
}
Expand Down

0 comments on commit 414535e

Please sign in to comment.