aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory
Commit message (Collapse)AuthorAgeFilesLines
* Any fixed MR iterations is probably wrong for somebody. Allow the userlloyd2014-04-254-7/+49
| | | | | | to specify a probability as well as if n was randomly chosen or not. If the input is random use a better bounds to reduce the number of needed tests.
* Use 20 Miller-Rabin iterations regardless of the size of the integer. Thislloyd2014-04-132-184/+39
| | | | | provides a much better worst-case error bound. Also take the nonce from anywhere in the usable range rather than limiting the bit size.
* Fix a bug in Miller-Rabin primality testing introduced in 1.8.3lloyd2014-04-101-5/+6
| | | | | | | | where we chose a single random nonce and tested it repeatedly, rather than choosing new nonces each time. Reported by Jeff Marrison. Also remove a pointless comparison (also pointed out by Jeff) and add an initial test using a witness of 2.
* Clang fixeslloyd2014-02-091-1/+0
|
* Guess I won't be needing theselloyd2014-01-181-1/+0
|
* Move lib into srclloyd2014-01-1016-0/+2463