BigInteger.probablePrime()和其他素数算法之间的差异 [英] Difference between BigInteger.probablePrime() and other primality algorithms
问题描述
我正在实施RSA加密程序。现在我使用 BigInteger.probablePrime(1024,rnd)
其中 rnd
是由<$ cc $ c> Random rnd = new Random()获取素数。我需要测试各种加速速度。我的问题是 BigInteger.probablePrime(1024,rnd)
使用什么算法?和使用一些其他算法,如Rabin-Miller,Fermats,Lucas-Lehmer有什么区别?谢谢。
I am implementing an RSA encryption program. Right now I am using BigInteger.probablePrime(1024, rnd)
where rnd
is a random number generated by Random rnd = new Random()
to get prime numbers. I need to test various speeds of encryption. My question is what algorithm does the BigInteger.probablePrime(1024, rnd)
use? and what is the difference between that and using some other algorithm like Rabin-Miller, Fermats, Lucas-Lehmer? Thank you.
推荐答案
BigInteger
Miller-Rabin和Lucas-Lehmer算法测试原始性。
BigInteger
's probable prime methods use both the Miller-Rabin and Lucas-Lehmer algorithms to test primality.
查看内部方法 BigInteger.primeToCertainty
。
See the internal method BigInteger.primeToCertainty
.
这篇关于BigInteger.probablePrime()和其他素数算法之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!