This repository has been archived by the owner on Dec 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate abstractions and core types into go-libp2p-core (#60)
- Loading branch information
Showing
38 changed files
with
338 additions
and
2,692 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
Oops, something went wrong.