aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/secp256k1/secp256.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-15 09:29:52 +0800
committerobscuren <geffobscura@gmail.com>2015-02-15 09:29:52 +0800
commitc924a841c7a6661b3a609c16c447231f5ae951c8 (patch)
tree77b94bb5393e86d663813bef9b2699532d3a1972 /crypto/secp256k1/secp256.go
parent12fc590b34fba3391799fbdfd66ef029f7a551f4 (diff)
parent7299eb72e0c57d8bf7279cbf2544c266a3fd145b (diff)
downloaddexon-c924a841c7a6661b3a609c16c447231f5ae951c8.tar
dexon-c924a841c7a6661b3a609c16c447231f5ae951c8.tar.gz
dexon-c924a841c7a6661b3a609c16c447231f5ae951c8.tar.bz2
dexon-c924a841c7a6661b3a609c16c447231f5ae951c8.tar.lz
dexon-c924a841c7a6661b3a609c16c447231f5ae951c8.tar.xz
dexon-c924a841c7a6661b3a609c16c447231f5ae951c8.tar.zst
dexon-c924a841c7a6661b3a609c16c447231f5ae951c8.zip
Merge branch 'develop' into bounty
Diffstat (limited to 'crypto/secp256k1/secp256.go')
-rw-r--r--crypto/secp256k1/secp256.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/secp256k1/secp256.go b/crypto/secp256k1/secp256.go
index c1e37629e..4864e8d09 100644
--- a/crypto/secp256k1/secp256.go
+++ b/crypto/secp256k1/secp256.go
@@ -15,8 +15,9 @@ import "C"
import (
"bytes"
"errors"
- "github.com/ethereum/go-ethereum/crypto/randentropy"
"unsafe"
+
+ "github.com/ethereum/go-ethereum/crypto/randentropy"
)
//#define USE_FIELD_5X64
@@ -85,6 +86,10 @@ func GenerateKeyPair() ([]byte, []byte) {
}
func GeneratePubKey(seckey []byte) ([]byte, error) {
+ if err := VerifySeckeyValidity(seckey); err != nil {
+ return nil, err
+ }
+
pubkey_len := C.int(65)
const seckey_len = 32