Unverified Commit 2b32a36d authored by adam's avatar adam

incorporates code review comments from @raulk; changes KeyPairFromKey to...

incorporates code review comments from @raulk; changes KeyPairFromKey to KeyPairFromStdKey and improves godoc.
parent 23811ec0
......@@ -11,8 +11,8 @@ import (
"golang.org/x/crypto/ed25519"
)
// KeyPairFromKey generates a new private and public key from an input private key
func KeyPairFromKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) {
// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys
func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) {
if priv == nil {
return nil, nil, ErrNilPrivateKey
}
......
......@@ -13,8 +13,8 @@ import (
"golang.org/x/crypto/ed25519"
)
// KeyPairFromKey generates a new private and public key from an input private key
func KeyPairFromKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) {
// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys
func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) {
if priv == nil {
return nil, nil, ErrNilPrivateKey
}
......
......@@ -90,7 +90,7 @@ func TestKeyPairFromKey(t *testing.T) {
},
} {
t.Run(fmt.Sprintf("%v", i), func(t *testing.T) {
priv, pub, err := KeyPairFromKey(tt.in)
priv, pub, err := KeyPairFromStdKey(tt.in)
if err != nil {
t.Fatal(err)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment