diff --git a/src/crypto/internal/edwards25519/scalarmult.go b/src/crypto/internal/edwards25519/scalarmult.go index f7ca3cef993..3992dc90828 100644 --- a/src/crypto/internal/edwards25519/scalarmult.go +++ b/src/crypto/internal/edwards25519/scalarmult.go @@ -167,8 +167,8 @@ func (v *Point) VarTimeDoubleScalarBaseMult(a *Scalar, A *Point, b *Scalar) *Poi // Find the first nonzero coefficient. i := 255 - for j := i; j >= 0; j-- { - if aNaf[j] != 0 || bNaf[j] != 0 { + for ; i >= 0; i-- { + if aNaf[i] != 0 || bNaf[i] != 0 { break } }