From 862a639cffa8cadac44f6b27c3d0180b64f26383 Mon Sep 17 00:00:00 2001 From: tavit ohanian Date: Wed, 11 Aug 2021 15:44:56 -0400 Subject: [PATCH] initial port --- crypto/fixture_test.go | 2 +- crypto/key.go | 4 ++-- crypto/key_not_openssl.go | 6 +++--- crypto/key_openssl.go | 6 +++--- crypto/rsa_common.go | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crypto/fixture_test.go b/crypto/fixture_test.go index 8cec7c5..8245c30 100644 --- a/crypto/fixture_test.go +++ b/crypto/fixture_test.go @@ -12,7 +12,7 @@ import ( crypto_pb "gitlab.dms3.io/p2p/go-p2p-core/crypto/pb" ) -var message = []byte("Libp2p is the _best_!") +var message = []byte("P2p is the _best_!") type testCase struct { keyType crypto_pb.KeyType diff --git a/crypto/key.go b/crypto/key.go index 5fa0a90..c5f8e49 100644 --- a/crypto/key.go +++ b/crypto/key.go @@ -1,4 +1,4 @@ -// Package crypto implements various cryptographic utilities used by libp2p. +// Package crypto implements various cryptographic utilities used by p2p. // This includes a Public and Private key interface and key implementations // for supported key algorithms. package crypto @@ -77,7 +77,7 @@ type Key interface { Equals(Key) bool // Raw returns the raw bytes of the key (not wrapped in the - // libp2p-crypto protobuf). + // p2p-crypto protobuf). // // This function is the inverse of {Priv,Pub}KeyUnmarshaler. Raw() ([]byte, error) diff --git a/crypto/key_not_openssl.go b/crypto/key_not_openssl.go index 1499fea..82f6c78 100644 --- a/crypto/key_not_openssl.go +++ b/crypto/key_not_openssl.go @@ -11,7 +11,7 @@ import ( btcec "github.com/btcsuite/btcd/btcec" ) -// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys +// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in p2p/go-p2p-core/crypto keys func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { if priv == nil { return nil, nil, ErrNilPrivateKey @@ -39,7 +39,7 @@ func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { } } -// PrivKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) private keys +// PrivKeyToStdKey converts p2p/go-p2p-core/crypto private keys to standard library (and secp256k1) private keys func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { if priv == nil { return nil, ErrNilPrivateKey @@ -59,7 +59,7 @@ func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { } } -// PubKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) public keys +// PubKeyToStdKey converts p2p/go-p2p-core/crypto private keys to standard library (and secp256k1) public keys func PubKeyToStdKey(pub PubKey) (crypto.PublicKey, error) { if pub == nil { return nil, ErrNilPublicKey diff --git a/crypto/key_openssl.go b/crypto/key_openssl.go index 198f0d5..df6c83e 100644 --- a/crypto/key_openssl.go +++ b/crypto/key_openssl.go @@ -13,7 +13,7 @@ import ( openssl "gitlab.dms3.io/p2p/go-openssl" ) -// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys +// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in p2p/go-p2p-core/crypto keys func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { if priv == nil { return nil, nil, ErrNilPrivateKey @@ -46,7 +46,7 @@ func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { } } -// PrivKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) private keys +// PrivKeyToStdKey converts p2p/go-p2p-core/crypto private keys to standard library (and secp256k1) private keys func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { if priv == nil { return nil, ErrNilPrivateKey @@ -69,7 +69,7 @@ func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { } } -// PubKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) public keys +// PubKeyToStdKey converts p2p/go-p2p-core/crypto private keys to standard library (and secp256k1) public keys func PubKeyToStdKey(pub PubKey) (crypto.PublicKey, error) { if pub == nil { return nil, ErrNilPublicKey diff --git a/crypto/rsa_common.go b/crypto/rsa_common.go index c7e3054..b44f2d3 100644 --- a/crypto/rsa_common.go +++ b/crypto/rsa_common.go @@ -8,7 +8,7 @@ import ( // WeakRsaKeyEnv is an environment variable which, when set, lowers the // minimum required bits of RSA keys to 512. This should be used exclusively in // test situations. -const WeakRsaKeyEnv = "LIBP2P_ALLOW_WEAK_RSA_KEYS" +const WeakRsaKeyEnv = "P2P_ALLOW_WEAK_RSA_KEYS" var MinRsaKeyBits = 2048 -- GitLab