Skip to content

Commit

Permalink
Replace *KoblitzCurve by elliptic.Curve
Browse files Browse the repository at this point in the history
Found via github.com/mvdan/interfacer.
  • Loading branch information
mvdan committed Jan 3, 2016
1 parent 14ccab8 commit 829e87a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions btcec/privkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package btcec

import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"math/big"
)
Expand All @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 829e87a

Please sign in to comment.