Skip to content

Commit

Permalink
Merge pull request #94 from libp2p/feat/std-ed25519
Browse files Browse the repository at this point in the history
use standard library "crypto/ed25519"
  • Loading branch information
Stebalien authored Dec 7, 2019
2 parents 9e4f261 + 4fe7924 commit bdeb1bf
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions core/crypto/ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions core/crypto/ed25519_test.go
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/key_not_openssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/key_openssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
Expand All @@ -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) {
Expand Down

0 comments on commit bdeb1bf

Please sign in to comment.