Break out after 2^16 tries, so we restart from a different random point if we don't find a cycle fairly quickly.
Break out after 2^16 tries, so we restart from a different random point
if we don't find a cycle fairly quickly.

Use (x^2 + x) % n instead of (x^2 - 1) % n; it seems to be giving better
(ie, faster) results, though to be honest I'm not sure exactly why this
should be the case.

webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan