1
0
mirror of https://github.com/golang/go synced 2024-11-18 04:14:49 -07:00

math/big: fix typo in documentation for Int.Exp

Fixes #38304

Also change `If m > 0, y < 0, ...` to `If m != 0, y < 0, ...` since `Exp` will return `nil`
whatever `m`'s sign is.

Change-Id: I17d7337ccd1404318cea5d42a8de904ad185fd00
GitHub-Last-Rev: 2399510300
GitHub-Pull-Request: golang/go#38390
Reviewed-on: https://go-review.googlesource.com/c/go/+/228000
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Hanjun Kim 2020-04-12 13:41:46 +00:00 committed by Robert Griesemer
parent 75f499e3a0
commit 5a447c0ae9

View File

@ -465,8 +465,8 @@ func (x *Int) TrailingZeroBits() uint {
}
// Exp sets z = x**y mod |m| (i.e. the sign of m is ignored), and returns z.
// If m == nil or m == 0, z = x**y unless y <= 0 then z = 1. If m > 0, y < 0,
// and x and n are not relatively prime, z is unchanged and nil is returned.
// If m == nil or m == 0, z = x**y unless y <= 0 then z = 1. If m != 0, y < 0,
// and x and m are not relatively prime, z is unchanged and nil is returned.
//
// Modular exponentiation of inputs of a particular size is not a
// cryptographically constant-time operation.