mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-04 15:17:02 +00:00
removed cgo dependency, go-ed25519 -> agl/ed25519
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/tendermint/tendermint/config"
|
||||
. "github.com/tendermint/tendermint/consensus/types"
|
||||
|
||||
"github.com/tendermint/go-ed25519"
|
||||
"github.com/tendermint/ed25519"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -56,10 +56,11 @@ type PrivValidator struct {
|
||||
|
||||
// Generates a new validator with private key.
|
||||
func GenPrivValidator() *PrivValidator {
|
||||
privKeyBytes := CRandBytes(32)
|
||||
pubKeyBytes := ed25519.MakePubKey(privKeyBytes)
|
||||
pubKey := account.PubKeyEd25519(pubKeyBytes)
|
||||
privKey := account.PrivKeyEd25519(privKeyBytes)
|
||||
privKeyBytes := new([64]byte)
|
||||
copy(privKeyBytes[:32], CRandBytes(32))
|
||||
pubKeyBytes := ed25519.MakePublicKey(privKeyBytes)
|
||||
pubKey := account.PubKeyEd25519(pubKeyBytes[:])
|
||||
privKey := account.PrivKeyEd25519(privKeyBytes[:])
|
||||
return &PrivValidator{
|
||||
Address: pubKey.Address(),
|
||||
PubKey: pubKey,
|
||||
|
||||
Reference in New Issue
Block a user