From f1e86e0fb35f9dd22b2d4f7abe43cfa10e653c09 Mon Sep 17 00:00:00 2001 From: Go Compiler Team Date: Sat, 13 Mar 2021 14:48:57 +0000 Subject: [PATCH] cve-2019-6486 Gbp-Pq: Name cve-2019-6486.patch --- src/crypto/elliptic/elliptic.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/elliptic/elliptic.go b/src/crypto/elliptic/elliptic.go index c02df45..337adff 100644 --- a/src/crypto/elliptic/elliptic.go +++ b/src/crypto/elliptic/elliptic.go @@ -210,8 +210,9 @@ func (curve *CurveParams) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int, x3 := new(big.Int).Mul(alpha, alpha) beta8 := new(big.Int).Lsh(beta, 3) + beta8.Mod(beta8, curve.P) x3.Sub(x3, beta8) - for x3.Sign() == -1 { + if x3.Sign() == -1 { x3.Add(x3, curve.P) } x3.Mod(x3, curve.P) -- 2.30.2