]> Cypherpunks repositories - gostls13.git/commit
math/big: do not panic in Exp when y < 0 and x doesn't have an inverse
authorFilippo Valsorda <filippo@golang.org>
Thu, 4 Apr 2019 16:46:50 +0000 (12:46 -0400)
committerFilippo Valsorda <filippo@golang.org>
Thu, 4 Apr 2019 23:02:09 +0000 (23:02 +0000)
commitead895688def46f4c74c2a4c7ee560fc46663000
tree6a4cc95fabd2de1bc7877771c7bcb9120937fa9b
parenta8e83d2febe28a79e2906a9249ab2d79e0523c2a
math/big: do not panic in Exp when y < 0 and x doesn't have an inverse

If x does not have an inverse modulo m, and a negative exponent is used,
return nil just like ModInverse does now.

Change-Id: I8fa72f7a851e8cf77c5fab529ede88408740626f
Reviewed-on: https://go-review.googlesource.com/c/go/+/170757
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/int.go
src/math/big/int_test.go