Closed silentsilas closed 4 years ago
Basically, isPrime(true) gives you a 100% certificate of primality based on proven mathematical theorems whereas the much more efficient isPrime(false) relies on the unproven-yet-widely-accepted-as-true GRH.
Incidentally, invoking isProbablePrime with the default parameters already tells you with something like 99.9% certainty whether or not a number is prime (and in a fraction of the time required for isPrime) so unless you just need cryptographically secure primes or what have you then isProbablePrime is the best option altogether.
Ah, that makes sense! We must have skimmed over GRH in my Intro to Crypto course. Thank you.
Sorry for the long delay in merging, I must have overlooked it before.
I'm building an interactive RSA tool, and I just about finished the key generation for up to 4086-bit keys when I realized Safari has yet to implement BigInt. So, needless to say, I wished to thank you for this library/polyfill and contribute what little I can to it.
Also, is there an ELI5 for that strict parameter? I understand it changes how many integers it tests against, but I haven't a clue what GRH is, lol.