]> Cypherpunks repositories - gostls13.git/commit
math/big: add modular square-root and Jacobi functions
authorBryan Ford <brynosaurus@gmail.com>
Fri, 19 Dec 2014 19:28:44 +0000 (14:28 -0500)
committerAdam Langley <agl@golang.org>
Thu, 30 Apr 2015 04:02:58 +0000 (04:02 +0000)
commitac6158828870abcbf7d9ef86c89569a2a7d7020c
treed0c53716bd93aa4e2015633d56689ac850574048
parent1ddb8c20c6f686170c506c6440e194a58c040bec
math/big: add modular square-root and Jacobi functions

This change adds Int.ModSqrt to compute modular square-roots via the
standard Tonelli-Shanks algorithm, and the Jacobi function that this and
many other modular-arithmetic algorithms depend on.

This is needed by change 1883 (https://golang.org/cl/1883), to add
support for ANSI-standard compressed encoding of elliptic curve points.

Change-Id: Icc4805001bba0b3cb7200e0b0a7f87b14a9e9439
Reviewed-on: https://go-review.googlesource.com/1886
Reviewed-by: Adam Langley <agl@golang.org>
src/math/big/int.go
src/math/big/int_test.go