diff options
| author | mohanson <mohanson@outlook.com> | 2025-07-24 07:20:54 +0000 |
|---|---|---|
| committer | Jorropo <jorropo.pgm@gmail.com> | 2025-07-29 04:30:34 -0700 |
| commit | 4c854b7a3e5fc3e84a06511bce71ce01cbb4bb33 (patch) | |
| tree | 743fb4b33022e9571bb1e40bd4a0f5b05002c44e /src/crypto | |
| parent | b10eb1d042cb10031ad6d1b61bf7509501d62c81 (diff) | |
| download | go-4c854b7a3e5fc3e84a06511bce71ce01cbb4bb33.tar.xz | |
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/crypto')
| -rw-r--r-- | src/crypto/elliptic/params.go | 8 |
1 files changed, 4 insertions, 4 deletions
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 } } |
