Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Consolidate abstractions and core types into go-libp2p-core (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed May 23, 2019
1 parent f419582 commit ddb6d72
Show file tree
Hide file tree
Showing 38 changed files with 338 additions and 2,692 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

84 changes: 0 additions & 84 deletions bench_test.go

This file was deleted.

186 changes: 0 additions & 186 deletions ecdsa.go

This file was deleted.

64 changes: 64 additions & 0 deletions ecdsa_deprecated.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package crypto

import (
"crypto/ecdsa"
"crypto/elliptic"
"io"

core "github.com/libp2p/go-libp2p-core/crypto"
)

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ECDSAPrivateKey instead.
type ECDSAPrivateKey = core.ECDSAPrivateKey

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ECDSAPublicKey instead.
type ECDSAPublicKey = core.ECDSAPublicKey

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ECDSASig instead.
type ECDSASig = core.ECDSASig

var (
// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ErrNotECDSAPubKey instead.
ErrNotECDSAPubKey = core.ErrNotECDSAPubKey
// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ErrNilSig instead.
ErrNilSig = core.ErrNilSig
// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ErrNilPrivateKey instead.
ErrNilPrivateKey = core.ErrNilPrivateKey
// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ECDSACurve instead.
ECDSACurve = core.ECDSACurve
)

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.GenerateECDSAKeyPair instead.
func GenerateECDSAKeyPair(src io.Reader) (PrivKey, PubKey, error) {
return core.GenerateECDSAKeyPair(src)
}

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.GenerateECDSAKeyPairWithCurve instead.
func GenerateECDSAKeyPairWithCurve(curve elliptic.Curve, src io.Reader) (PrivKey, PubKey, error) {
return core.GenerateECDSAKeyPairWithCurve(curve, src)
}

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.ECDSAKeyPairFromKey instead.
func ECDSAKeyPairFromKey(priv *ecdsa.PrivateKey) (PrivKey, PubKey, error) {
return core.ECDSAKeyPairFromKey(priv)
}

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.MarshalECDSAPrivateKey instead.
func MarshalECDSAPrivateKey(ePriv ECDSAPrivateKey) ([]byte, error) {
return core.MarshalECDSAPrivateKey(ePriv)
}

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.MarshalECDSAPublicKey instead.
func MarshalECDSAPublicKey(ePub ECDSAPublicKey) ([]byte, error) {
return core.MarshalECDSAPublicKey(ePub)
}

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.UnmarshalECDSAPrivateKey instead.
func UnmarshalECDSAPrivateKey(data []byte) (PrivKey, error) {
return core.UnmarshalECDSAPrivateKey(data)
}

// Deprecated: use github.com/libp2p/go-libp2p-core/crypto.UnmarshalECDSAPublicKey instead.
func UnmarshalECDSAPublicKey(data []byte) (PubKey, error) {
return core.UnmarshalECDSAPublicKey(data)
}
Loading

0 comments on commit ddb6d72

Please sign in to comment.