diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-09-30 01:37:44 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-11-30 20:43:32 +0800 |
commit | c8ad64f33cd04fc10ac6681260ea06e464908c91 (patch) | |
tree | bd48055c50b57e2b17ca0bde4e9e5ae9ba7ca5ce /crypto/key.go | |
parent | 27a50c8f4bc69f98e20db361859bfbb6cf371c00 (diff) | |
download | dexon-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.gz dexon-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.zst dexon-c8ad64f33cd04fc10ac6681260ea06e464908c91.zip |
crypto, crypto/ecies, crypto/secp256k1: libsecp256k1 scalar mult
thanks to Felix Lange (fjl) for help with design & impl
Diffstat (limited to 'crypto/key.go')
-rw-r--r-- | crypto/key.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/key.go b/crypto/key.go index 4ec43dfd7..ccf284ad8 100644 --- a/crypto/key.go +++ b/crypto/key.go @@ -25,6 +25,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/pborman/uuid" ) @@ -137,7 +138,7 @@ func NewKey(rand io.Reader) *Key { panic("key generation: could not read from random source: " + err.Error()) } reader := bytes.NewReader(randBytes) - privateKeyECDSA, err := ecdsa.GenerateKey(S256(), reader) + privateKeyECDSA, err := ecdsa.GenerateKey(secp256k1.S256(), reader) if err != nil { panic("key generation: ecdsa.GenerateKey failed: " + err.Error()) } @@ -155,7 +156,7 @@ func NewKeyForDirectICAP(rand io.Reader) *Key { panic("key generation: could not read from random source: " + err.Error()) } reader := bytes.NewReader(randBytes) - privateKeyECDSA, err := ecdsa.GenerateKey(S256(), reader) + privateKeyECDSA, err := ecdsa.GenerateKey(secp256k1.S256(), reader) if err != nil { panic("key generation: ecdsa.GenerateKey failed: " + err.Error()) } |