math/strongprime.c: Replace inexplicable exponentiation with extended-gcd.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 11 May 2017 09:42:15 +0000 (10:42 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 14 May 2017 13:58:40 +0000 (14:58 +0100)
commitbd4902364e73cb062407b972ef7fecef3998d46a
tree6fbf07f8d547820d9599bc8cf819ed0bdbfa2102
parent373641eaacc86b56715a2ebf0b603fce25c16051
math/strongprime.c: Replace inexplicable exponentiation with extended-gcd.

For some reason, I calculated s^-1 as s^{r-2} (mod r).  This code isn't
even slightly constant-time, and gcd is faster than modexp.  Also, this
bit isn't time-critical anyway, and the code is way simpler like this.
math/strongprime.c