crypto: add btcec fallback for sign/recover without cgo (#3680)

* vendor: add github.com/btcsuite/btcd/btcec

* crypto: add btcec fallback for sign/recover without cgo

This commit adds a non-cgo fallback implementation of secp256k1
operations.

* crypto, core/vm: remove wrappers for sha256, ripemd160
This commit is contained in:
Felix Lange
2017-02-18 09:24:12 +01:00
committed by Jeffrey Wilcke
parent bf21549faa
commit 9b0af51386
32 changed files with 3929 additions and 224 deletions

View File

@ -42,11 +42,11 @@ import (
"fmt"
"hash"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
)
var (
DefaultCurve = secp256k1.S256()
DefaultCurve = ethcrypto.S256()
ErrUnsupportedECDHAlgorithm = fmt.Errorf("ecies: unsupported ECDH algorithm")
ErrUnsupportedECIESParameters = fmt.Errorf("ecies: unsupported ECIES parameters")
)
@ -100,7 +100,7 @@ var (
)
var paramsFromCurve = map[elliptic.Curve]*ECIESParams{
secp256k1.S256(): ECIES_AES128_SHA256,
ethcrypto.S256(): ECIES_AES128_SHA256,
elliptic.P256(): ECIES_AES128_SHA256,
elliptic.P384(): ECIES_AES256_SHA384,
elliptic.P521(): ECIES_AES256_SHA512,