]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/elliptic: change a variable name that have the same name as keywords
authormohanson <mohanson@outlook.com>
Thu, 24 Jul 2025 07:20:54 +0000 (07:20 +0000)
committerJorropo <jorropo.pgm@gmail.com>
Tue, 29 Jul 2025 11:30:34 +0000 (04:30 -0700)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/crypto/elliptic/params.go

index 0507d22b277f7bfa4908bd5a06117a9423b9d3bd..8cf9a6dc400bad972720026b3ef2325b19a08686 100644 (file)
@@ -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
                }
        }