]> Cypherpunks repositories - gostls13.git/commit
math/big: Allow non-prime modulus for ModInverse
authorKeith Randall <khr@golang.org>
Tue, 14 Oct 2014 21:09:56 +0000 (14:09 -0700)
committerKeith Randall <khr@golang.org>
Tue, 14 Oct 2014 21:09:56 +0000 (14:09 -0700)
commit96d1e4ab5938d263457a9c18fdf6fdf0581c6ec6
treefe525f99b8a9f55ddffa798034cafd43f7fe6369
parenta3416cf5cd06857c16fd2d1e665955f0b05248dd
math/big: Allow non-prime modulus for ModInverse

The inverse is defined whenever the element and the
modulus are relatively prime.  The code already handles
this situation, but the spec does not.

Test that it does indeed work.

Fixes #8875

LGTM=agl
R=agl
CC=golang-codereviews
https://golang.org/cl/155010043
src/math/big/int.go
src/math/big/int_test.go