aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/secp256k1
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2017-02-18 16:24:12 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2017-02-18 16:24:12 +0800
commit9b0af513867fad4aeb3516e4711dd0ea4f5bc90c (patch)
treeb37d808d57873c6aec550431534e26602dfd0475 /crypto/secp256k1
parentbf21549faa7de6e2b920855468b14856c6f503c4 (diff)
downloadgo-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar
go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.gz
go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.bz2
go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.lz
go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.xz
go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.tar.zst
go-tangerine-9b0af513867fad4aeb3516e4711dd0ea4f5bc90c.zip
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
Diffstat (limited to 'crypto/secp256k1')
-rw-r--r--crypto/secp256k1/secp256.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/crypto/secp256k1/secp256.go b/crypto/secp256k1/secp256.go
index 4284115e2..1a152a670 100644
--- a/crypto/secp256k1/secp256.go
+++ b/crypto/secp256k1/secp256.go
@@ -42,17 +42,9 @@ import (
"unsafe"
)
-var (
- context *C.secp256k1_context
- N *big.Int
- HalfN *big.Int
-)
+var context *C.secp256k1_context
func init() {
- N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
- // N / 2 == 57896044618658097711785492504343953926418782139537452191302581570759080747168
- HalfN, _ = new(big.Int).SetString("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0", 16)
-
// around 20 ms on a modern CPU.
context = C.secp256k1_context_create_sign_verify()
C.secp256k1_context_set_illegal_callback(context, C.callbackFunc(C.secp256k1GoPanicIllegal), nil)