aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDavid Huie <dahuie@gmail.com>2018-04-03 23:12:00 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-04-03 23:12:00 +0800
commitd1af4e1a9eae903514dc6e0afd665218a90a19bf (patch)
treec9cc424982c1e931a4f12d7e8badacbf49bda9e6 /crypto
parent6cdfb9a3ebd03dc8864d1038e70430045da665f4 (diff)
downloadgo-tangerine-d1af4e1a9eae903514dc6e0afd665218a90a19bf.tar
go-tangerine-d1af4e1a9eae903514dc6e0afd665218a90a19bf.tar.gz
go-tangerine-d1af4e1a9eae903514dc6e0afd665218a90a19bf.tar.bz2
go-tangerine-d1af4e1a9eae903514dc6e0afd665218a90a19bf.tar.lz
go-tangerine-d1af4e1a9eae903514dc6e0afd665218a90a19bf.tar.xz
go-tangerine-d1af4e1a9eae903514dc6e0afd665218a90a19bf.tar.zst
go-tangerine-d1af4e1a9eae903514dc6e0afd665218a90a19bf.zip
crypto/secp256k1: catch curve parameter parse errors (#16392)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/secp256k1/curve.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/secp256k1/curve.go b/crypto/secp256k1/curve.go
index df8048185..f51be5e35 100644
--- a/crypto/secp256k1/curve.go
+++ b/crypto/secp256k1/curve.go
@@ -290,11 +290,11 @@ func init() {
// See SEC 2 section 2.7.1
// curve parameters taken from:
// http://www.secg.org/collateral/sec2_final.pdf
- theCurve.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16)
- theCurve.N, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 16)
- theCurve.B, _ = new(big.Int).SetString("0000000000000000000000000000000000000000000000000000000000000007", 16)
- theCurve.Gx, _ = new(big.Int).SetString("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", 16)
- theCurve.Gy, _ = new(big.Int).SetString("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", 16)
+ theCurve.P = math.MustParseBig256("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F")
+ theCurve.N = math.MustParseBig256("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141")
+ theCurve.B = math.MustParseBig256("0x0000000000000000000000000000000000000000000000000000000000000007")
+ theCurve.Gx = math.MustParseBig256("0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798")
+ theCurve.Gy = math.MustParseBig256("0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8")
theCurve.BitSize = 256
}