bigi icon indicating copy to clipboard operation
bigi copied to clipboard

Primality test can return true for composites

Open randombit opened this issue 8 years ago • 1 comments

It appears the Miller-Rabin test implemented in bigi always chooses the base from the set of primes < 1000, however it is possible to construct a composite that appears prime relative to any fixed set of witnesses, and the paper https://math.dartmouth.edu/~carlp/PDF/reliable.pdf has a proof that there exist integers with no small witnesses at all.

The best fix is probably to choose the witnesses randomly from the range [2,n) which avoids the problem entirely.

randombit avatar May 08 '17 15:05 randombit

The better option is probably to deprecate it and remove it? This library isn't actively developed - only maintained - cautiously.

dcousens avatar May 08 '17 16:05 dcousens