Skip to content

Commit 0816432

Browse files
committed
math/big: fix misuse of Unicode
ˆ (U+02C6) is a circumflex accent, not an exponentiation operator. In the rest of the source code for this package, exponentation is written as **, so do the same here. Change-Id: I107b85be242ab79d152eb8a6fcf3ca2b197d7658 Reviewed-on: https://go-review.googlesource.com/17671 Reviewed-by: Robert Griesemer <[email protected]>
1 parent 251e500 commit 0816432

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/math/big/nat.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ func (z nat) expNNMontgomery(x, y, m nat) nat {
10621062
x = rr
10631063

10641064
// Ideally the precomputations would be performed outside, and reused
1065-
// k0 = --1 mod 2ˆ_W. Algorithm from: Dumas, J.G. "On Newton–Raphson
1065+
// k0 = -m**-1 mod 2**_W. Algorithm from: Dumas, J.G. "On Newton–Raphson
10661066
// Iteration for Multiplicative Inverses Modulo Prime Powers".
10671067
k0 := 2 - m[0]
10681068
t := m[0] - 1
@@ -1072,7 +1072,7 @@ func (z nat) expNNMontgomery(x, y, m nat) nat {
10721072
}
10731073
k0 = -k0
10741074

1075-
// RR = (2*_W*len(m)) mod m
1075+
// RR = 2**(2*_W*len(m)) mod m
10761076
RR = RR.setWord(1)
10771077
zz = zz.shl(RR, uint(2*numWords*_W))
10781078
_, RR = RR.div(RR, zz, m)

0 commit comments

Comments
 (0)