From 04ad8a7826f7aa3a9b3439ef85b66329784ceda5 Mon Sep 17 00:00:00 2001 From: Hanjun Kim Date: Thu, 16 Apr 2020 00:20:56 +0900 Subject: [PATCH 1/2] btcec: set curve name in CurveParams Set curve name(secp256k1) in KoblitzCurve.CurveParams Fixes #1564 --- btcec/btcec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/btcec/btcec.go b/btcec/btcec.go index de93a255a4..6000c479df 100644 --- a/btcec/btcec.go +++ b/btcec/btcec.go @@ -930,6 +930,7 @@ func initS256() { secp256k1.Gx = fromHex("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798") secp256k1.Gy = fromHex("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8") secp256k1.BitSize = 256 + secp256k1.Name = "secp256k1" secp256k1.q = new(big.Int).Div(new(big.Int).Add(secp256k1.P, big.NewInt(1)), big.NewInt(4)) secp256k1.H = 1 From 684e1f404c6aec7957bf2781e7048d60996143f8 Mon Sep 17 00:00:00 2001 From: Hanjun Kim Date: Sat, 18 Jul 2020 18:42:01 +0900 Subject: [PATCH 2/2] btcec: add a comment indicating where curve name taken from Related with #1565 --- btcec/btcec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/btcec/btcec.go b/btcec/btcec.go index 6000c479df..a2e20f4b31 100644 --- a/btcec/btcec.go +++ b/btcec/btcec.go @@ -930,6 +930,7 @@ func initS256() { secp256k1.Gx = fromHex("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798") secp256k1.Gy = fromHex("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8") secp256k1.BitSize = 256 + // Curve name taken from https://safecurves.cr.yp.to/. secp256k1.Name = "secp256k1" secp256k1.q = new(big.Int).Div(new(big.Int).Add(secp256k1.P, big.NewInt(1)), big.NewInt(4))