diff --git a/crypto/key_not_openssl.go b/crypto/key_not_openssl.go index 9b85aef..ae8b01f 100644 --- a/crypto/key_not_openssl.go +++ b/crypto/key_not_openssl.go @@ -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 } diff --git a/crypto/key_openssl.go b/crypto/key_openssl.go index 3eae98b..4545492 100644 --- a/crypto/key_openssl.go +++ b/crypto/key_openssl.go @@ -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 } diff --git a/crypto/key_test.go b/crypto/key_test.go index 470d067..aff2bad 100644 --- a/crypto/key_test.go +++ b/crypto/key_test.go @@ -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) }