Replace *KoblitzCurve by elliptic.Curve
Found via github.com/mvdan/interfacer.
This commit is contained in:
parent
14ccab80e7
commit
829e87a733
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue