diff --git a/btcec/privkey.go b/btcec/privkey.go index 438323e65f..fb21bdb6bb 100644 --- a/btcec/privkey.go +++ b/btcec/privkey.go @@ -6,6 +6,7 @@ package btcec import ( "crypto/ecdsa" + "crypto/elliptic" "crypto/rand" "math/big" ) @@ -17,7 +18,7 @@ type PrivateKey ecdsa.PrivateKey // PrivKeyFromBytes returns a private and public key for `curve' based on the // private key passed as an argument as a byte slice. -func PrivKeyFromBytes(curve *KoblitzCurve, pk []byte) (*PrivateKey, +func PrivKeyFromBytes(curve elliptic.Curve, pk []byte) (*PrivateKey, *PublicKey) { x, y := curve.ScalarBaseMult(pk) @@ -35,7 +36,7 @@ func PrivKeyFromBytes(curve *KoblitzCurve, pk []byte) (*PrivateKey, // NewPrivateKey is a wrapper for ecdsa.GenerateKey that returns a PrivateKey // instead of the normal ecdsa.PrivateKey. -func NewPrivateKey(curve *KoblitzCurve) (*PrivateKey, error) { +func NewPrivateKey(curve elliptic.Curve) (*PrivateKey, error) { key, err := ecdsa.GenerateKey(curve, rand.Reader) if err != nil { return nil, err