From 829e87a733ddd013bdec130cdddb4663d8c454f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 3 Jan 2016 13:40:26 +0100 Subject: [PATCH] Replace *KoblitzCurve by elliptic.Curve Found via github.com/mvdan/interfacer. --- btcec/privkey.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/btcec/privkey.go b/btcec/privkey.go index 438323e6..fb21bdb6 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