From c4b4d05e695c7926baa8f3776f91349d0ef76daf Mon Sep 17 00:00:00 2001 From: zhiqiangxu <652732310@qq.com> Date: Tue, 9 Jul 2024 19:19:25 +0800 Subject: [PATCH] crypto: remove hardcoded value for secp256k1.N (#30126) --- crypto/crypto.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/crypto.go b/crypto/crypto.go index 7f7171f730..aaa5cc43a2 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -45,7 +45,7 @@ const RecoveryIDOffset = 64 const DigestLength = 32 var ( - secp256k1N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16) + secp256k1N = S256().Params().N secp256k1halfN = new(big.Int).Div(secp256k1N, big.NewInt(2)) )