Browse Source

Use standard library "crypto/ed25519"

pull/1683/head
Dmitry Yu Okunev 5 years ago
committed by Steven Allen
parent
commit
4fe79248eb
  1. 3
      core/crypto/ed25519.go
  2. 3
      core/crypto/ed25519_test.go
  3. 2
      core/crypto/key_not_openssl.go
  4. 2
      core/crypto/key_openssl.go
  5. 2
      core/crypto/key_test.go

3
core/crypto/ed25519.go

@ -2,14 +2,13 @@ package crypto
import (
"bytes"
"crypto/ed25519"
"crypto/subtle"
"errors"
"fmt"
"io"
pb "github.com/libp2p/go-libp2p-core/crypto/pb"
"golang.org/x/crypto/ed25519"
)
// Ed25519PrivateKey is an ed25519 private key.

3
core/crypto/ed25519_test.go

@ -1,12 +1,11 @@
package crypto
import (
"crypto/ed25519"
"crypto/rand"
"testing"
pb "github.com/libp2p/go-libp2p-core/crypto/pb"
"golang.org/x/crypto/ed25519"
)
func TestBasicSignAndVerify(t *testing.T) {

2
core/crypto/key_not_openssl.go

@ -5,10 +5,10 @@ package crypto
import (
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rsa"
btcec "github.com/btcsuite/btcd/btcec"
"golang.org/x/crypto/ed25519"
)
// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys

2
core/crypto/key_openssl.go

@ -5,12 +5,12 @@ package crypto
import (
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rsa"
"crypto/x509"
btcec "github.com/btcsuite/btcd/btcec"
openssl "github.com/libp2p/go-openssl"
"golang.org/x/crypto/ed25519"
)
// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys

2
core/crypto/key_test.go

@ -4,6 +4,7 @@ import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
@ -15,7 +16,6 @@ import (
pb "github.com/libp2p/go-libp2p-core/crypto/pb"
"github.com/libp2p/go-libp2p-core/test"
sha256 "github.com/minio/sha256-simd"
"golang.org/x/crypto/ed25519"
)
func TestKeys(t *testing.T) {

Loading…
Cancel
Save