mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network: Clarify comment about privatekey generation data
This commit is contained in:
parent
d2ad11c940
commit
b2540215b5
1 changed files with 2 additions and 2 deletions
|
|
@ -329,9 +329,9 @@ func init() {
|
|||
}
|
||||
|
||||
// derive a private key for swarm for the node key
|
||||
// returns the private key used to generate the bzz key AND the generated bzz key
|
||||
// returns the private key used to generate the bzz key
|
||||
func BzzKeyFromConfig(conf *adapters.NodeConfig) (*ecdsa.PrivateKey, error) {
|
||||
// ecdsa.GenerateKey takes 40 bytes entropy
|
||||
// pad the seed key some arbitrary data as ecdsa.GenerateKey takes 40 bytes seed data
|
||||
privKeyBuf := append(crypto.FromECDSA(conf.PrivateKey), []byte{0x62, 0x7a, 0x7a, 0x62, 0x7a, 0x7a, 0x62, 0x7a}...)
|
||||
bzzPrivateKey, err := ecdsa.GenerateKey(crypto.S256(), bytes.NewReader(privKeyBuf))
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue