Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-core
Commits
862a639c
Commit
862a639c
authored
Aug 11, 2021
by
tavit ohanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial port
parent
ba620770
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
crypto/fixture_test.go
crypto/fixture_test.go
+1
-1
crypto/key.go
crypto/key.go
+2
-2
crypto/key_not_openssl.go
crypto/key_not_openssl.go
+3
-3
crypto/key_openssl.go
crypto/key_openssl.go
+3
-3
crypto/rsa_common.go
crypto/rsa_common.go
+1
-1
No files found.
crypto/fixture_test.go
View file @
862a639c
...
...
@@ -12,7 +12,7 @@ import (
crypto_pb
"gitlab.dms3.io/p2p/go-p2p-core/crypto/pb"
)
var
message
=
[]
byte
(
"
Libp
2p is the _best_!"
)
var
message
=
[]
byte
(
"
P
2p is the _best_!"
)
type
testCase
struct
{
keyType
crypto_pb
.
KeyType
...
...
crypto/key.go
View file @
862a639c
// Package crypto implements various cryptographic utilities used by
lib
p2p.
// 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
//
lib
p2p-crypto protobuf).
// p2p-crypto protobuf).
//
// This function is the inverse of {Priv,Pub}KeyUnmarshaler.
Raw
()
([]
byte
,
error
)
...
...
crypto/key_not_openssl.go
View file @
862a639c
...
...
@@ -11,7 +11,7 @@ import (
btcec
"github.com/btcsuite/btcd/btcec"
)
// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in
lib
p2p/go-
lib
p2p-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
lib
p2p/go-
lib
p2p-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
lib
p2p/go-
lib
p2p-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
...
...
crypto/key_openssl.go
View file @
862a639c
...
...
@@ -13,7 +13,7 @@ import (
openssl
"gitlab.dms3.io/p2p/go-openssl"
)
// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in
lib
p2p/go-
lib
p2p-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
lib
p2p/go-
lib
p2p-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
lib
p2p/go-
lib
p2p-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
...
...
crypto/rsa_common.go
View file @
862a639c
...
...
@@ -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
=
"
LIB
P2P_ALLOW_WEAK_RSA_KEYS"
const
WeakRsaKeyEnv
=
"P2P_ALLOW_WEAK_RSA_KEYS"
var
MinRsaKeyBits
=
2048
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment