From: mohanson Date: Thu, 24 Jul 2025 07:20:54 +0000 (+0000) Subject: crypto/elliptic: change a variable name that have the same name as keywords X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4c854b7a3e5fc3e84a06511bce71ce01cbb4bb33;p=gostls13.git crypto/elliptic: change a variable name that have the same name as keywords Change the variable name from byte to b, and use range over int to simplify the loop. Change-Id: I8855053c26ce798311f12505cd5edf21d7caf1f5 GitHub-Last-Rev: 70c80545df29c897ea81f115334fcc64503c0eb1 GitHub-Pull-Request: golang/go#74736 Reviewed-on: https://go-review.googlesource.com/c/go/+/690135 Reviewed-by: qiu laidongfeng <2645477756@qq.com> LUCI-TryBot-Result: Go LUCI Reviewed-by: Roland Shoemaker Reviewed-by: Michael Knyszek --- diff --git a/src/crypto/elliptic/params.go b/src/crypto/elliptic/params.go index 0507d22b27..8cf9a6dc40 100644 --- a/src/crypto/elliptic/params.go +++ b/src/crypto/elliptic/params.go @@ -295,13 +295,13 @@ func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big. Bz := new(big.Int).SetInt64(1) x, y, z := new(big.Int), new(big.Int), new(big.Int) - for _, byte := range k { - for bitNum := 0; bitNum < 8; bitNum++ { + for _, b := range k { + for range 8 { x, y, z = curve.doubleJacobian(x, y, z) - if byte&0x80 == 0x80 { + if b&0x80 == 0x80 { x, y, z = curve.addJacobian(Bx, By, Bz, x, y, z) } - byte <<= 1 + b <<= 1 } }