Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pss/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ func (pssapi *API) BaseAddr() (PssAddress, error) {
// Retrieves the node's public key in hex form
func (pssapi *API) GetPublicKey() (keybytes hexutil.Bytes) {
key := pssapi.Pss.PublicKey()
keybytes = pssapi.Pss.Crypto.FromECDSAPub(key)
keybytes = pssapi.Pss.Crypto.SerializePublicKey(key)
return keybytes
}

// Set Public key to associate with a particular Pss peer
func (pssapi *API) SetPeerPublicKey(pubkey hexutil.Bytes, topic Topic, addr PssAddress) error {
pk, err := pssapi.Pss.Crypto.UnmarshalPubkey(pubkey)
pk, err := pssapi.Pss.Crypto.UnmarshalPublicKey(pubkey)
if err != nil {
return fmt.Errorf("Cannot unmarshal pubkey: %x", pubkey)
}
Expand Down
12 changes: 2 additions & 10 deletions pss/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"time"

"github.com/ethereum/go-ethereum/common/hexutil"
ethCrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
Expand All @@ -45,7 +46,6 @@ type protoCtrl struct {
}

var (
cryptoUtils pss.CryptoUtils
// custom logging
psslogmain log.Logger
pssprotocols map[string]*protoCtrl
Expand All @@ -62,8 +62,6 @@ func init() {

psslogmain = log.New("psslog", "*")

cryptoUtils = pss.NewCryptoUtils()

pssprotocols = make(map[string]*protoCtrl)
}

Expand Down Expand Up @@ -231,13 +229,7 @@ func newServices() adapters.Services {
}
return adapters.Services{
"pss": func(ctx *adapters.ServiceContext) (node.Service, error) {
ctxlocal, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
keys, err := cryptoUtils.NewKeyPair(ctxlocal)
if err != nil {
return nil, err
}
privkey, err := cryptoUtils.GetPrivateKey(keys)
privkey, err := ethCrypto.GenerateKey()
if err != nil {
return nil, err
}
Expand Down
104 changes: 0 additions & 104 deletions pss/crypto.go

This file was deleted.

Loading