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: 70c80545df
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>
This commit is contained in:
mohanson 2025-07-24 07:20:54 +00:00 committed by Jorropo
parent b10eb1d042
commit 4c854b7a3e

View 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
}
}