aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/elliptic/elliptic.go
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2019-01-23 19:12:46 -0500
committerFilippo Valsorda <filippo@golang.org>2019-01-23 19:12:46 -0500
commit4b76b996cb0ad7ba015b53c932e7f0cc4933da77 (patch)
treeb0a44524841098b76bbc018bd17a72f9118b51b1 /src/crypto/elliptic/elliptic.go
parent8b246fe0f5950315035944868b0523e6d75d1171 (diff)
parentb0cb374daf646454998bac7b393f3236a2ab6aca (diff)
downloadgo-4b76b996cb0ad7ba015b53c932e7f0cc4933da77.tar.gz
go-4b76b996cb0ad7ba015b53c932e7f0cc4933da77.zip
[dev.boringcrypto.go1.10] all: merge go1.10.8 into dev.boringcrypto.go1.10dev.boringcrypto.go1.10
Change-Id: Iba5a8ddb67cfd119cf05274be79b840862009b4d
Diffstat (limited to 'src/crypto/elliptic/elliptic.go')
-rw-r--r--src/crypto/elliptic/elliptic.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crypto/elliptic/elliptic.go b/src/crypto/elliptic/elliptic.go
index 35aacf24e5..76b78a790e 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)